Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Known bug in Qt 5.5 with QProcess signals?
Forum Updated to NodeBB v4.3 + New Features

Known bug in Qt 5.5 with QProcess signals?

Scheduled Pinned Locked Moved General and Desktop
qt 5.5osx yosemiteqprocessshared libraryconnectsignal & slotsignals
2 Posts 1 Posters 1.4k 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.
  • M Offline
    M Offline
    maximo
    wrote on 20 Sept 2015, 06:24 last edited by
    #1

    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'

    M 1 Reply Last reply 20 Sept 2015, 06:57
    0
    • M maximo
      20 Sept 2015, 06:24

      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'

      M Offline
      M Offline
      maximo
      wrote on 20 Sept 2015, 06:57 last edited by
      #2

      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.

      1 Reply Last reply
      0

      2/2

      20 Sept 2015, 06:57

      • Login

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