The QMaemo5ValueButton widget provides a Maemo 5 specific button with two labels. More...
#include <QMaemo5ValueButton>
Inherits QPushButton.
This class was introduced in Qt 4.6.
enum | ValueLayout { ValueBesideText, ValueUnderText, ValueUnderTextCentered } |
QMaemo5ValueButton ( QWidget * parent = 0 ) | |
QMaemo5ValueButton ( const QString & text, QWidget * parent = 0 ) | |
QMaemo5ValueButton ( const QIcon & icon, const QString & text, QWidget * parent = 0 ) | |
~QMaemo5ValueButton () | |
QMaemo5AbstractPickSelector * | pickSelector () const |
void | setPickSelector ( QMaemo5AbstractPickSelector * picker ) |
void | setValueLayout ( ValueLayout layout ) |
ValueLayout | valueLayout () const |
QString | valueText () const |
virtual QSize | sizeHint () const |
virtual void | setValueText ( const QString & text ) |
virtual void | paintEvent ( QPaintEvent * pe ) |
The QMaemo5ValueButton widget provides a Maemo 5 specific button with two labels.
The Maemo 5 value button class is a Maemo 5 specific class that is mainly used to implement so called "picker buttons" on this platform.
It has all the properties of a normal QPushButton, but comes with an additional label that can be set with setValueText(). This value label can be either positioned to the right or below the normal text() using setValueLayout().
If the button is to be used as a picker button then the setPickSelector() interface should be used.
Depending on the current Maemo theme, a QMaemo5ValueButton that has a pickSelector() set on it, may render a differently to one without a selector.
Please see the Maemo 5 Widget, UI-Style and Master-Layout guides for hints on when, where and how to best use this button.
See also QPushButton and QMaemo5AbstractPickSelector.
This enum describes the positions in which the value label can appear inside the button.
Constant | Value | Description |
---|---|---|
QMaemo5ValueButton::ValueBesideText | 0 | The value is displayed to the left or to the right of the button text (depending on the text direction). |
QMaemo5ValueButton::ValueUnderText | 1 | The value is displayed underneath the button text in a small font. |
QMaemo5ValueButton::ValueUnderTextCentered | 2 | The value and the button text are centered. The Value is displayed underneath the button text. |
See also valueLayout() and setValueLayout().
This property holds the layout of the value text relative to the normal text.
The default is QMaemo5ValueButton::ValueUnderText.
Please see the Maemo 5 Widget, UI-Style and Master-Layout guides for more information.
Access functions:
ValueLayout | valueLayout () const |
void | setValueLayout ( ValueLayout layout ) |
See also valueText and setPickSelector().
This property holds the value text shown on the button.
If the button has no value text, the valueText() function will return an empty string.
By default, no text is set.
Access functions:
QString | valueText () const |
virtual void | setValueText ( const QString & text ) |
See also valueLayout and setPickSelector().
Constructs a value button with no text and the given parent.
Constructs a value button with the given parent containing the text specified.
Constructs a value button with an icon and text, and the given parent.
Note that you can also pass a QPixmap object as an icon (thanks to the implicit type conversion provided by C++).
Destroys the value button.
Reimplemented from QWidget::paintEvent().
Returns the pick selector set on this button.
If there is no pick selector set, this function will return 0.
By default, no picker is set.
See also valueLayout and setPickSelector().
Sets the pick selector for this button to the picker specified.
If the widget already has a pick selector, it is deleted. QMaemo5ValueButton takes ownership of picker.
Call this function with picker equal to 0 to unset (and delete) any previously set picker.
See also pickSelector().
Reimplemented from QWidget::sizeHint().