KSelector Class
Base class for other widgets which provides the ability to choose from a one-dimensional range of values. More...
| Header: | #include <KSelector> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons) |
| Inherits: | QAbstractSlider |
| Inherited By: |
Properties
|
Public Functions
| KSelector(QWidget *parent = nullptr) | |
| KSelector(Qt::Orientation o, QWidget *parent = nullptr) | |
| Qt::ArrowType | arrowDirection() const |
| QRect | contentsRect() const |
| bool | indent() const |
| void | setArrowDirection(Qt::ArrowType direction) |
| void | setIndent(bool i) |
Protected Functions
| virtual void | drawArrow(QPainter *painter, const QPoint &pos) |
| virtual void | drawContents(QPainter *) |
Detailed Description
An example is the KGradientSelector which allows to choose from a range of colors.
A custom drawing routine for the widget surface has to be provided by the subclass.
Property Documentation
arrowDirection : Qt::ArrowType
Access functions:
| Qt::ArrowType | arrowDirection() const |
| void | setArrowDirection(Qt::ArrowType direction) |
indent : bool
Access functions:
maxValue : const int
minValue : const int
value : const int
Member Function Documentation
[explicit] KSelector::KSelector(QWidget *parent = nullptr)
Constructs a horizontal one-dimensional selection widget.
[explicit] KSelector::KSelector(Qt::Orientation o, QWidget *parent = nullptr)
Constructs a one-dimensional selection widget with a given orientation.
Qt::ArrowType KSelector::arrowDirection() const
Returns the current arrow direction
Note: Getter function for property arrowDirection.
See also setArrowDirection().
QRect KSelector::contentsRect() const
Returns the rectangle on which subclasses should draw.
[virtual protected] void KSelector::drawArrow(QPainter *painter, const QPoint &pos)
Override this function to draw the cursor which indicates the current value.
[virtual protected] void KSelector::drawContents(QPainter *)
Override this function to draw the contents of the control. The default implementation does nothing.
Draw only within contentsRect().
bool KSelector::indent() const
Returns whether the indent option is set.
Note: Getter function for property indent.
See also setIndent().
void KSelector::setArrowDirection(Qt::ArrowType direction)
Sets the arrow direction.
Note: Setter function for property arrowDirection.
See also arrowDirection().
void KSelector::setIndent(bool i)
Sets the indent option of the widget to i.
This determines whether a shaded frame is drawn.
Note: Setter function for property indent.
See also indent().