25 #include "ginteractor.h" 29 class _Internal_QSlider;
64 GSlider(
int min = 0,
int max = 100,
int value = 50, QWidget* parent =
nullptr);
70 GSlider(
Orientation orientation,
int min = 0,
int max = 100,
int value = 50, QWidget* parent =
nullptr);
84 virtual int getMajorTickSpacing()
const;
89 virtual int getMax()
const;
94 virtual int getMin()
const;
100 virtual int getMinorTickSpacing()
const;
112 virtual bool getPaintLabels()
const;
118 virtual bool getPaintTicks()
const;
125 virtual bool getSnapToTicks()
const;
128 string
getType()
const override;
142 virtual void setMajorTickSpacing(
int value);
148 virtual void setMax(
int max);
154 virtual void setMin(
int min);
160 virtual void setMinorTickSpacing(
int value);
167 virtual void setPaintLabels(
bool value);
173 virtual void setPaintTicks(
bool value);
179 virtual void setRange(
int min,
int max);
186 virtual void setSnapToTicks(
bool value);
192 virtual void setState(
int min,
int max,
int value);
204 string getActionEventType()
const override;
209 _Internal_QSlider* _iqslider;
211 friend class _Internal_QSlider;
218 class _Internal_QSlider :
public QSlider,
public _Internal_QWidget {
222 _Internal_QSlider(
GSlider* qgslider, Qt::Orientation orientation = Qt::Horizontal, QWidget* parent =
nullptr);
223 void detach()
override;
224 void keyPressEvent(QKeyEvent* event)
override;
225 void keyReleaseEvent(QKeyEvent* event)
override;
226 QSize sizeHint()
const override;
229 void handleChange(
int value);
static const int DEFAULT_MIN_VALUE
Default minimum value for a slider (0).
Definition: gslider.h:48
string getType() const override
Returns a string representing the class name of this interactor, such as "GButton" or "GCheckBox"...
Definition: gslider.cpp:114
virtual void setValue(int value)
Sets the current value of the slider.
Definition: gslider.cpp:194
GSlider(int min=0, int max=100, int value=50, QWidget* parent=nullptr)
Creates a new horizontal slider with the given value range.
Definition: gslider.cpp:31
static const int DEFAULT_MAX_VALUE
Default maximum value for a slider (100).
Definition: gslider.h:53
This abstract class is the superclass for all graphical interactors.
Definition: ginteractor.h:52
virtual int getValue() const
Returns the slider's current value.
Definition: gslider.cpp:118
virtual Orientation getOrientation() const
Returns the orientation of the slider, either HORIZONTAL or VERTICAL.
Definition: gslider.cpp:95
QWidget* getWidget() const override
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
Definition: gslider.cpp:122
~GSlider() override
Frees memory allocated internally by the slider.
Definition: gslider.cpp:65
_Internal_QWidget* getInternalWidget() const override
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
Definition: gslider.cpp:75
This interactor subclass represents an onscreen slider.
Definition: gslider.h:35
virtual int getMax() const
Returns the maximum allowed value of the slider.
Definition: gslider.cpp:83
Orientation
The two valid orientations of sliders.
Definition: gslider.h:40
virtual void setRange(int min, int max)
Sets the min-max range of the slider.
Definition: gslider.cpp:168
virtual void setState(int min, int max, int value)
Sets all of the relevant state of the slider.
Definition: gslider.cpp:181
virtual int getMin() const
Returns the minimum allowed value of the slider.
Definition: gslider.cpp:87
virtual void setMax(int max)
Sets the maximum allowed value of the slider.
Definition: gslider.cpp:132
virtual void setMin(int min)
Sets the minimum allowed value of the slider.
Definition: gslider.cpp:142
static const int DEFAULT_INITIAL_VALUE
Default initial value for a slider (50).
Definition: gslider.h:58