Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Menubar stops working after it is hidden in full screen mode
Qt 6.11 is out! See what's new in the release blog

Menubar stops working after it is hidden in full screen mode

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 4.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leonardyu
    wrote on last edited by
    #1

    When switching to full screen mode, we hide the menubar of main window with the code
    menuBar()->hide();
    Then the menu no longer works, so there is no way to switch back to the normal mode. How can I make menubar continue to work as it does in normal window mode?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Did you use "setVisible":http://developer.qt.nokia.com/doc/qt-4.8/qmenubar.html#setVisible ?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leonardyu
        wrote on last edited by
        #3

        Hi, my code looks like this:

        @// private slot when user press F11 to switch between full screen and normal mode
        void MainWindow::viewShowFullScreen()
        {
        static bool isToolboxVisible;

        if ( isFullScreen() ) {
        showNormal();
        // Show menubar, toolbar, status bar and other opened dialogs.
        menuBar()->show();
        fileToolBar->show();
        editToolBar->show();
        viewToolBar->show();
        mainstatusBar->show();
        if (isToolboxVisible)
        sToolbox->show();
        }
        else {
        showFullScreen();
        // Hide menubar, toolbar, status bar and other opened dialogs.
        menuBar()->hide();
        fileToolBar->hide();
        editToolBar->hide();
        viewToolBar->hide();
        mainstatusBar->hide();
        isToolboxVisible = (sToolbox && sToolbox->isVisible());
        if (isToolboxVisible)
        sToolbox->hide();
        }
        }@

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          Please use code "tagging.":http://developer.qt.nokia.com/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 Otherwise your code section cannot be interpret.

          You might want to check "setVisible (true)":http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html#visible-prop
          May be that is working.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leonardyu
            wrote on last edited by
            #5

            Sorry I still do not quite follow. How to check setVisible(), which is equivalent to show().

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              It is just a test in case that there is a bug, which I doubt.
              Are you sure that isFullScreen is returning true?
              You may want to check this in the debugger.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • L Offline
                L Offline
                leonardyu
                wrote on last edited by
                #7

                Yes, it returns true. If I comment out the line 20
                menuBar()->hide();
                the menubar works as normal.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  leonardyu
                  wrote on last edited by
                  #8

                  Is there anyone out there can fix this issue?

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved