Known bug in Qt 5.5 with QProcess signals?
-
Is there like a known bug in Qt 5.5 with QProcess signals when used inside an external library? I mean, I can have my main GUI application receive the QProcess pointer and then use
connect()
from there, and the signals work fine. But when I try to make my library more self-contained and handle the signals inside the library like so:// note I have private: QProcess *goConsole in .h goConsole = new QProcess(); goConsole->setEnvironment(QProcess::systemEnvironment()); goConsole->setProcessChannelMode(QProcess::MergedChannels); goConsole->connect(goConsole,SIGNAL(readyReadStandardOutput()),this,SLOT(processRead())); goConsole->connect(goConsole,SIGNAL(finished()),this,SLOT(processFinished(int))); goConsole->start(sCommand); goConsole->waitForStarted();
...I get: no matching member for call to 'connect'
-
I figured it out. I needed to set my QObject and QCore stuff properly. In the .pro file of the shared library, I added:
QT += core
In the shared library's .h file, I switched this:
class CTSCANSHARED_EXPORT ctScan { public: ...blah blah...
with this:
class CTSCANSHARED_EXPORT ctScan: public QObject { Q_OBJECT public: ...blah blah...
And then ensured the shared library's .h file had this:
#include <QObject>
And then it compiled properly.