From acb197557f6c553eb0df429279d93855d58eb241 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Thu, 1 Dec 2016 22:27:25 +0300 Subject: [PATCH] (EasyGraphicsView) Added possibility to scroll thread names list with mouse wheel --- profiler_gui/blocks_graphics_view.cpp | 10 ++++++++++ profiler_gui/blocks_graphics_view.h | 1 + 2 files changed, 11 insertions(+) diff --git a/profiler_gui/blocks_graphics_view.cpp b/profiler_gui/blocks_graphics_view.cpp index 81f276d..ef4e71f 100644 --- a/profiler_gui/blocks_graphics_view.cpp +++ b/profiler_gui/blocks_graphics_view.cpp @@ -1807,6 +1807,16 @@ void EasyThreadNamesWidget::keyReleaseEvent(QKeyEvent* _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()); + } +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/profiler_gui/blocks_graphics_view.h b/profiler_gui/blocks_graphics_view.h index 9b9555a..19a12fd 100644 --- a/profiler_gui/blocks_graphics_view.h +++ b/profiler_gui/blocks_graphics_view.h @@ -265,6 +265,7 @@ public: void mouseMoveEvent(QMouseEvent* _event) override; void keyPressEvent(QKeyEvent* _event) override; void keyReleaseEvent(QKeyEvent* _event) override; + void wheelEvent(QWheelEvent* _event) override; void dragEnterEvent(QDragEnterEvent*) override {}