VirtualBox

Changeset 9391 in vbox for trunk/src


Ignore:
Timestamp:
Jun 4, 2008 3:01:57 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Start dragging not on clicking but on mouse move first.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/QILabel_p.h

    r9386 r9391  
    8787    void resizeEvent (QResizeEvent *aEvent);
    8888    void mousePressEvent (QMouseEvent *aEvent);
     89    void mouseReleaseEvent (QMouseEvent *aEvent);
     90    void mouseMoveEvent (QMouseEvent *aEvent);
    8991    void contextMenuEvent (QContextMenuEvent *aEvent);
    9092
     
    129131    static QRegExp mElideRegExp;
    130132    QSize mOwnSizeHint;
     133    bool mStartDraging;
    131134};
    132135
  • trunk/src/VBox/Frontends/VirtualBox4/src/QILabel.cpp

    r9386 r9391  
    288288        geometry().contains (aEvent->pos()) &&
    289289        mFullSizeSeclection)
    290     {
     290        mStartDraging = true;
     291    else
     292        QLabel::mousePressEvent (aEvent);
     293}
     294
     295void QILabelPrivate::mouseReleaseEvent (QMouseEvent *aEvent)
     296{
     297    mStartDraging = false;
     298    QLabel::mouseReleaseEvent (aEvent);
     299}
     300
     301void QILabelPrivate::mouseMoveEvent (QMouseEvent *aEvent)
     302{
     303    if (mStartDraging)
     304    {
     305        mStartDraging = false;
    291306        /* Create a drag object out of the given data. */
    292307        QDrag *drag = new QDrag (this);
     
    298313    }
    299314    else
    300         QLabel::mousePressEvent (aEvent);
     315        QLabel::mouseMoveEvent (aEvent);
    301316}
    302317
     
    323338void QILabelPrivate::init()
    324339{
     340    mStartDraging = false;
    325341    setFullSizeSelection (false);
    326342    /* Open links with the QDesktopService */
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