0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 01:04:41 +08:00

(EasyGraphicsView) Added possibility to scroll thread names list with mouse wheel

This commit is contained in:
Victor Zarubkin 2016-12-01 22:27:25 +03:00
parent 33bd7256ab
commit acb197557f
2 changed files with 11 additions and 0 deletions

View File

@ -1807,6 +1807,16 @@ void EasyThreadNamesWidget::keyReleaseEvent(QKeyEvent* _event)
m_view->keyReleaseEvent(_event); m_view->keyReleaseEvent(_event);
} }
void EasyThreadNamesWidget::wheelEvent(QWheelEvent* _event)
{
auto vbar = m_view->verticalScrollBar();
if (vbar != nullptr)
{
_event->accept();
vbar->setValue(vbar->value() - _event->delta());
}
}
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

View File

@ -265,6 +265,7 @@ public:
void mouseMoveEvent(QMouseEvent* _event) override; void mouseMoveEvent(QMouseEvent* _event) override;
void keyPressEvent(QKeyEvent* _event) override; void keyPressEvent(QKeyEvent* _event) override;
void keyReleaseEvent(QKeyEvent* _event) override; void keyReleaseEvent(QKeyEvent* _event) override;
void wheelEvent(QWheelEvent* _event) override;
void dragEnterEvent(QDragEnterEvent*) override {} void dragEnterEvent(QDragEnterEvent*) override {}