The Qt5WayButton provides a button group with SVG graphics. More...
Public Member Functions | |
Qt5WayButton (QWidget *parent=0) | |
virtual | ~Qt5WayButton () |
QAbstractButton * | upButton () |
QAbstractButton * | downButton () |
QAbstractButton * | leftButton () |
QAbstractButton * | rightButton () |
QAbstractButton * | centerButton () |
void | setSkin (const QString &skin) |
QString | skin () const |
Protected Member Functions | |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | paintEvent (QPaintEvent *event) |
virtual int | heightForWidth (int w) const |
Properties | |
QString | skin |
The Qt5WayButton provides a button group with SVG graphics.
Qt5WayButton is a widget that consists of five Buttons, one on any edge and one in the middle of the widget. Each button is represented as a QAbstractButton and can be accessed with the methods upButton(), downButton(), leftButton(), rightButton(), centerButton(). The returned buttons can then be used to connect signals and slots or to change properties like the checkable state.
The following example shows how to create a Qt5WayButton.
Qt5WayButton* button = new Qt5WayButton(parent); button->setSkin("Beryl"); QObject::connect(button->upButton(), SIGNAL(clicked()), this, SLOT(moveUp()));
After creating a new Qt5WayButton a skin needs to be set by calling setSkin(). Without a skin set, a Qt5WayButton will not have any visible content. skin() returns the current skin. Further details about skinning the Qt5WayButton can be found in the widget description.
Qt5WayButton::Qt5WayButton | ( | QWidget * | parent = 0 |
) | [explicit] |
Constructor of the widget with parent as Parent.
Qt5WayButton::~Qt5WayButton | ( | ) | [virtual] |
Destructor
QAbstractButton * Qt5WayButton::centerButton | ( | ) |
This function returns the actual pointer from the centerButton. Here you can connect to the Signals/Slots from QAbstractButton
Qt5WayButton * button = new Qt5WayButton(this); QObject::connect(button->upButton(), (pressed()), button->centerButton(), (clicked()));
QAbstractButton * Qt5WayButton::downButton | ( | ) |
This function returns the actual pointer from the downButton. Here you can connect to the Signals/Slots from QAbstractButton
Qt5WayButton * button = new Qt5WayButton(this); QObject::connect(button->upButton(), (pressed()), button->downButton(), (clicked()));
int Qt5WayButton::heightForWidth | ( | int | w | ) | const [protected, virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. To be sure that the width and the height are always the same size.
QAbstractButton * Qt5WayButton::leftButton | ( | ) |
This function returns the actual pointer from the leftButton. Here you can connect to the Signals/Slots from QAbstractButton
Qt5WayButton * button = new Qt5WayButton(this); QObject::connect(button->leftButton(), (pressed()), button->rightButton(), (clicked()));
void Qt5WayButton::paintEvent | ( | QPaintEvent * | 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. The paintEvent() draws the Qt5WayButton and shows the actual state "normal", "hovered", "clicked" from the button.
void Qt5WayButton::resizeEvent | ( | QResizeEvent * | 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.
QAbstractButton * Qt5WayButton::rightButton | ( | ) |
This function returns the actual pointer from the rightButton. Here you can connect to the Signals/Slots from QAbstractButton
Qt5WayButton * button = new Qt5WayButton(this); QObject::connect(button->leftButton(), (pressed()), button->rightButton(), (clicked()));
void Qt5WayButton::setSkin | ( | const QString & | skin | ) |
With this function you can set the skin that will be displayed in the widget.
Qt5WayButton * button = new Qt5WayButton(this); button->setSkin("Beryl");
This function has to be called before using the Qt5WayButton.
QAbstractButton * Qt5WayButton::upButton | ( | ) |
This function returns the actual pointer from the upButton. Here you can connect to the Signals/Slots from QAbstractButton
Qt5WayButton * button = new Qt5WayButton(this); QObject::connect(button->upButton(), (pressed()), button->downButton(), (clicked()));
QString Qt5WayButton::skin [read, write] |
This function returns the actual skin name. If no skin has been set the return value is "".
Qt5WayButton * button = new Qt5WayButton(this); button->setSkin("Beryl"); qDebug() << button->skin();