KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
Slider Class Reference

QSlider subclass with an optional read-only mode. More...

#include <slider.h>

+ Inheritance diagram for Slider:
+ Collaboration diagram for Slider:

Public Member Functions

 Slider (QWidget *parent=nullptr)
 Construct with an optional parent.
 
 Slider (Qt::Orientation orientation, QWidget *parent=nullptr)
 Construct with a specific orientation.
 
bool isReadOnly () const
 Return whether the slider is read-only.
 
void setReadOnly (bool value)
 Enable or disable the read-only mode.
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) override
 Suppress mouse presses when in read-only mode.
 

Detailed Description

QSlider subclass with an optional read-only mode.

Slider exposes a readOnly property. When set, mouse press events are suppressed so that the slider value cannot be changed by the user.

Definition at line 13 of file slider.h.

Constructor & Destructor Documentation

◆ Slider() [1/2]

Slider::Slider ( QWidget *  parent = nullptr)
explicit

Construct with an optional parent.

Parameters
parentOptional QWidget parent

◆ Slider() [2/2]

Slider::Slider ( Qt::Orientation  orientation,
QWidget *  parent = nullptr 
)
explicit

Construct with a specific orientation.

Parameters
orientationQt::Horizontal or Qt::Vertical
parentOptional QWidget parent

Member Function Documentation

◆ isReadOnly()

bool Slider::isReadOnly ( ) const
inline

Return whether the slider is read-only.

Returns
true if user interaction is suppressed

Definition at line 34 of file slider.h.

◆ setReadOnly()

void Slider::setReadOnly ( bool  value)
inline

Enable or disable the read-only mode.

Parameters
valuetrue to prevent user changes

Definition at line 40 of file slider.h.


The documentation for this class was generated from the following file: