VirtualBox

Changeset 65547 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 31, 2017 4:00:02 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8636: Runtime UI: Mini-toolbar: Store parent separately to get rid of unwanted dependency.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r65546 r65547  
    134134    QList<QWidget*> m_margins;
    135135};
     136
     137
     138/*********************************************************************************************************************************
     139*   Class UIMiniToolBarPrivate implementation.                                                                                   *
     140*********************************************************************************************************************************/
    136141
    137142UIMiniToolBarPrivate::UIMiniToolBarPrivate()
     
    391396}
    392397
     398
     399/*********************************************************************************************************************************
     400*   Class UIMiniToolBar implementation.                                                                                          *
     401*********************************************************************************************************************************/
     402
    393403/* static */
    394404Qt::WindowFlags UIMiniToolBar::defaultWindowFlags(GeometryType geometryType)
     
    423433    : QWidget(pParent, defaultWindowFlags(geometryType))
    424434    /* Variables: General stuff: */
     435    , m_pParent(pParent)
    425436    , m_geometryType(geometryType)
    426437    , m_alignment(alignment)
     
    646657
    647658    /* Get corresponding host-screen: */
    648     const int iHostScreen = gpDesktop->screenNumber(parentWidget());
     659    const int iHostScreen = gpDesktop->screenNumber(m_pParent);
    649660    Q_UNUSED(iHostScreen);
    650661    /* And corresponding working area: */
     
    735746    /* Install event-filters: */
    736747    installEventFilter(this);
    737     parent()->installEventFilter(this);
     748    m_pParent->installEventFilter(this);
    738749
    739750#if   defined(VBOX_WS_WIN)
     
    942953
    943954    /* If that's parent window event: */
    944     if (pWatched == parent())
     955    if (pWatched == m_pParent)
    945956    {
    946957        switch (pEvent->type())
     
    974985            {
    975986                /* Skip if parent or we are invisible: */
    976                 if (   !parentWidget()->isVisible()
     987                if (   !m_pParent->isVisible()
    977988                    || !isVisible())
    978989                    break;
     
    10031014                QWindowStateChangeEvent *pChangeEvent = static_cast<QWindowStateChangeEvent*>(pEvent);
    10041015                LogRel2(("GUI: UIMiniToolBar::eventFilter: Parent window state changed from %d to %d\n",
    1005                          (int)pChangeEvent->oldState(), (int)parentWidget()->windowState()));
    1006                 if (parentWidget()->windowState() & Qt::WindowMinimized)
     1016                         (int)pChangeEvent->oldState(), (int)m_pParent->windowState()));
     1017                if (m_pParent->windowState() & Qt::WindowMinimized)
    10071018                {
    10081019                    /* Mark parent window minimized, isMinimized() is not enough due to Qt5vsX11 fight: */
     
    10111022                }
    10121023                else
    1013                 if (parentWidget()->windowState() == Qt::WindowFullScreen)
     1024                if (m_pParent->windowState() == Qt::WindowFullScreen)
    10141025                {
    10151026                    /* Mark parent window non-minimized, isMinimized() is not enough due to Qt5vsX11 fight: */
     
    10671078    return m_fIsParentMinimized;
    10681079#else
    1069     return parentWidget()->isMinimized();
     1080    return m_pParent->isMinimized();
    10701081#endif
    10711082}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r65536 r65547  
    157157    bool isParentMinimized() const;
    158158
     159    /** Holds the parent reference. */
     160    QWidget *m_pParent;
     161
    159162    /** Holds the geometry type. */
    160163    const GeometryType m_geometryType;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette