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. [Solved] QObject::connect() for C++11 lambda expression doesn't work
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k 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
    moravas
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moravas
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No worries, this happens to everybody :)

          Happy coding !

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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