VirtualBox

Changeset 3567 in vbox for trunk/src


Ignore:
Timestamp:
Jul 12, 2007 12:20:50 AM (18 years ago)
Author:
vboxsync
Message:

Make mousePressEvent() also bring up the context menu for QIStateIndicator objects (mac os x specific).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/QIStateIndicator.h

    r2981 r3567  
    6262    virtual void drawContents (QPainter *aPainter);
    6363
     64#ifdef Q_WS_MAC
     65    virtual void mousePressEvent (QMouseEvent *aEv);
     66#endif
    6467    virtual void mouseDoubleClickEvent (QMouseEvent *aEv);
    6568    virtual void contextMenuEvent (QContextMenuEvent *aEv);
  • trunk/src/VBox/Frontends/VirtualBox/src/QIStateIndicator.cpp

    r2981 r3567  
    151151}
    152152
     153#ifdef Q_WS_MAC
     154/**
     155 * Make the left button also show the context menu to make things
     156 * simpler for users with single mouse button mice (laptops++).
     157 */
     158void QIStateIndicator::mousePressEvent (QMouseEvent *aEv)
     159{
     160    QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0);
     161    emit contextMenuRequested (this, &qme);
     162    if (qme.isAccepted())
     163        aEv->accept();
     164    else
     165        QFrame::mousePressEvent (aEv);
     166}
     167#endif /* Q_WS_MAC */
     168
    153169void QIStateIndicator::mouseDoubleClickEvent (QMouseEvent * e)
    154170{
     
    160176    emit contextMenuRequested (this, e);
    161177}
     178
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