VirtualBox

Ignore:
Timestamp:
Feb 4, 2019 6:10:00 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128631
Message:

FE/Qt: bugref:9373: Extend UIGraphicsScrollArea with redirected scrolling possibilities.

File:
1 edited

Legend:

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

    r77086 r77156  
    106106        layoutWidgets();
    107107
     108    /* Handle redirected wheel events: */
     109    if (pEvent->type() == QEvent::Wheel)
     110    {
     111        QWheelEvent *pWheelEvent = static_cast<QWheelEvent*>(pEvent);
     112        const QPoint angleDelta = pWheelEvent->angleDelta();
     113        switch (m_enmOrientation)
     114        {
     115            /* Scroll viewport horizontally: */
     116            case Qt::Horizontal:
     117            {
     118                if (angleDelta.x() > 0)
     119                    m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->wheelStep());
     120                else
     121                    m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->wheelStep());
     122                break;
     123            }
     124            /* Scroll viewport vertically: */
     125            case Qt::Vertical:
     126            {
     127                if (angleDelta.y() > 0)
     128                    m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->wheelStep());
     129                else
     130                    m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->wheelStep());
     131                break;
     132            }
     133        }
     134    }
     135
    108136    /* Call to base-class: */
    109137    return QIGraphicsWidget::eventFilter(pObject, pEvent);
Note: See TracChangeset for help on using the changeset viewer.

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