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

Native QWindow based OpenGL/Vulkan windows positions are wrongly offset inside QMdiSubWindow

    XMLWordPrintable

Details

    Description

      When assigning a QWindow derived window to a MdiSubWindow, its position gets offset to the left and top by the width of the window frame, which is 8 pixels exactly, this happens even when the sub window is maximized and there is no frame or border. Setting the window as main window or as a child of a layout on a non MDI widget does not show this behavior.

      I am creating this bug report after finding no work around.

      This is the code that creates the Sub Window:

      // code placeholder
      void MainWindow::on_actionOpen_triggered()
      {
      QString filename = QFileDialog::getOpenFileName ( this,
      tr ( "Open Model" ),
      tr ( "" ),
      tr ( "Model Files (*.mdl *.txt)" ) );
      if ( ! ( filename.isEmpty() || filename.isNull() ) )
      {
      QFileInfo fileinfo ( filename );
      EngineWindow* window = new EngineWindow ( mRenderer );
      QMdiSubWindow*
      mdiSubWindow = mdiArea->addSubWindow ( QWidget::createWindowContainer ( window, mdiArea ) );
      mdiSubWindow->setAttribute ( Qt::WA_DeleteOnClose );
      mdiSubWindow->setWindowTitle ( fileinfo.absoluteFilePath() );
      mdiSubWindow->showMaximized();
      mdiSubWindow->setMinimumSize ( QSize ( 128, 128 ) );
      window->setModel ( fileinfo.absoluteFilePath() );
      }
      }
      
      

      The full code of the project is at:

      https://github.com/AeonGames/AeonEngine/tree/master/tools/modelviewer

      It is not exactly easy to build, but it may help to look at the code when root causing the issue, I may try to create a minimal test case if required. (I don't think OpenGL or Vulkan is the reason for the problem)

      See images attached for visual aid.

       

      Attachments

        1. OpenGLMaximized.png
          80 kB
          Rodrigo Hernandez Cordoba
        2. OpenGLNormal.png
          63 kB
          Rodrigo Hernandez Cordoba
        3. VulkanMaximized.png
          73 kB
          Rodrigo Hernandez Cordoba
        4. VulkanNormal.png
          51 kB
          Rodrigo Hernandez Cordoba
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            Kwizatz Rodrigo Hernandez Cordoba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes