Doc - Add info about layouts to the example

Reviewed-by: Niels Weber
This commit is contained in:
Leena Miettinen
2010-07-07 10:34:06 +02:00
parent ce6460e229
commit 5d7f1bd0a5
2 changed files with 14 additions and 0 deletions

View File

@@ -5,11 +5,14 @@ int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
BatteryIndicator w; BatteryIndicator w;
//! [0]
#if defined(Q_WS_S60) #if defined(Q_WS_S60)
w.showMaximized(); w.showMaximized();
#else #else
w.show(); w.show();
#endif #endif
//! [0]
return a.exec(); return a.exec();
} }

View File

@@ -2790,6 +2790,17 @@
\o In the \gui Properties pane, change the \gui objectName to \o In the \gui Properties pane, change the \gui objectName to
\bold batteryLevelBar. \bold batteryLevelBar.
\o Right-click the \gui BatteryIndicator object and select
\gui {Lay Out > Lay Out Horizontally} to ensure that the battery
indicator widget size is adjusted correctly on Maemo devices.
To adjust widget size correctly on Qt Simulator, remove the condition
from the main.cpp file (displayed in the following code snippet) and just
leave the \c {w.showMaximized();} line:
\snippet examples/batteryindicator/main.cpp 0
\endlist \endlist
\section1 Completing the Header File \section1 Completing the Header File