Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QThread and QThreadPool coexistence
Forum Updated to NodeBB v4.3 + New Features

QThread and QThreadPool coexistence

Scheduled Pinned Locked Moved Solved Qt for Python
qt for python
5 Posts 2 Posters 428 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.
  • B Offline
    B Offline
    borisruna
    wrote on 26 Mar 2022, 18:44 last edited by
    #1

    Is it OK to create a QThreadPool that spawns workers, when your application already has a QThread , or do I have to use only a single QThreadPool in the application, that spawns QRunnables and work with those?

    Thank you in advance!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Mar 2022, 19:40 last edited by
      #2

      Hi,

      These two have two different use cases so yes, you can use both in the same application.

      What is your use case ?

      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
      • B Offline
        B Offline
        borisruna
        wrote on 26 Mar 2022, 20:24 last edited by
        #3

        I would like to have a long running QThread that captures my webcam with OpenCV, and would like to be possible to use QThreadPool to use python's requests library to POST screenshots to a web server when a user clicks a button.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 26 Mar 2022, 20:35 last edited by
          #4

          I don't see any issue using both.

          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
          • B Offline
            B Offline
            borisruna
            wrote on 26 Mar 2022, 20:45 last edited by
            #5

            Much appreciated @SGaist!

            1 Reply Last reply
            0

            2/5

            26 Mar 2022, 19:40

            • Login

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