Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is possible to read data of QProcess::readAllStandardOutput() which the process having time delay
Qt 6.12 LTS is out! See what's new in the release blog

Is possible to read data of QProcess::readAllStandardOutput() which the process having time delay

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    hai,,

    I am able to read data of a process which was normal C- code and it have while(1) condition but it does not have any delay functions.

    If I add any delay like for() loop or sleep() or timer value then Qprocess::readAllStandardOutput() was unable read any data from console how can I read data from process? Is it possible or not?

    In this delay program I removed the QProcess::waitforfinished() also, even it is not able to read data.

    If any body have the Idea then please help me

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Use signals QProcess::readyReadStandardOutput to connect it to your reading slot. With event based programming you can avoid while loops.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        thank you for your replay I am able to read the data of infinite loop using this signal and slot mechanism only.

        according to my application I want an infinite loop with some time delay thats why I am asking this question

        is there any other chances to over come this problem

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          I fail to understand why do you need a infinite loop if you are using a event based mechanism. May be if you can post some code or rephrase the problem then it is easier to understand.
          Moreover, if you halt the reading thread in an infinite loop, there is no way you can read it, for it was you who told it to sleep!!
          I think I am not understanding your problem.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            My project was related to Industrial project. In this QT is used as user friendly (like used as HMI) to client. Background of qt we are running a process which is C-based code, C-Code is communication between qt to hardware.

            C-Code was reading the data from hardware using some API related to that hardware. The reading data from hardware is displayed on terminal and it was read by qt using Qprocess::readAllStandardOutput().

            It is real time based project so we want while() loop in that c code,
            according to the hardware we want time delay which is less than 100msec.

            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
            • Unsolved