Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QWidgetFactory in PyQt5
Qt 6.11 is out! See what's new in the release blog

QWidgetFactory in PyQt5

Scheduled Pinned Locked Moved Unsolved Qt for Python
15 Posts 5 Posters 1.5k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Ay CH
    wrote on last edited by
    #3

    I have this problem now : AttributeError: 'QFormBuilder' object has no attribute 'create'

    JonBJ 1 Reply Last reply
    0
    • A Ay CH

      I have this problem now : AttributeError: 'QFormBuilder' object has no attribute 'create'

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #4

      @Ay-CH
      Well there is no QFormBuilder::create() method.
      Nobody said the code from QWidgetFactory to QFormBuilder would be identical, you have to port/upgrade from Qt3 to later....

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Ay CH
        wrote on last edited by
        #5

        fen = loadMainWidget(default_conf.path.ui+"clickme.ui")

        fen.connect(fen.children("quit"), pyqtSignal(), qApp.quit)
        fen.connect(fen.child("startICT"), pyqtSignal("clicked()"), onTest_1)
        fen.connect(fen.child("goldenICT"), pyqtSignal("clicked()"), onMasterICT)
        fen.connect(fen.child("R_R_ICT"), pyqtSignal("clicked()"), onTestRR)

        AttributeError: 'QMainWindowFactory' object has no attribute 'connect' ?

        how can i fixe that please i'm blocked here for a long time ?

        JonBJ 1 Reply Last reply
        0
        • A Ay CH

          fen = loadMainWidget(default_conf.path.ui+"clickme.ui")

          fen.connect(fen.children("quit"), pyqtSignal(), qApp.quit)
          fen.connect(fen.child("startICT"), pyqtSignal("clicked()"), onTest_1)
          fen.connect(fen.child("goldenICT"), pyqtSignal("clicked()"), onMasterICT)
          fen.connect(fen.child("R_R_ICT"), pyqtSignal("clicked()"), onTestRR)

          AttributeError: 'QMainWindowFactory' object has no attribute 'connect' ?

          how can i fixe that please i'm blocked here for a long time ?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #6

          @Ay-CH
          There is no such Qt class as QMainWindowFactory, and never has been.

          Separately, I have no idea what your syntax for connect() is. I have never used Qt3. In PyQt5 connects are done as

          self.qobjectvariable.signal.connect(self.slot)
          

          e.g.

          self.pushbutton.clicked.connect(self.onPushbutton_click)
          
          1 Reply Last reply
          1
          • A Offline
            A Offline
            Ay CH
            wrote on last edited by
            #7

            I replaced it with mainWindow, is there a way to associate the QmainWindow with the signals? If so can you show me how? because the compiler shows me that Qmainwindow object has no attribute 'connect' without using the self because i'm working out of the classe ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8

              Hi,

              Because with PyQt or PySide, it's the signal objects that have the connect method as shown by the examples of @JonB.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Ay CH
                wrote on last edited by
                #9

                qApp.lock()
                AttributeError: 'QApplication' object has no attribute 'lock' ? what's the solution in Qt5 please ?
                @JonB @SGaist ?

                jsulmJ 1 Reply Last reply
                0
                • A Ay CH

                  qApp.lock()
                  AttributeError: 'QApplication' object has no attribute 'lock' ? what's the solution in Qt5 please ?
                  @JonB @SGaist ?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  @Ay-CH said in QWidgetFactory in PyQt5:

                  qApp.lock()

                  What do you need this for?
                  There is no such thing in Qt4/Qt5/Qt6.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Ay CH
                    wrote on last edited by
                    #11

                    As i said in my fist message, i'm working in a project that was wirtten in python2 and i should write with python3, qApp.lock() was written in the last project

                    jsulmJ 1 Reply Last reply
                    0
                    • A Ay CH

                      As i said in my fist message, i'm working in a project that was wirtten in python2 and i should write with python3, qApp.lock() was written in the last project

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      @Ay-CH There is no such thing in newer Qt versions - they do not have global lock. Simply remove qApp.lock() or replace it with https://doc.qt.io/qt-5/qmutexlocker.html depending on the needs of you app.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      2
                      • A Offline
                        A Offline
                        Ay CH
                        wrote on last edited by
                        #13

                        Hello,

                        Here, I would like to be able to load an interface from a ui file in the same window by clicking on a button for example.

                        I have searched the Web and I have not found any help on this yet it is something recurring in many applications.

                        I would like to know if anyone has succeeded and how they did it...

                        Thank you very much for taking the time to read.

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Ay CH
                          wrote on last edited by
                          #14

                          hello,

                          What's the equivalent of QCustomEvent in PyQt5 ?

                          Thank you very much for taking the time to read.
                          @JonB @SGaist @jsulm

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #15

                            See the porting recommendation for Qt 4 (doing it will make it work with Qt 5).

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1

                            • Login

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