Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QT 5.3 Mac Full Screen

I'm trying to set my application to full screen and back in Qt 5.3, but I'm running into some issues on Mac. When I use showFullScreen(), it goes into full screen as expected. It uses the standard Mac full screen mode where it opens in a separate desktop/space. However, when I call showNormal() to return from full screen mode, the application window just disappears and I'm left with a gray background. I need to swipe in order to return to the regular desktop where the application is.

Is this a bug in Qt or am I doing something wrong? I'm on OS X 10.9.3.

like image 307
Rhys Causey Avatar asked Jun 17 '14 14:06

Rhys Causey


1 Answers

I had similar problems with Qt 5.2 on Mac OS X (but not Qt 4.8). This seems to fix it:

if ( showFullScreen )
{
    widget->setParent( NULL );
    widget->showFullScreen();
}
else
{
    // changing the order of the showNormal() and setParent() results in a grey screen in Qt 5 on Mac
    widget->showNormal();
    widget->setParent( widgetParent ); // reset the original parent
}
like image 142
Andy Brice Avatar answered Sep 30 '22 14:09

Andy Brice