Results 1 to 2 of 2

Thread: Flickering when change QWidget window state between showMaximized() and showFullScree

  1. #1
    Join Date
    Apr 2013
    Posts
    61
    Qt products
    Qt4
    Platforms
    Windows

    Default Flickering when change QWidget window state between showMaximized() and showFullScree

    Hi,

    I have problems with 'WindowStateChange' events in my QWidget.
    I have created a simple test widget with 3 buttons, to set window state:
    Normal: showNormal();
    MAX: showMaximized();
    FullScreen: showFullScreen();
    and trace window state events (QEvent::WindowStateChange).

    When I change 'normal' < > 'max' there is no problem (altough i receive twice 'max' event), BUT when i change 'max' <> 'fullscreen' i receive this events:

    'max' --> 'fullscreen'
    ----------------------------
    0 No State
    4 FullScreen

    'fullscreen' --> 'max'
    ---------------------------
    6 Maximized
    4 FullScreen
    6 Maximized
    2 Maximized

    with code like this:
    Qt Code:
    1. state = windowState();
    2. if ( state & Qt::WindowMaximized )
    3. qDebug() << state << "Maximized";
    To copy to clipboard, switch view to plain text mode 

    So my widget has in both cases a strange flickering. That is, when 'max' --> 'fullscreen', it has an 'intermediate' "normal" state (0), and when 'fullscreen' --> 'max', it has several 'intermediate' states...

    In my application, I must show/hide things when app is normal/maximized/fullScreened, so this flickering is really a problem.

    Is it possible to do anything?

    Thanks in advance,

    Diego

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Flickering when change QWidget window state between showMaximized() and showFullS

    You could try delaying the visibilty change of your elements, e.g. using a single shot QTimer or QMetaObject::invokeMethod with Qt::QueuedConnection.

    I.e. so that your change is done after the event series.

    Cheers,
    _

Similar Threads

  1. Change state property within a current state?
    By prophet0 in forum Qt Quick
    Replies: 1
    Last Post: 30th May 2012, 19:23
  2. Handling window state change
    By sudhansu in forum Qt Programming
    Replies: 0
    Last Post: 10th November 2010, 12:28
  3. State machine inside a QWidget
    By leoalvesmachado in forum Newbie
    Replies: 10
    Last Post: 4th August 2010, 18:36
  4. QVariantAnimation causes flickering on QWidget
    By lamgi667 in forum Qt Programming
    Replies: 0
    Last Post: 3rd June 2010, 09:56
  5. Flickering when drawing Qt widgets over an OpenGL window
    By ksierens in forum Qt Programming
    Replies: 0
    Last Post: 31st May 2010, 14:31

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.