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 can I put a thread within a class for a library
Qt 6.11 is out! See what's new in the release blog

how can I put a thread within a class for a library

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 547 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.
  • A Offline
    A Offline
    AI_Messiah
    wrote on last edited by
    #1

    The thing is I just want the thread to go into the class and disable the thread from being created outside of it.

    JKSHJ 1 Reply Last reply
    0
    • A AI_Messiah

      The thing is I just want the thread to go into the class and disable the thread from being created outside of it.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @AI_Messiah said in how can I put a thread within a class for a library:

      The thing is I just want the thread to go into the class and disable the thread from being created outside of it.

      Can you please provide more details? What is the purpose of the thread? How long should the thread run for?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AI_Messiah
        wrote on last edited by
        #3

        Well I want to do a lot of operations within a class. So I mean for eternity unless it is told to stop, but I just want one thread. I would like to have other members inside it that run in on their own time. I know about mutex.

        JKSHJ 1 Reply Last reply
        0
        • A AI_Messiah

          Well I want to do a lot of operations within a class. So I mean for eternity unless it is told to stop, but I just want one thread. I would like to have other members inside it that run in on their own time. I know about mutex.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @AI_Messiah said in how can I put a thread within a class for a library:

          Well I want to do a lot of operations within a class.

          What type of operations? What is the benefit of running them in another thread instead of running them in the main thread? (For example: Using Qt, even things like networking and serial port communications can be done efficiently in the main thread)

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          5

          • Login

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