The QtScrollWheel class provides a scroll wheel to set values. More...
#include <qtscrollwheel.h>
Public Member Functions | |
QtScrollWheel (QWidget *parent=NULL) | |
~QtScrollWheel () | |
void | setSkin (const QString &skin) |
QString | skin () const |
Protected Member Functions | |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
virtual void | paintEvent (QPaintEvent *event) |
virtual QSize | sizeHint () const |
void | init () |
void | changeValue (int delta) |
Properties | |
QString | skin |
The QtScrollWheel class provides a scroll wheel to set values.
The description of the QtScrollWheel.
The QtScrollWheel is an example to show the capabilities of the Qt Framework related to customized controls.
Here is a possible implementation shown
// Create a QtScrollWheel QWidget * widget = new QWidget(this) QtScrollWheel * wheel = new QtScrollWheel(widget); wheel->setSkin("Beryl"); widget->addWidget(wheel); widget->show();
It is important to call the function setSkin() to load a skin. If setSkin() is not called the QtScrollWheel 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 realised 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 actual skin can be read over the skin() function.
No Signals defined.
No Slots defined.
QtScrollWheel::QtScrollWheel | ( | QWidget * | parent = NULL |
) |
Constructor of the QAbstractSlider with parent
as Parent.
QtScrollWheel::~QtScrollWheel | ( | ) |
Destructor
void QtScrollWheel::mouseMoveEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void QtScrollWheel::mousePressEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void QtScrollWheel::setSkin | ( | const QString & | skin | ) |
With this function you can set the skin that will be displayed in the widget.
QtScrollWheel * scroll = new QtScrollWheel(this); scroll->setSkin("Beryl");
This function has to be called before using the QtScrollWheel.
Referenced by ScrollDialPopup::setSkin().
void QtScrollWheel::wheelEvent | ( | QWheelEvent * | event | ) | [protected, virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QString QtScrollWheel::skin [read, write] |
This function returns the actual skin name. If no skin has been set the return value is "".
QtScrollWheel * scroll = new QtScrollWheel(this); scroll->setSkin("Beryl"); qDebug() << scroll->skin();