Results 1 to 8 of 8

Thread: dialog content is not painted

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2013
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: dialog content is not painted

    That would work (run custom code in separate thread in background) but I'd like to avoid that. This is how it worked before and I'd like to run it in main thread to avoid any deadlock/synchronisation dangerous.

    What I tried is to run processEvents() loop (with some sleep) in another thread to re-paint the dialog. It runs correctly but without any visible result.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dialog content is not painted

    Quote Originally Posted by miso View Post
    That would work (run custom code in separate thread in background) but I'd like to avoid that.
    I'm sorry -- it's either threads or stalling the GUI thread while your custom code is running. Adding timers or whatever else that requires event processing will not help you in any way.

    What I tried is to run processEvents() loop (with some sleep) in another thread to re-paint the dialog. It runs correctly but without any visible result.
    Because it processes the other thread which has nothing to process.

    You simply have no choice. Either you run custom code in thread other than the GUI thread or your GUI thread will not respond during the time the custom code is ran.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2013
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: dialog content is not painted

    I understand that. But because of QSplashScreen, I though it is somehow possible, isn't it?
    And I can't use QSplashScreen from Python (I use PyQt4) because I can't override mousePressEvent (it's protected) so click will close the widget.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dialog content is not painted

    Quote Originally Posted by miso View Post
    I understand that. But because of QSplashScreen, I though it is somehow possible, isn't it?
    No, QSplashScreen works the same way. If you don't let it process events, it will not be updated.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QDialogButtonBox text not painted
    By kshi in forum Qt Programming
    Replies: 0
    Last Post: 8th January 2011, 00:41
  2. How to erase everything widget has painted?
    By TheNewGuy in forum Newbie
    Replies: 1
    Last Post: 12th December 2009, 07:23
  3. Widget not painted properly
    By qwakaw in forum Qt Programming
    Replies: 0
    Last Post: 11th November 2008, 11:30
  4. Tabs/Dialog with hidden/extendable content
    By dentharg in forum Qt Tools
    Replies: 6
    Last Post: 20th November 2007, 19:30

Tags for this Thread

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.