Qt Reference Documentation

QMaemo5ValueButton Class Reference

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.

Public Types

enum ValueLayout { ValueBesideText, ValueUnderText, ValueUnderTextCentered }

Properties

Public Functions

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

Reimplemented Public Functions

virtual QSize sizeHint () const

Public Slots

virtual void setValueText ( const QString & text )

Reimplemented Protected Functions

virtual void paintEvent ( QPaintEvent * pe )

Additional Inherited Members

Detailed Description

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.

Member Type Documentation

enum QMaemo5ValueButton::ValueLayout

This enum describes the positions in which the value label can appear inside the button.

ConstantValueDescription
QMaemo5ValueButton::ValueBesideText0The value is displayed to the left or to the right of the button text (depending on the text direction).
QMaemo5ValueButton::ValueUnderText1The value is displayed underneath the button text in a small font.
QMaemo5ValueButton::ValueUnderTextCentered2The value and the button text are centered. The Value is displayed underneath the button text.

See also valueLayout() and setValueLayout().

Property Documentation

valueLayout : ValueLayout

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().

valueText : QString

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().

Member Function Documentation

QMaemo5ValueButton::QMaemo5ValueButton ( QWidget * parent = 0 )

Constructs a value button with no text and the given parent.

QMaemo5ValueButton::QMaemo5ValueButton ( const QString & text, QWidget * parent = 0 )

Constructs a value button with the given parent containing the text specified.

QMaemo5ValueButton::QMaemo5ValueButton ( const QIcon & icon, const QString & text, QWidget * parent = 0 )

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++).

QMaemo5ValueButton::~QMaemo5ValueButton ()

Destroys the value button.

void QMaemo5ValueButton::paintEvent ( QPaintEvent * pe ) [virtual protected]

Reimplemented from QWidget::paintEvent().

QMaemo5AbstractPickSelector * QMaemo5ValueButton::pickSelector () const

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().

void QMaemo5ValueButton::setPickSelector ( QMaemo5AbstractPickSelector * picker )

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().

QSize QMaemo5ValueButton::sizeHint () const [virtual]

Reimplemented from QWidget::sizeHint().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();