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

QMainWindow reappears at different position with QOpenGLWidget in QMdiSubWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.0
    • None
    • Windows 10, x64, Visual Studio 2022
    • Windows

    Description

      If you put a QOpenGLWidget in a QMdiSubWindow and you add the sub window in a QMdiArea that is the central widget of a QMainWindow, the main window disappears for a moment, then it reappears in a different position.

      A sample code to reproduce the issue:

      QMainWindow* mw = new QMainWindow();
      QMdiArea* mdi = new QMdiArea(mw);
      mw->setCentralWidget(mdi);
      QToolBar* toolbar = mw->addToolBar(QString("Main toolbar"));
      QAction* testAction = toolbar->addAction(QString("Test"));
      connect(testAction, &QAction::triggered, [=]() { 
        QOpenGLWidget* oglw = new QOpenGLWidget();
        QMdiSubWindow* sw = new QMdiSubWindow();
        sw->setWidget(oglw);
        mdi->addSubWindow(sw);
        sw->show();
      });
      mw->show();

      (click on the "Test" action to add the sub window)

      The problem only occurs the first time you add the sub window.

      Attachments

        Issue Links

          Activity

            People

              lagocs Laszlo Agocs
              puffosauro Fabio Dago
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: