def get_plot_windows_layout_dict(self): windows_layout = {} for winId, win in self.vm.win_inventory.getWindowsItems(PLOT_WINDOW_LABEL): plot_frame_widget = win.widget() # getting weakref plot_interface = plot_frame_widget.plotInterface() if not plot_interface: continue gwd = GraphicsWindowData() gwd.sceneName = plot_interface.title gwd.winType = 'plot' plot_window = plot_interface.plotWindow mdi_plot_window = win gwd.winSize = mdi_plot_window.size() gwd.winPosition = mdi_plot_window.pos() windows_layout[gwd.sceneName] = gwd.toDict() return windows_layout
def getPlotWindowsLayoutDict(self): windowsLayout = {} for winId, win in self.vm.win_inventory.getWindowsItems(PLOT_WINDOW_LABEL): plotFrameWidget = win.widget() plotInterface = plotFrameWidget.plotInterface() # getting weakref if not plotInterface: continue gwd = GraphicsWindowData() gwd.sceneName = plotInterface.title gwd.winType = 'plot' plotWindow = plotInterface.plotWindow mdiPlotWindow = win # mdiPlotWindow = self.vm.findMDISubWindowForWidget(plotWindow) print('plotWindow=', plotWindow) print('mdiPlotWindow=', mdiPlotWindow) gwd.winSize = mdiPlotWindow.size() gwd.winPosition = mdiPlotWindow.pos() windowsLayout[gwd.sceneName] = gwd.toDict() return windowsLayout