Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Connecting a signal to another thread's slot
insomnia last edited by
First of all im new to qt, so bare with me:)
Im wondering which way is the right way to do it.
I have a customized QWidget object and a QThread object & I need send SIGNALS between both;
Signals&slots that reside inside UI I found quite comfortable to connect as it has a nice graphical tool(Qt C++ Signal Slot Editor) to do it. But as i got to the part where i needed a thread i was unable to connect with signals&slots that reside outside of UI. It seems editor will only see objects defined in ui_xxx.h file which is generated by uic program from the xxx.ui file. So its useless to edit the ui_xxx.h file as the changes will be lost.
My question is:
- is there a way connect signals/slots between QWidget and QThread with Qt C++ Signal Slot Editor?
- if not what is the correct way to do it?
Oh and I am using eclipse qt plugin...
dangelog last edited by
- No. Use connect()s in your code :)
- Don't add slots to QThread subclasses. Avoid QThread subclassing if possible.