Add SetValueSilently function to ClickableScrollBar.
This commit is contained in:
@@ -20,3 +20,10 @@ void ClickableScrollBar::mousePressEvent(QMouseEvent * event) {
|
||||
emit clicked();
|
||||
QScrollBar::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void ClickableScrollBar::SetValueSilently(int value) {
|
||||
if (this->value() ==value) return;
|
||||
setTracking(false);
|
||||
setValue(value);
|
||||
setTracking(true);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ public:
|
||||
explicit ClickableScrollBar(QWidget *parent = nullptr);
|
||||
explicit ClickableScrollBar(Qt::Orientation, QWidget *parent = nullptr);
|
||||
~ClickableScrollBar() override;
|
||||
void SetValueSilently(int value);
|
||||
Q_SIGNALS:
|
||||
void clicked();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user