Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.10.1
-
None
-
Win7 64-bit. Qt 5.10.1
Description
midArea->setActiveSubWindow() will not work, if call setViewMode(QMdiArea::TabbedView) before adding the sub-windows.
_mdi_area->setViewMode(QMdiArea::TabbedView);
_mdi_area->setDocumentMode(true);
_mdi_area->setTabsMovable(false);
this->setCentralWidget(_mdi_area);
.....
QMdiSubWindow *win1 = _mdi_area->addSubWindow(child1);
win->showMaximized();
QMdiSubWindow *win2 = _mdi_area->addSubWindow(child2);
win->showMaximized();
_mdi_area->setActiveSubWindow(win1);
After launching, the active sub-window will be win2. But if move the clause "_mdi_area->setViewMode(QMdiArea::TabbedView);" to the last line, then the current active sub-window will be win1 as expected.