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]QProgressBar makes use QProcess?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]QProgressBar makes use QProcess?

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 3.1k Views
  • 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.
  • R Offline
    R Offline
    Renn
    wrote on last edited by Renn
    #1

    Hello, I want to ask about the progress bar with qprocess.
    If we make progressbar using qprocess, how to take the value of qprocess?

    1 Reply Last reply
    0
    • Hamed.MasafiH Offline
      Hamed.MasafiH Offline
      Hamed.Masafi
      wrote on last edited by
      #2

      Your process should have a mechanism for percent. For example if you run cmake with QProcess it will print progress on output and you can read it from beggining of line and set to QProgressBar

      Remote object sharing (OO RPC)
      http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

      Advanced, Powerful and easy to use ORM for Qt5
      https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

      R 1 Reply Last reply
      0
      • Hamed.MasafiH Hamed.Masafi

        Your process should have a mechanism for percent. For example if you run cmake with QProcess it will print progress on output and you can read it from beggining of line and set to QProgressBar

        R Offline
        R Offline
        Renn
        wrote on last edited by
        #3

        @Hamed.Masafi Suppose I want to use QProcess with the command "dd if = of =", while in the process that I want to use QProgressBar to determine the extent to which it wants to complete the process.

        1 Reply Last reply
        0
        • Hamed.MasafiH Offline
          Hamed.MasafiH Offline
          Hamed.Masafi
          wrote on last edited by
          #4

          You can use pv with dd, for example:

          pv -n /dev/urandom | dd of=/dev/null
          

          That will be print progress on output, after that read output from QProcess and analyse it and extract percent progress and set it to QProgressBar

          Remote object sharing (OO RPC)
          http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

          Advanced, Powerful and easy to use ORM for Qt5
          https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

          R 1 Reply Last reply
          0
          • Hamed.MasafiH Hamed.Masafi

            You can use pv with dd, for example:

            pv -n /dev/urandom | dd of=/dev/null
            

            That will be print progress on output, after that read output from QProcess and analyse it and extract percent progress and set it to QProgressBar

            R Offline
            R Offline
            Renn
            wrote on last edited by
            #5

            @Hamed.Masafi /dev/urandom it means what ??

            1 Reply Last reply
            0
            • Hamed.MasafiH Offline
              Hamed.MasafiH Offline
              Hamed.Masafi
              wrote on last edited by
              #6

              @Renn Just an example combine your dd command with pv

              Remote object sharing (OO RPC)
              http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

              Advanced, Powerful and easy to use ORM for Qt5
              https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

              R 1 Reply Last reply
              0
              • Hamed.MasafiH Hamed.Masafi

                @Renn Just an example combine your dd command with pv

                R Offline
                R Offline
                Renn
                wrote on last edited by
                #7

                @Hamed.Masafi /dev/null null why? Can you give me the clearest explanation to clear?

                1 Reply Last reply
                0
                • Hamed.MasafiH Offline
                  Hamed.MasafiH Offline
                  Hamed.Masafi
                  wrote on last edited by
                  #8

                  @Renn put your full dd command please

                  Remote object sharing (OO RPC)
                  http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

                  Advanced, Powerful and easy to use ORM for Qt5
                  https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

                  R 2 Replies Last reply
                  0
                  • Hamed.MasafiH Hamed.Masafi

                    @Renn put your full dd command please

                    R Offline
                    R Offline
                    Renn
                    wrote on last edited by
                    #9

                    @Hamed.Masafi Okay I will try later, I want to ask again, if I want to remove my last fdisk partition of format, is able to put a value to the progress?

                    1 Reply Last reply
                    0
                    • Hamed.MasafiH Hamed.Masafi

                      @Renn put your full dd command please

                      R Offline
                      R Offline
                      Renn
                      wrote on last edited by Renn
                      #10

                      @Hamed.Masafi can so read the output through QProcess in runtime and combine them into progressbarnya it how? I've tried to use readAllStandardOutput() and readAll() do not read runtime.

                      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