Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

Why QMdiArea would do shownormal() in deactiveallwindow?



  • good morning guys, I meet a problme when I read Qt's source code.
    in qmdiarea.cpp:

    it has such connect:
    @ QObject::connect(child, SIGNAL(aboutToActivate()), q, SLOT(_q_deactivateAllWindows()));@
    in _q_deactivateAllWindows():

    @ foreach (QMdiSubWindow *child, childWindows) {
    if (!sanityCheck(child, "QMdiArea::deactivateAllWindows") || aboutToBecomeActive == child)
    continue;
    // We don't want to handle signals caused by child->showNormal().
    ignoreWindowStateChange = true;
    if(!(options & QMdiArea::DontMaximizeSubWindowOnActivation) && !showActiveWindowMaximized)
    showActiveWindowMaximized = child->isMaximized() && child->isVisible();
    if (showActiveWindowMaximized && child->isMaximized()) {
    if (q->updatesEnabled()) {
    updatesDisabledByUs = true;
    q->setUpdatesEnabled(false);
    }
    child->showNormal(); //!< Why???????????
    }
    if (child->isMinimized() && !child->isShaded() && !windowStaysOnTop(child))
    child->lower();
    ignoreWindowStateChange = false;
    child->d_func()->setActive(false);
    }@

    why can't it just keep it's maximized size???

    thanks.


  • Lifetime Qt Champion

    Hi,

    Since you are going in Qt's code I would recommend asking this question on the interest mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented)


Log in to reply