Skip to content

Commit

Permalink
using a mainwindow for daq_viewer for proper closing
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed Jun 20, 2024
1 parent 707e507 commit 578f2f3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pymodaq_plugins_teaching/app/beam_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ def setup_docks(self):
self.lcd = LCD(QtWidgets.QWidget(), Nvals=5, labels=['X', 'Y', 'dx', 'dy', 'theta'])
self.docks['lcds'].addWidget(self.lcd.parent)

self.camera_area = gutils.DockArea()
self.camera_viewer = DAQ_Viewer(self.camera_area, title='BSCamera', daq_type='DAQ2D')
cam_window = QtWidgets.QMainWindow()
dockarea = gutils.DockArea()
cam_window.setCentralWidget(dockarea)
self.camera_viewer = DAQ_Viewer(dockarea, title='BSCamera', daq_type='DAQ2D')
self.camera_viewer.detector = 'BSCamera'
self.camera_area.show()
cam_window.show()

self.camera_viewer.init_hardware()
QtWidgets.QApplication.processEvents()
Expand All @@ -78,9 +80,9 @@ def connect_things(self):
self.connect_action('quit', self.quit_app)

def quit_app(self):
self.parent.parent().close()
self.camera_viewer.quit_fun()
self.camera_area.parent().close()
self.camera_viewer.dockarea.parent().close()
self.mainwindow.close()

def setup_menu(self):
"""Non mandatory method to be subclassed in order to create a menubar
Expand Down

0 comments on commit 578f2f3

Please sign in to comment.