![]() |
Home · All Classes · All Functions · Overviews |
Files:
This example shows how to use Maemo 5 "Banners" and "Notes". Please refer to the Maemo 5 style guide for more information about these two concepts.
QMaemo5InformationBox::information(this, "This is a Maemo5 <b>banner</b>", QMaemo5InformationBox::DefaultTimeout);
The static function QMaemo5InformationBox::information() with a timeout of QMaemo5InformationBox::DefaultTimeout shows a Maemo 5 "Banner". The text can be rich text and is passed to QLabel::setText().
QMaemo5InformationBox::information(this, "This is a Maemo5 <b>note</b>", QMaemo5InformationBox::NoTimeout);
When calling QMaemo5InformationBox::information() with no timeout, a Maemo 5 "Note" is shown. It will stay on the screen until the user clicks it away.
QMaemo5InformationBox *box = new QMaemo5InformationBox(this); QTextBrowser *textBrowser = new QTextBrowser(box); textBrowser->setText("This is a Maemo5 <b>note</b> containing custom widget"); box->setWidget(textBrowser); box->setTimeout(QMaemo5InformationBox::NoTimeout); box->exec();
In addition to calling the static function that can only show text, it is possible to create a QMaemo5InformationBox instance and set any custom widget on it. In this example, a QTextBrowser is used.
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt 4.6.2 |