Qt Reference Documentation

QMaemo5InformationBox Class Reference

The QMaemo5InformationBox class provides Hildon Banners and Notes for informing the user. More...

 #include <QMaemo5InformationBox>

Inherits QDialog.

This class was introduced in Qt 4.6.

Properties

  • 2 properties inherited from QDialog
  • 58 properties inherited from QWidget
  • 1 property inherited from QObject

Public Functions

QMaemo5InformationBox ( QWidget * parent = 0 )
~QMaemo5InformationBox ()
void setTimeout ( int ms )
void setWidget ( QWidget * widget )
int timeout () const
QWidget * widget () const
  • 8 public functions inherited from QDialog
  • 217 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 13 public functions inherited from QPaintDevice

Signals

void clicked ()

Static Public Members

void information ( QWidget * parent, const QString & message, int timeout = DefaultTimeout )
  • 4 static public members inherited from QWidget
  • 5 static public members inherited from QObject

Reimplemented Protected Functions

virtual void mousePressEvent ( QMouseEvent * me )
virtual void paintEvent ( QPaintEvent * pe )
virtual void showEvent ( QShowEvent * se )
virtual void timerEvent ( QTimerEvent * te )
  • 7 protected functions inherited from QDialog
  • 37 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice

Additional Inherited Members

  • 5 public slots inherited from QDialog
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 7 protected functions inherited from QDialog
  • 37 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

The QMaemo5InformationBox class provides Hildon Banners and Notes for informing the user.

The Maemo 5 information box class is a Maemo 5 specific class that is used to display an arbitrary widget with or without a timeout to alert the user to a situation.

Information boxes that have a timeout will show as Hildon Banners, which will be hidden after the specified time. In the case where NoTimeout is specified for the timeout value, the information box will show up as a Hildon Note, which has to be acknowledged by the user with a tap anywhere on the screen.

Two APIs for using QMaemo5InformationBox are provided: a property-based API and a static function. Calling the static function is the simpler approach, but it is less flexible than using the property-based API, since the widget is hardcoded to a QLabel.

Using the static function API is recommended only if textual information is to be displayed.

The Property-based API

To use the property-based API, construct an instance of QMaemo5InformationBox, create the information widget, set the desired timeout, and call exec() (or show() for simple Banners) to show the message.

The clicked() signal will be emitted if the user clicks on the QMaemo5InformationBox, regardless of whether the information is shown with or without a timeout.

Note that, using the static function for some plain text strings containing XML meta-characters, the auto-text rich text detection test may fail causing your plain text string to be interpreted incorrectly as rich text. In these rare cases, use Qt::convertFromPlainText() to convert your plain text string to a visually equivalent rich text string, or use the property-based API and set your custom QLabel with setWidget().

The DefaultTimeout (3 seconds) is the timeout recommended by the Hildon style guide. The maximum timeout is 10 seconds.

Please see the Maemo 5 Widget, UI-Style and Master-Layout guides for hints on when, where and how to best use this information box.

Property Documentation

timeout : int

This property holds the timeout after which the informaton box should automatically be hidden.

Setting this value while the box is already visible will reset its timer.

The timeout value can be specified as an arbitrary millisecond value, although it is recommended to use the predefined values NoTimeout (for Hildon Notes) and DefaultTimeout (for style guide compliant Banners).

The default value of this property is DefaultTimeout (3 seconds). The maximum timeout is 10 seconds.

Access functions:

int timeout () const
void setTimeout ( int ms )

Member Function Documentation

QMaemo5InformationBox::QMaemo5InformationBox ( QWidget * parent = 0 )

Constructs an information box with no text, a default timeout (DefaultTimeout) and the given parent widget.

QMaemo5InformationBox::~QMaemo5InformationBox ()

Destroys the information box.

void QMaemo5InformationBox::clicked () [signal]

This signal is emitted whenever the QMaemo5InformationBox is clicked.

void QMaemo5InformationBox::information ( QWidget * parent, const QString & message, int timeout = DefaultTimeout ) [static]

Opens an information message box with the specified message and timeout.

If the timeout parameter equals NoTimeout, the information box will show as a Hildon Note and this function will block until the user clicks anywhere on the screen. Otherwise, the information box show as a Hildon Banner, which will be hidden after timeout milliseconds. The function will return to the caller immediately in this case.

If there is no timeout specified and parent is 0, the information box is an application modal dialog box. If parent is a widget, the information box is window modal relative to the parent.

void QMaemo5InformationBox::mousePressEvent ( QMouseEvent * me ) [virtual protected]

Reimplemented from QWidget::mousePressEvent().

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

Reimplemented from QWidget::paintEvent().

void QMaemo5InformationBox::setWidget ( QWidget * widget )

Sets the central widget of the information box to widget.

QMaemo5InformationBox will take ownership of widget by reparenting it. Any previously set widget() will be destroyed.

See also widget().

void QMaemo5InformationBox::showEvent ( QShowEvent * se ) [virtual protected]

Reimplemented from QWidget::showEvent().

void QMaemo5InformationBox::timerEvent ( QTimerEvent * te ) [virtual protected]

Reimplemented from QObject::timerEvent().

QWidget * QMaemo5InformationBox::widget () const

Returns the central widget of the information box.

See also setWidget().

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); })();