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.
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With