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. Qprocess in thread
Forum Updated to NodeBB v4.3 + New Features

Qprocess in thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 836 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.
  • Christian EhrlicherC Online
    Christian EhrlicherC Online
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #2

    And once again - makeing something complicated because of using a thread for no good reason...
    but anyway: since you already have a member m_pRsyncprocess - why do you need to do an qobject_cast<> there at all instead simply accessing the member?

    btw: Where do you clean up m_pRsyncprocess and socket ?

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    1
    • S Offline
      S Offline
      satyanarayana143
      wrote on last edited by
      #3
      This post is deleted!
      1 Reply Last reply
      0
      • S Offline
        S Offline
        satyanarayana143
        wrote on last edited by
        #4

        m_pRsyncprocess running rsync commands that is not giving exact exitcode of rsync command.

        QProcess p = qobject_cast<QProcess>(sender());

        it is giving correct exit code of rsync

        Christian EhrlicherC 1 Reply Last reply
        0
        • S satyanarayana143

          m_pRsyncprocess running rsync commands that is not giving exact exitcode of rsync command.

          QProcess p = qobject_cast<QProcess>(sender());

          it is giving correct exit code of rsync

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @satyanarayana143 Then you're doing a lot of stuff wrong - m_pRsyncprocess and QProcess p = qobject_cast<QProcess>(sender()); must return the same pointer...
          And previously you told me that the qobject_cast<> was crashing, now you're telling me that the return code of the pointer retrieved by qobject_cast<> is different to what m_pRsyncprocess is returning... how can you know when the qobject_cast<> is crashing??

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2
          • S Offline
            S Offline
            satyanarayana143
            wrote on last edited by
            #6

            @satyanarayana143 said in Qprocess in thread:

            QProcess p = qobject_cast<QProcess>(sender());

            with out calling

            QProcess p = qobject_cast<QProcess>(sender());

            the exitcode is not of rsync exit code.

            if i call it is crashing

            QProcess p = qobject_cast<QProcess>(sender());

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @satyanarayana143 said in Qprocess in thread:

              the exitcode is not of rsync exit code.

              How do you know?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • S Offline
                S Offline
                satyanarayana143
                wrote on last edited by
                #8

                if rsync command in terminal for error some exitcode is coming and for proper execution exitcode is different

                but with Qporcess if error comes also exitcode is coming proper execution exitcode also same

                JonBJ 1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  So did you actually check if you pass the same parameter on the command line and in your program?

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    satyanarayana143
                    wrote on last edited by
                    #10

                    yes i am giving same command in terminal and for Qprocess

                    Christian EhrlicherC 1 Reply Last reply
                    0
                    • S satyanarayana143

                      if rsync command in terminal for error some exitcode is coming and for proper execution exitcode is different

                      but with Qporcess if error comes also exitcode is coming proper execution exitcode also same

                      JonBJ Online
                      JonBJ Online
                      JonB
                      wrote on last edited by
                      #11

                      @satyanarayana143 said in Qprocess in thread:

                      if rsync command in terminal for error some exitcode is coming and for proper execution exitcode is different
                      but with Qporcess if error comes also exitcode is coming proper execution exitcode also same

                      No idea what this means? I don't believe you will see different behaviour in rsync depending on whether you run from terminal or via QProcess. Show running it from terminal and code for running it from Qt app.

                      1 Reply Last reply
                      0
                      • S satyanarayana143

                        yes i am giving same command in terminal and for Qprocess

                        Christian EhrlicherC Online
                        Christian EhrlicherC Online
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @satyanarayana143 said in Qprocess in thread:

                        yes i am giving same command in terminal and for Qprocess

                        I don't believe this - esp. since you did not post the code for it.

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        1

                        • Login

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