16#ifndef QGSRANGESLIDER_H
17#define QGSRANGESLIDER_H
22#include <QStyleOptionSlider>
245 void setRange(
int lower,
int upper );
292 int pick(
const QPoint &pt )
const;
293 int pixelPosToRangeValue(
int pos )
const;
294 bool updateHoverControl(
const QPoint &pos );
295 bool newHoverControl(
const QPoint &pos );
296 QRect selectedRangeRect();
297 void drawFocusRect();
305 int mFixedRangeSize = -1;
307 QStyleOptionSlider mStyleOption;
317 void applyStep(
int step );
318 int unFlippedSliderPosition(
int value )
const;
320 Control mActiveControl =
None;
321 int mStartDragPos = -1;
322 int mLowerClickOffset = 0;
323 int mUpperClickOffset = 0;
324 int mRangeDragOffset = 0;
325 int mPreDragLowerValue = -1;
326 int mPreDragUpperValue = -1;
327 Control mHoverControl =
None;
328 Control mFocusControl = Lower;
329 QStyle::SubControl mHoverSubControl = QStyle::SC_None;
332 bool mFlipped =
false;
void setUpperValue(int value)
Sets the upper value for the range currently selected in the widget.
void setRangeLimits(int minimum, int maximum)
Sets the minimum and maximum range limits for values allowed in the widget.
QgsRangeSlider(QWidget *parent=nullptr)
Constructor for QgsRangeSlider, with the specified parent widget.
void setOrientation(Qt::Orientation orientation)
Sets the orientation of the slider.
void setTickInterval(int interval)
Sets the interval for tick marks shown in the widget.
int upperValue() const
Returns the upper value for the range selected in the widget.
int tickInterval() const
Returns the interval for tick marks shown in the widget.
void paintEvent(QPaintEvent *event) override
void fixedRangeSizeChanged(int size)
Emitted when the widget's fixed range size is changed.
void rangeLimitsChanged(int minimum, int maximum)
Emitted when the limits of values allowed in the widget is changed.
QSize sizeHint() const override
void keyPressEvent(QKeyEvent *event) override
void mouseMoveEvent(QMouseEvent *event) override
void rangeChanged(int minimum, int maximum)
Emitted when the range selected in the widget is changed.
int maximum() const
Returns the maximum value allowed by the widget.
void mousePressEvent(QMouseEvent *event) override
bool event(QEvent *event) override
void setSingleStep(int step)
Sets the single step value for the widget.
void setMinimum(int minimum)
Sets the minimum value allowed in the widget.
void setPageStep(int step)
Sets the page step value for the widget.
Qt::Orientation orientation() const
Returns the orientation of the slider.
void setMaximum(int maximum)
Sets the maximum value allowed in the widget.
int pageStep() const
Returns the page step value for the widget.
void setFlippedDirection(bool flipped)
Sets whether the slider has its values flipped.
int fixedRangeSize() const
Returns the slider's fixed range size, or -1 if not set.
int minimum() const
Returns the minimum value allowed by the widget.
QSize minimumSizeHint() const override
void setRange(int lower, int upper)
Sets the current range selected in the widget.
void setLowerValue(int value)
Sets the lower value for the range currently selected in the widget.
int lowerValue() const
Returns the lower value for the range selected in the widget.
void setTickPosition(QSlider::TickPosition position)
Sets the position of the tick marks shown in the widget.
void setFixedRangeSize(int size)
Sets the slider's fixed range size.
void mouseReleaseEvent(QMouseEvent *event) override
bool flippedDirection() const
Returns true if the slider has its values flipped.
QSlider::TickPosition tickPosition() const
Returns the position of the tick marks shown in the widget.
int singleStep() const
Returns the single step value for the widget.