When relaunching plugin I don't get the main window I get the pop up window
Moved
Unsolved
Language Bindings
-
Hello,
I am developing a python plugin on QGIS using PyQT. My plugin contains a main window and a pop-up window which will be launched when clicking on a button on the main window. My problem is when I relaunch again the plugin, the pop-up window will be displayed instead of the main window.
Can you help me ?
Thank you in advance.
-
@EJWA
Hi
Should you not post some code then ? -
Hello @mrjj :
In my main window, I call to launch my pop-up window :
def show(self): self.project.load() if self.project.tranus_project: self.tranus_folder.setText(self.project.tranus_project.path) self.activate_launch_button() self.launch_options_TRANUS() super(OptionsTRANUSDialog, self).show() ...... def launch_options_TRANUS(self): self.get_checked_list() if self.checked_list != [] : dialog = launch_tranus_dialog.LaunchTRANUSDialog(self.checked_list,self.folder,self.tranus_binaries,parent=self) dialog.show() result = dialog.exec_() self.reinitialise_checked_list()
The class of my pop-up window is defined as :
class LaunchTRANUSDialog(QtGui.QDialog, FORM_CLASS): def __init__(self,checked_list,project_directory,tranus_bin_path,parent=None): """Constructor.""" super(LaunchTRANUSDialog, self).__init__(parent) self.setupUi(self) self.project = parent.project self.proj = QgsProject.instance() self.tranus_bin_path = tranus_bin_path self.project_directory = project_directory self.project = parent.project self.checked_list = checked_list self.is_all_checked = False self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget') self.proj = QgsProject.instance() #control actions self.tabs.blockSignals(True) self.tabs.currentChanged.connect(self.onChange) self.tabs.blockSignals(False) def show(self): self.put_tabs() super(LaunchTRANUSDialog, self).show()