- modified the way that the plotcanvas widget is added

This commit is contained in:
Marius Stanciu
2020-12-15 16:34:37 +02:00
committed by Marius
parent 2d6b78d28c
commit a785aabdcc
5 changed files with 50 additions and 21 deletions

View File

@@ -1121,6 +1121,9 @@ class App(QtCore.QObject):
if self.plotcanvas == 'fail':
return
# add he PlotCanvas setup to the UI
self.on_plotcanvas_add(self.plotcanvas, self.ui.right_layout)
# Storage for shapes, storage that can be used by FlatCAm tools for utility geometry
# VisPy visuals
if self.is_legacy is False:
@@ -1545,7 +1548,7 @@ class App(QtCore.QObject):
# ###########################################################################################################
self.log.debug("END of constructor. Releasing control.")
self.log.debug("... Resistance is futile. You will be assimilated ...")
self.log.debug("... I disagree. We will not be vaccinated ... We are free!\n")
self.log.debug("... I disagree. While we live and breath, we can be free!\n")
# ###########################################################################################################
# ########################################## SHOW GUI #######################################################
@@ -8049,10 +8052,10 @@ class App(QtCore.QObject):
if self.is_legacy is True or modifier == QtCore.Qt.ControlModifier:
self.is_legacy = True
self.defaults["global_graphic_engine"] = "2D"
plotcanvas = PlotCanvasLegacy(plot_container, self)
plotcanvas = PlotCanvasLegacy(self)
else:
try:
plotcanvas = PlotCanvas(plot_container, self)
plotcanvas = PlotCanvas(self)
except Exception as er:
msg_txt = traceback.format_exc()
self.log.debug("App.on_plotcanvas_setup() failed -> %s" % str(er))
@@ -8092,6 +8095,18 @@ class App(QtCore.QObject):
return plotcanvas
def on_plotcanvas_add(self, plotcanvas_obj, container):
"""
:param plotcanvas_obj: the class that setup the canvas
:type plotcanvas_obj: class
:param container: a layout where to add the native widget of the plotcanvas_obj class
:type container:
:return: Nothing
:rtype: None
"""
container.addWidget(plotcanvas_obj.native)
def on_zoom_fit(self):
"""
Callback for zoom-fit request. This can be either from the corresponding