Results 1 to 3 of 3

Thread: [PyQt] How to do two threads, two windows?

  1. #1
    Join Date
    May 2009
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default [PyQt] How to do two threads, two windows?

    Hi,

    I have an application that runs out of a QMainWindow. I have an operation that needs to run in a separate thread and output text to a separate dialog. The dialog needs to be killed if the main window is exited/rejected.

    It would be nice for the user if the main window and the dialog were controlled by separate threads, so heavy updates on the one window won't bog down the other.

    I think I've overcomplicated my implementation, as you can see in my other post, and I suspect I might need to do something like is found in this post.

    I've accepted that I don't quite understand what needs to be done and so have come to the newbie list

    Many thanks.

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Qt products
    Qt4
    Platforms
    Windows Android
    Thanks
    14
    Thanked 13 Times in 13 Posts

    Default Re: [PyQt] How to do two threads, two windows?

    Hi
    I understand you have two different QMainWindows?

    if so, in order to work them together in the meaning of exiting/ rejecting, you can set your subwindow window flag.

    yourSubWin-> setWindowFlag(blabla);

  3. #3
    Join Date
    May 2009
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default Re: [PyQt] How to do two threads, two windows?

    Thanks for the response...

    I have a main window as a QMainWindow and a dialog with a QTextEdit that is to be used for output.

    Pushing a button on the main window needs to spawn a thread to run an operation and also create the dialog box, which the thread will then use for output. That dialog box has its own close button but also needs to close automatically if the main window is closed.

    Hope that explains it a little better.

Similar Threads

  1. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 23:05
  2. Replies: 5
    Last Post: 15th January 2009, 10:03
  3. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 02:00
  4. Problems with threads and windows
    By SkripT in forum Qt Programming
    Replies: 15
    Last Post: 16th January 2006, 18:46
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 23:33

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
  •  
Qt is a trademark of The Qt Company.