[Solved] QObject::connect() for C++11 lambda expression doesn't work



  • Hi Folks,

    I have a project, wher a user interaction starts a new process via a QProcess instance. The output is redirected into a QTextEdit object. To do that, I use a lambda expression:
    @
    connect(&_process, &QProcess::readyReadStandardError, this {_ui->_runOverview->append(QString(_process.readAllStandardOutput()));});
    @

    When I start the process, I don't see anyithing on the TextEdit. I tried to debug by using of qDebug() macro, but it wrote out nothing (just an empty ""). Can anybody help me?

    Regards,
    Norbert


  • Lifetime Qt Champion

    Hi,

    Just a wild guess but shouldn't you be reading from readAllStandardError since you connect to readyReadStandardError ?

    Hope it helps



  • Hi,

    I'm sorry:) you are right... I mixed the two output, because I need the standard error and the standard output as well.

    Regards,
    Norbert


  • Lifetime Qt Champion

    No worries, this happens to everybody :)

    Happy coding !


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.