def create_window(self): """ Create a QMainWindow instance containing this SpyderWidget. """ # Widgets self.windowwidget = window = SpyderWindowWidget(self) # If the close corner button is used self.windowwidget.sig_closed.connect(self.close_window) # Wigdet setup window.setAttribute(Qt.WA_DeleteOnClose) window.setCentralWidget(self) window.setWindowIcon(self.get_icon()) window.setWindowTitle(self.get_title()) window.resize(self.size()) if self.dockwidget: self.dockwidget.setFloating(False) self.dockwidget.setVisible(False) self.set_ancestor(window) self._update_actions() window.sig_closed.connect(self.close_window) window.show()
def create_window(self): """ Create a QMainWindow instance containing this widget. """ logger.debug("Undocking plugin") # Widgets self.windowwidget = window = SpyderWindowWidget(self) # If the close corner button is used self.windowwidget.sig_closed.connect(self.close_window) # Wigdet setup window.setAttribute(Qt.WA_DeleteOnClose) window.setCentralWidget(self) window.setWindowIcon(self.get_icon()) window.setWindowTitle(self.get_title()) window.resize(self.size()) # Restore window geometry geometry = self.get_conf('window_geometry', default='') if geometry: try: window.restoreGeometry( QByteArray().fromHex(str(geometry).encode('utf-8')) ) except Exception: pass # Dock widget setup if self.dockwidget: self.dockwidget.setFloating(False) self.dockwidget.setVisible(False) self.set_ancestor(window) self._update_actions() window.show()