Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. When relaunching plugin I don't get the main window I get the pop up window

When relaunching plugin I don't get the main window I get the pop up window

Scheduled Pinned Locked Moved Unsolved Language Bindings
python
3 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    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.

    mrjjM 1 Reply Last reply
    0
    • ? A Former User

      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.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @EJWA
      Hi
      Should you not post some code then ?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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() 
                
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved