diff options
Diffstat (limited to 'examples/widgets/wiggly')
-rw-r--r-- | examples/widgets/wiggly/dialog.cpp | 11 | ||||
-rw-r--r-- | examples/widgets/wiggly/dialog.h | 2 | ||||
-rw-r--r-- | examples/widgets/wiggly/main.cpp | 14 | ||||
-rw-r--r-- | examples/widgets/wiggly/wiggly.pro | 4 |
4 files changed, 23 insertions, 8 deletions
diff --git a/examples/widgets/wiggly/dialog.cpp b/examples/widgets/wiggly/dialog.cpp index f4fa402..8af1789 100644 --- a/examples/widgets/wiggly/dialog.cpp +++ b/examples/widgets/wiggly/dialog.cpp @@ -45,7 +45,7 @@ #include "wigglywidget.h" //! [0] -Dialog::Dialog(QWidget *parent) +Dialog::Dialog(QWidget *parent, bool smallScreen) : QDialog(parent) { WigglyWidget *wigglyWidget = new WigglyWidget; @@ -58,9 +58,12 @@ Dialog::Dialog(QWidget *parent) connect(lineEdit, SIGNAL(textChanged(QString)), wigglyWidget, SLOT(setText(QString))); - - lineEdit->setText(tr("Hello world!")); - + if (!smallScreen){ + lineEdit->setText(tr("Hello world!")); + } + else{ + lineEdit->setText(tr("Hello!")); + } setWindowTitle(tr("Wiggly")); resize(360, 145); } diff --git a/examples/widgets/wiggly/dialog.h b/examples/widgets/wiggly/dialog.h index 4286741..8f54a02 100644 --- a/examples/widgets/wiggly/dialog.h +++ b/examples/widgets/wiggly/dialog.h @@ -50,7 +50,7 @@ class Dialog : public QDialog Q_OBJECT public: - Dialog(QWidget *parent = 0); + Dialog(QWidget *parent = 0, bool smallScreen = false); }; //! [0] diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp index 2e19fed..eb55c69 100644 --- a/examples/widgets/wiggly/main.cpp +++ b/examples/widgets/wiggly/main.cpp @@ -46,8 +46,16 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - - Dialog dialog; - dialog.show(); + bool smallScreen = false; + for (int i=0; i<argc; i++) + if (QString(argv[i]) == "-small-screen") + smallScreen = true; + Dialog dialog(0,smallScreen); + if (!smallScreen){ + dialog.show(); + } + else{ + dialog.showFullScreen(); + } return app.exec(); } diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro index 5288dd3..4240765 100644 --- a/examples/widgets/wiggly/wiggly.pro +++ b/examples/widgets/wiggly/wiggly.pro @@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wiggly.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C607
\ No newline at end of file |