QWidgetFactory in PyQt5
-
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 ?
-
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 ?
@Ay-CH
There is no such Qt class asQMainWindowFactory, 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 asself.qobjectvariable.signal.connect(self.slot)e.g.
self.pushbutton.clicked.connect(self.onPushbutton_click) -
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 ?
-
Hi,
Because with PyQt or PySide, it's the signal objects that have the connect method as shown by the examples of @JonB.
-
@Ay-CH said in QWidgetFactory in PyQt5:
qApp.lock()
What do you need this for?
There is no such thing in Qt4/Qt5/Qt6. -
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
@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.
-
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.
-
See the porting recommendation for Qt 4 (doing it will make it work with Qt 5).