Results 1 to 3 of 3

Thread: Spawn a QThread in another QThread

  1. #1

    Default Spawn a QThread in another QThread

    Hi all,

    I am new to the community and this is me first post.

    My questions is:
    Can I create a QThread instance inside another QThread instance which is not the main thread of the program? I heard that it can generate some strange behavior if to do so.

    Any comments?

    Thanks
    Dave

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Spawn a QThread in another QThread

    Hello,

    Yes, of course you can. The same rules apply as when starting the worker from the GUI thread.

    I heard that it can generate some strange behavior if to do so.
    What kind of behavior? If you run iin to it, post the problem here. I'm sure we can find a solution.

  3. #3
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Spawn a QThread in another QThread

    Quote Originally Posted by marcel View Post
    Hello,

    Yes, of course you can. The same rules apply as when starting the worker from the GUI thread.


    What kind of behavior? If you run iin to it, post the problem here. I'm sure we can find a solution.
    Anytime you resort toi using threads you run the risk of strange behaviour. More threads mean all the more risk. Not that you should'nt use them, but they are a two edged sword.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.