diff options
Diffstat (limited to 'examples/widgets')
30 files changed, 401 insertions, 8 deletions
diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro index 62a1806..9865a11 100644 --- a/examples/widgets/analogclock/analogclock.pro +++ b/examples/widgets/analogclock/analogclock.pro @@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS analogclock.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000A64F
\ No newline at end of file diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro index a9a50d6..178f43e 100644 --- a/examples/widgets/calculator/calculator.pro +++ b/examples/widgets/calculator/calculator.pro @@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calculator.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C602
\ No newline at end of file diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro index 9326989..63c154b 100644 --- a/examples/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/calendarwidget/calendarwidget.pro @@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendarwidget.pro resources sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C603
\ No newline at end of file diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro index fe0733d..9763287 100644 --- a/examples/widgets/charactermap/charactermap.pro +++ b/examples/widgets/charactermap/charactermap.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS charactermap.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro index b87b4a0..b7c8e09 100644 --- a/examples/widgets/digitalclock/digitalclock.pro +++ b/examples/widgets/digitalclock/digitalclock.pro @@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS digitalclock.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro index 7175f66..8d09f5f 100644 --- a/examples/widgets/groupbox/groupbox.pro +++ b/examples/widgets/groupbox/groupbox.pro @@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS groupbox.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index 3b432d9..ea9c848 100644 --- a/examples/widgets/icons/icons.pro +++ b/examples/widgets/icons/icons.pro @@ -14,6 +14,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS icons.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/icons INSTALLS += target sources +include($$QT_SOURCE_TREE/examples/examplebase.pri) + wince*: { imageFiles.sources = images/* wincewm*: { diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro index 31c9d47..597d95b 100644 --- a/examples/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/imageviewer/imageviewer.pro @@ -8,6 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS imageviewer.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/imageviewer INSTALLS += target sources +include($$QT_SOURCE_TREE/examples/examplebase.pri) + wince*: { DEPLOYMENT_PLUGIN += qjpeg qmng qgif } diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro index e963024..5347148 100644 --- a/examples/widgets/lineedits/lineedits.pro +++ b/examples/widgets/lineedits/lineedits.pro @@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lineedits.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C604
\ No newline at end of file diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index 6aa5780..fe011d2 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -8,6 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie INSTALLS += target sources +include($$QT_SOURCE_TREE/examples/examplebase.pri) + wince*: { addFiles.sources += *.mng addFiles.path = . diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro index 21f24cc..a9190f7 100644 --- a/examples/widgets/scribble/scribble.pro +++ b/examples/widgets/scribble/scribble.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS scribble.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro index 6ef5dd0..c4d48f6 100644 --- a/examples/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/shapedclock/shapedclock.pro @@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS shapedclock.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C605
\ No newline at end of file diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro index b845554..742fc27 100644 --- a/examples/widgets/sliders/sliders.pro +++ b/examples/widgets/sliders/sliders.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sliders.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp new file mode 100644 index 0000000..a544b28 --- /dev/null +++ b/examples/widgets/softkeys/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include "softkeys.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow mw; + mw.showMaximized(); + return app.exec(); +} diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp new file mode 100644 index 0000000..110f2e6 --- /dev/null +++ b/examples/widgets/softkeys/softkeys.cpp @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "softkeys.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) +{ + central = new QWidget(this); + central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu + setCentralWidget(central); + + // Create text editor and set softkeys to it + textEditor= new QTextEdit(tr("Navigate in UI to see context sensitive softkeys in action"), this); + QAction* menu = new QAction(tr("Menu"), this); + menu->setSoftKeyRole(QAction::MenuSoftKey); + QAction* clear = new QAction(tr("Clear"), this); + clear->setSoftKeyRole(QAction::CancelSoftKey); + + QList<QAction*> textEditorSoftKeys; + textEditorSoftKeys.append(menu); + textEditorSoftKeys.append(clear); + textEditor->setSoftKeys(textEditorSoftKeys); + + infoLabel = new QLabel(tr(""), this); + infoLabel->setContextMenuPolicy(Qt::NoContextMenu); + + toggleButton = new QPushButton(tr("Custom softkeys"), this); + toggleButton->setContextMenuPolicy(Qt::NoContextMenu); + toggleButton->setCheckable(true); + + pushButton = new QPushButton(tr("Open File Dialog"), this); + pushButton->setContextMenuPolicy(Qt::NoContextMenu); + + QComboBox* comboBox = new QComboBox(this); + comboBox->setContextMenuPolicy(Qt::NoContextMenu); + comboBox->insertItems(0, QStringList() + << QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8) + << QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8) + << QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8) + ); + + layout = new QVBoxLayout; + layout->addWidget(textEditor); + layout->addWidget(infoLabel); + layout->addWidget(toggleButton); + layout->addWidget(pushButton); + layout->addWidget(comboBox); + central->setLayout(layout); + + fileMenu = menuBar()->addMenu(tr("&File")); + exit = new QAction(tr("&Exit"), this); + fileMenu->addAction(exit); + + connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor())); + connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog())); + connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication())); + connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys())); + pushButton->setFocus(); +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::clearTextEditor() +{ + textEditor->setText(tr("")); +} + +void MainWindow::openDialog() +{ + QFileDialog::getOpenFileName(this); +} + +void MainWindow::addSoftKeys() +{ + ok = new QAction(tr("Ok"), this); + ok->setSoftKeyRole(QAction::OkSoftKey); + connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); + + cancel = new QAction(tr("Cancel"), this); + cancel->setSoftKeyRole(QAction::CancelSoftKey); + connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); + + QList<QAction*> softkeys; + softkeys.append(ok); + softkeys.append(cancel); + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) + focusWidget->setSoftKeys(softkeys); +} + +void MainWindow::setCustomSoftKeys() +{ + if (toggleButton->isChecked()) { + infoLabel->setText(tr("Custom softkeys set")); + addSoftKeys(); + } + else { + infoLabel->setText(tr("Custom softkeys removed")); + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) + focusWidget->setSoftKey(0); + } +} + +void MainWindow::exitApplication() +{ + qApp->exit(); +} + +void MainWindow::okPressed() +{ + infoLabel->setText(tr("OK pressed")); +} + +void MainWindow::cancelPressed() +{ + infoLabel->setText(tr("Cancel pressed")); +} + + diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h new file mode 100644 index 0000000..da56eae --- /dev/null +++ b/examples/widgets/softkeys/softkeys.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SOFTKEYS_H +#define SOFTKEYS_H + +#include <QtGui> + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + +private slots: + void clearTextEditor(); + void openDialog(); + void addSoftKeys(); + void exitApplication(); + void okPressed(); + void cancelPressed(); + void setCustomSoftKeys(); +public: + MainWindow(QWidget *parent = 0); + ~MainWindow(); +private: + QVBoxLayout *layout; + QWidget *central; + QTextEdit* textEditor; + QLabel *infoLabel; + QPushButton* toggleButton; + QPushButton* pushButton; + QMenu* fileMenu; + QAction* addSoftKeysAct; + QAction* exit; + QAction* ok; + QAction* cancel; +}; + +//! [0] +class SoftKey : public QWidget +{ + Q_OBJECT +public: + SoftKey(QWidget *parent = 0); +}; +//! [0] + +#endif diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro new file mode 100644 index 0000000..9a0feea --- /dev/null +++ b/examples/widgets/softkeys/softkeys.pro @@ -0,0 +1,14 @@ +HEADERS = softkeys.h +SOURCES += \ + main.cpp \ + softkeys.cpp + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS softkeys.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys +INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF6B diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro index 4edb79a..b859ab7 100644 --- a/examples/widgets/spinboxes/spinboxes.pro +++ b/examples/widgets/spinboxes/spinboxes.pro @@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS spinboxes.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro index 4c6c682..8918d21 100644 --- a/examples/widgets/styles/styles.pro +++ b/examples/widgets/styles/styles.pro @@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS styles.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro index 9a64c00..71dfc6d 100644 --- a/examples/widgets/stylesheet/stylesheet.pro +++ b/examples/widgets/stylesheet/stylesheet.pro @@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images layouts qss sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro index 27d8d2c..ee25888 100644 --- a/examples/widgets/tablet/tablet.pro +++ b/examples/widgets/tablet/tablet.pro @@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tablet.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro index 59392fa..2223b86 100644 --- a/examples/widgets/tetrix/tetrix.pro +++ b/examples/widgets/tetrix/tetrix.pro @@ -11,3 +11,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tetrix.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C606
\ No newline at end of file diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro index 9f0bf41..0eca4c8 100644 --- a/examples/widgets/tooltips/tooltips.pro +++ b/examples/widgets/tooltips/tooltips.pro @@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tooltips.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro index 8e7884d..d7f9dde 100644 --- a/examples/widgets/validators/validators.pro +++ b/examples/widgets/validators/validators.pro @@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index 0af83c7..399a3ac 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -22,6 +22,16 @@ SUBDIRS = analogclock \ wiggly \ windowflags +symbian: SUBDIRS = \ + analogclock \ + calculator \ + calendarwidget \ + lineedits \ + shapedclock \ + tetrix \ + wiggly \ + softkeys + contains(styles, motif): SUBDIRS += styles # install @@ -29,3 +39,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS widgets.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/widgets INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) 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 diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro index fa8a567..007c10a 100644 --- a/examples/widgets/windowflags/windowflags.pro +++ b/examples/widgets/windowflags/windowflags.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowflags.pro sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) |