Please nominate your Qt Champions for 2021!

FullScreen prevents showing the sub menu bar

  • Hello,
    this is my first post here in the forum. I have been working with Qt for a year and some change but i am still in the process of learning.
    I have encountered an issue while trying to add a full screen mode to the desktop app i'm working on. When the Full screen is active, clicking on my menu bar (File, View, Edit ...) does not show anything although navigating with the keyboard will give me results.
    Here is my code:

    void MainWindow::on_actionFull_Screen_triggered()
    if (!this->isFullScreen()) {
    mOldState = this->isMaximized();
    this->ui->actionFull_Screen->setText("Exit Full Screen");
    } else {
    this->ui->actionFull_Screen->setText("Enter Full Screen");
    if (mOldState) {this->showMaximized();}
    else {this->showNormal();}

    When I am off the fullscreen everything works as intended of course. I have tried setting the menu bar to visibile or random things in the menu bar to visible and not hidden and nothing worked.

    I wanted to change the name from enter and close on run time and with a qdebug i know it works but as i said, it does not show.
    mOldState is a Boolean to save the old state of the app (maximized or not) so i can restore the app to its previous state once the user wants to switch back from full screen.
    The shortcuts works fine and I can easily switch from fullscreen to normal mode and only the menu tab does not show its content.
    One more thing, while doing a print screens for this topic, i noticed that although the window is invisible to me, it showed when i was doing print screens.

    If you need any more information on my issue feel free to ask me. Thank you.
    1_1566231451736_normal presentation.png ![0_1566231451736_fullscreen.png]
    What i See
    0_1566231862525_what i see.png


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please add:

    • the version of Qt you are using
    • the OS you are running

    Also, can you provide a minimal compilable example that reproduces that behaviour ?

  • Hello SGaist,

    Thank you for the reply. I am using Windows 10 Home edition with Qt 5.12.4.
    The problem is only in windows, I tried linux and macos and both work as intended.
    I tried to do a minimal compilable example that reproduces the behaviour but i couldn't, the full screen does not prevent the menubar to show the contents for a simple example.
    I don't know if the status bar or some of the actions related to it are interfering with the menu bar but that is my best guess. I don't have any other concrete thing or idea to check. I don't have anything that uses Qt::WindowStaysOnTopHint too.