Mercurial > hg > svgui
diff widgets/Thumbwheel.h @ 1586:bbc3f537564c
Add context menu to Thumbwheel
author | Chris Cannam |
---|---|
date | Fri, 27 Mar 2020 11:04:56 +0000 |
parents | a18e78b9c78b |
children |
line wrap: on
line diff
--- a/widgets/Thumbwheel.h Fri Mar 27 11:04:48 2020 +0000 +++ b/widgets/Thumbwheel.h Fri Mar 27 11:04:56 2020 +0000 @@ -24,6 +24,7 @@ #include "WheelCounter.h" class RangeMapper; +class QMenu; class Thumbwheel : public QWidget { @@ -46,6 +47,7 @@ double getMappedValue() const; void setShowToolTip(bool show); + void setProvideContextMenu(bool provide); QSize sizeHint() const override; @@ -66,9 +68,12 @@ void setMappedValue(double mappedValue); void scroll(bool up); void resetToDefault(); + void edit(); protected slots: void updateMappedValue(int value); + void updateTitle(); + void contextMenuRequested(const QPoint &); protected: void mousePressEvent(QMouseEvent *e) override; @@ -96,6 +101,9 @@ QPoint m_clickPos; float m_clickRotation; bool m_showTooltip; + bool m_provideContextMenu; + QString m_title; + QMenu *m_lastContextMenu; RangeMapper *m_rangeMapper; QImage m_cache; WheelCounter m_wheelCounter;