Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36396

Windows: Menu bar not visible (does not repaint) in QMainWindow fullscreen mode when QGLWidget is set as central widget

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.2.0
    • None
    • Windows 7, Visual Studio 2013, QT 5.2

      When you set QGLWidget as central widget to QMainWindow, and run this window in fullscreen, menu bar is not visible. It however reacts to user input, when you click where active menu is, it expands and you see submenu. We find out sometimes helps when you call setVisible(true) before calling showFullScreen(), unfortunately in some our apps this call hangs (setVisible) so it's not legit workaround for this bug. Also we tested it in QT 4.x, and it works, menu is visible.

      main.cpp
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>
      #include "MainWin.h"
      #include <QApplication>
      #include <QtGui/QtGui>

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);
      MainWin window;
      //window.setVisible(true); // uncomment to make menu in fullscreen visible
      window.showFullScreen();
      return app.exec();
      }
      //////////////////////////////////////
      MainWin.h
      //////////////////////////////////////
      #pragma once

      #include <QtOpenGL/QtOpenGL>
      #include <QtGui/QtGui>

      class MainWin : public QMainWindow
      {
      Q_OBJECT

      public:
      MainWin(QWidget* parent = 0)
      :QMainWindow(parent)

      { menu = menuBar()->addMenu(tr("&File")); menu->addAction(tr("&Quit"), this, SLOT(close())); setCentralWidget(new QGLWidget()); }

      protected:
      QMenu* menu;
      };

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            eddie_br Petr Dannhofer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes