Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    PyQt connect works on Windows but not on Linux

    Language Bindings
    1
    1
    786
    Loading More Posts
    • 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.
    • S
      Superbebert last edited by

      Hi,

      I have a small problem with PyQt. I coded connect which works well under windows but not on linux. I use qtDesigner to generate design.
      This is main parts of my soft:
      IHM.py file:
      @
      class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
      MainWindow.setObjectName(_fromUtf8("MainWindow"))
      MainWindow.resize(952, 778)
      MainWindow.setProperty("accessibleName", _fromUtf8(""))
      [...]
      self.action_Quitter = QtGui.QAction(MainWindow)
      self.action_Quitter.setCheckable(False)
      self.action_Quitter.setObjectName(_fromUtf8("action_Quitter"))
      @

      this main.py file
      @
      class GDOC(QtGui.QMainWindow,Ui_MainWindow):
      """Main Qt Window"""

          def __init__(self,Form):
              print "GDOC:init Initialisation Application"
              self.config=config_file()
              #self.config.print_conf()
              self.Form=Form
              dbname=self.config.get_config_elem("ref_db")
              self.dbref=db_manag(Form,dbname)
              #self.config.add_elem("ref_db",str(dbFileInfo))
      
          def setupUi2(self,Form):
              """Ajoutons ce qu'il manque à la fenêtre"""
              self.Form=Form
              Ui_MainWindow.setupUi(self, Form)
              # A conserver pour rediriger l'exit de la croix vers le close_event
              Form.closeEvent = self.close_event
      
              QObject.connect(self.action_Quitter,SIGNAL("triggered()"),self.test)
         
          def test(self):
              print "coucou"
          [...]
      

      if name == "main":
      app = QtGui.QApplication(sys.argv)
      MainWindow = QtGui.QMainWindow()
      ui = GDOC(MainWindow)
      ui.setupUi2(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
      @

      So, window is well displayed on both versions (Linux and windows), but test function is never executed under Linux and there is not error messages.
      Add Info:
      Linux: Python User Interface Compiler 4.9.1 for Qt version 4.8.1
      Windows: Python User Interface Compiler 4.9.5 for Qt version 4.8.3
      and code generated by pyuic4 is the same between Windows and Linux version.
      If somebody can help.
      Many Thanks
      Superbebert

      1 Reply Last reply Reply Quote 0
      • First post
        Last post