Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.1
-
None
-
Windows 10
Visual Studio 2017
64bit
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.