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

midArea->setActiveSubWindow() will NOT work, if called after setViewMode(QMdiArea::TabbedView)

    XMLWordPrintable

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. 

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            diverger Hua Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: