VirtualBox

Changeset 93999 in vbox


Ignore:
Timestamp:
Feb 28, 2022 10:45:46 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: qt6: In qt6 there is now a QEnterEvent so the enterEvent signature changed and made if difficult to call enterEvent() from leaveEvent. bugref:9898

File:
1 edited

Legend:

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

    r93990 r93999  
    114114    virtual void mouseMoveEvent(QMouseEvent *pEvent) RT_OVERRIDE;
    115115    /** Handles mouse-enter @a pEvent. */
     116#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
     117    virtual void enterEvent(QEnterEvent *pEvent) RT_OVERRIDE;
     118#else
    116119    virtual void enterEvent(QEvent *pEvent) RT_OVERRIDE;
     120#endif
    117121    /** Handles mouse-leave @a pEvent. */
    118122    virtual void leaveEvent(QEvent *pEvent) RT_OVERRIDE;
     
    575579}
    576580
     581#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
     582void UITabBarItem::enterEvent(QEnterEvent *pEvent)
     583#else
    577584void UITabBarItem::enterEvent(QEvent *pEvent)
     585#endif
    578586{
    579587    /* Make sure button isn't hovered: */
     
    594602    /* Make sure button is hovered: */
    595603    if (!m_fHovered)
     604    {
     605#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) /** @todo qt6: Code duplication of enterEvent; split out in separate method (complete wast of time to cook up a QEnterEvent here). */
     606# ifdef VBOX_WS_MAC
     607        m_pLayoutStacked->setCurrentWidget(m_pButtonClose);
     608# endif
     609        m_fHovered = true;
     610        /* And call for repaint: */
     611        update();
     612        RT_NOREF(pEvent);
     613        return;
     614#else
    596615        return QWidget::enterEvent(pEvent);
     616#endif
     617    }
    597618
    598619    /* Invert hovered state: */
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