Qt Mouse Scroll

- 1 min

Qt deal with Mouse Scroll Event

bool QDialog::eventFilter(QObject *target, QEvent *event)
{
    if (target == *SomeQGraphicsScene*)
    {
       if (event->type() == QEvent::GraphicsSceneWheel)
       {
           const QGraphicsSceneWheelEvent * const me = static_cast<const QGraphicsSceneWheelEvent*>(event);
           /* deal with me->delta() */
           return true;
        }
    }
    return false;
}
comments powered by Disqus
rss facebook twitter github gitlab youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora