Results 1 to 7 of 7

Thread: Lost widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Lost widget

    Qt Code:
    1. while(eThread.isRunning())
    2. usleep(100);
    To copy to clipboard, switch view to plain text mode 

    But what is this for? It stops the main thread. And if so, why do you need another thread? You can move its functionality to the main thread and the result will be identical. Better yet, you can split the work you do in the other thread into smaller chunks and use a QTimer with 0 interval to trigger next steps of the process and you'll gain this, that you won't block the event handling and your gui will remain responsive.

    I think, my case is very common case in UI coding. Isn't it?
    "Common" doesn't mean "proper". You can achieve the same without using a separate thread which only slows down the process.

  2. The following user says thank you to wysota for this useful post:

    anli (29th July 2006)

Similar Threads

  1. Replies: 19
    Last Post: 22nd December 2007, 11:23
  2. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  3. Replies: 4
    Last Post: 24th March 2006, 22:50
  4. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16
  5. advanced split widget
    By vitaly in forum Qt Programming
    Replies: 10
    Last Post: 24th January 2006, 20:00

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.