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. how to create asynchronus thread in qt ?
Forum Updated to NodeBB v4.3 + New Features

how to create asynchronus thread in qt ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 459 Views 2 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    I have to show the file copy's value on progress bar using non blocking gui thread.

    How to do this ?

    Christian EhrlicherC 1 Reply Last reply
    0
    • Q Qt embedded developer

      I have to show the file copy's value on progress bar using non blocking gui thread.

      How to do this ?

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

      @Qt-embedded-developer said in how to create asynchronus thread in qt ?:

      How to do this ?

      You're long enough here to know that you won't get code form us.

      Create a thread, copy the data from one file to another and emit the progress via a signal so you can show it in the main thread.

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

      Q JonBJ 2 Replies Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        @Qt-embedded-developer said in how to create asynchronus thread in qt ?:

        How to do this ?

        You're long enough here to know that you won't get code form us.

        Create a thread, copy the data from one file to another and emit the progress via a signal so you can show it in the main thread.

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by
        #3

        @Christian-Ehrlicher thread is blocking my main application gui so i requested how to create non blocking gui thread ?

        Christian EhrlicherC 1 Reply Last reply
        0
        • Q Qt embedded developer

          @Christian-Ehrlicher thread is blocking my main application gui so i requested how to create non blocking gui thread ?

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

          @Qt-embedded-developer said in how to create asynchronus thread in qt ?:

          thread is blocking my main application gui

          Then you use your thread in a wrong way - a thread will never block another thread by itself. Read the docs.

          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
          3
          • Christian EhrlicherC Christian Ehrlicher

            @Qt-embedded-developer said in how to create asynchronus thread in qt ?:

            How to do this ?

            You're long enough here to know that you won't get code form us.

            Create a thread, copy the data from one file to another and emit the progress via a signal so you can show it in the main thread.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Christian-Ehrlicher said in how to create asynchronus thread in qt ?:

            copy the data from one file to another and emit the progress via a signal

            But one cannot use any QFile::copy() for this because it does not offer to send any progress signal, so you are intended to write the copy yourself? Since people often ask for this it would have been nice if QFile::copy() had such an option?

            Christian EhrlicherC 1 Reply Last reply
            0
            • JonBJ JonB

              @Christian-Ehrlicher said in how to create asynchronus thread in qt ?:

              copy the data from one file to another and emit the progress via a signal

              But one cannot use any QFile::copy() for this because it does not offer to send any progress signal, so you are intended to write the copy yourself? Since people often ask for this it would have been nice if QFile::copy() had such an option?

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

              @JonB said in how to create asynchronus thread in qt ?:

              Since people often ask for this it would have been nice if QFile::copy() had such an option?

              Then you have to ask the os vendors to implement it.

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

              JonBJ 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @JonB said in how to create asynchronus thread in qt ?:

                Since people often ask for this it would have been nice if QFile::copy() had such an option?

                Then you have to ask the os vendors to implement it.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @Christian-Ehrlicher
                Ah, I did not know it was using a C runtime copyfile(), I assumed it was doing it itself (own source code).

                I can tell you one thing: there was no copyfile(3) in the standard C library when I started under System V.0 at least :) (Maybe it was always there in BSD, that wasn't what I was using.) I never looked to see they apparently added this/others to C libc!

                In that man page I'm reading that copyfile() already has a Progress Callback support mechanism which could be used from Qt?

                Kent-DorfmanK Christian EhrlicherC 2 Replies Last reply
                0
                • JonBJ JonB

                  @Christian-Ehrlicher
                  Ah, I did not know it was using a C runtime copyfile(), I assumed it was doing it itself (own source code).

                  I can tell you one thing: there was no copyfile(3) in the standard C library when I started under System V.0 at least :) (Maybe it was always there in BSD, that wasn't what I was using.) I never looked to see they apparently added this/others to C libc!

                  In that man page I'm reading that copyfile() already has a Progress Callback support mechanism which could be used from Qt?

                  Kent-DorfmanK Offline
                  Kent-DorfmanK Offline
                  Kent-Dorfman
                  wrote on last edited by
                  #8

                  @JonB said in how to create asynchronus thread in qt ?:

                  I can tell you one thing: there was no copyfile(3) in the standard C library when I started under System V.0 at least :)

                  modern filecopy operations often use mmap alchemy and let the OS virtual memory manager handle the IO with source and destination file handles. It can be much more efficient than block IO copies to/from user space.

                  I light my way forward with the fires of all the bridges I've burned behind me.

                  1 Reply Last reply
                  1
                  • JonBJ JonB

                    @Christian-Ehrlicher
                    Ah, I did not know it was using a C runtime copyfile(), I assumed it was doing it itself (own source code).

                    I can tell you one thing: there was no copyfile(3) in the standard C library when I started under System V.0 at least :) (Maybe it was always there in BSD, that wasn't what I was using.) I never looked to see they apparently added this/others to C libc!

                    In that man page I'm reading that copyfile() already has a Progress Callback support mechanism which could be used from Qt?

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

                    @JonB said in how to create asynchronus thread in qt ?:

                    In that man page I'm reading that copyfile() already has a Progress Callback support mechanism which could be used from Qt?

                    I don't see a reason why this should be added to Qt. As my other link shows it's not available for windows and if someone really needs it it can be simply done by themself as written in my first post.

                    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