The QtMultiSlider class provides a double slider with SVG graphics. More...
#include <qtmultislider.h>
Public Slots | |
void | setMaximumRange (int maximum) |
void | setMinimumRange (int minimum) |
void | setValue (int) |
Signals | |
void | maximumExceeded (bool exceeded) |
void | minimumExceeded (bool exceeded) |
Public Member Functions | |
QtMultiSlider (QWidget *parent=0) | |
virtual | ~QtMultiSlider () |
QtMultiSliderHelper * | topSlider () |
QtMultiSliderHelper * | bottomSlider () |
void | setSkin (const QString &skin) |
QString | skin () const |
Properties | |
QString | skin |
The QtMultiSlider class provides a double slider with SVG graphics.
The description of the QtMultiSlider.
The QtMultiSlider is an example to show the capabilities of the Qt Framework related to customized controls.
Here is a possible implementation shown
// Create a QtSvgDialGauge QWidget * widget = new QWidget(this); QtMultiSlider * slider = new QtMultiSlider("&Range", widget); slider->setRange(0, 100); slider->setMaximumRange(70); slider->setValue(80); slider->setSkin("Beryl"); widget->addWidget(slider); widget->show();
It is important to call the function setSkin() to load a skin. If setSkin() is not called the QtMultiSlider will not have any visible content. The parameter skin
has the skin name. The skins are in the resource file defined in the project file. The name scheme in the resource file is "Skin Name"/"unique picture name.svg".
The setSkin() function loads the diffrent skins over the "Skin name". The needed graphics for this control are "normal.svg", "hovered.svg" and "pressed.svg". If you want to add new skins, they have to follow the name scheme to work.
The current skin can be read over the skin() function.
Signals:
QtMultiSlider::~QtMultiSlider | ( | ) | [virtual] |
Destructor
QtMultiSliderHelper * QtMultiSlider::bottomSlider | ( | ) |
Returns the bottom slider
Referenced by setMinimumRange(), and setValue().
void QtMultiSlider::setMaximumRange | ( | int | maximum | ) | [slot] |
Set the maximum range of the topSlider.
References topSlider().
void QtMultiSlider::setMinimumRange | ( | int | minimum | ) | [slot] |
Set the minimum range of the bottomSlider.
References bottomSlider().
void QtMultiSlider::setSkin | ( | const QString & | skin | ) |
With this function you can set the skin that will be displayed in the widget.
QtMultiSlider * slider = new QtMultiSlider(this); button->setSkin("Beryl");
This function has to be called before using the QtMultiSlider.
void QtMultiSlider::setValue | ( | int | value | ) | [slot] |
Set the actual vlaue
References bottomSlider(), and topSlider().
QtMultiSliderHelper * QtMultiSlider::topSlider | ( | ) |
Returns the top slider
Referenced by setMaximumRange(), and setValue().
QString QtMultiSlider::skin [read, write] |
This function returns the actual skin name. If no skin has been set the return value is "".
QtMultiSlider * slider = new QtMultiSlider(this); slider->setSkin("Beryl"); qDebug() << slider->skin();