diff options
Diffstat (limited to 'examples/widgets')
35 files changed, 454 insertions, 36 deletions
diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro index 62a1806..50c0a06 100644 --- a/examples/widgets/analogclock/analogclock.pro +++ b/examples/widgets/analogclock/analogclock.pro @@ -7,3 +7,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000A64F +} diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro index a9a50d6..585ff43 100644 --- a/examples/widgets/calculator/calculator.pro +++ b/examples/widgets/calculator/calculator.pro @@ -9,3 +9,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C602 +} diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro index 9326989..f6cf21f 100644 --- a/examples/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/calendarwidget/calendarwidget.pro @@ -7,3 +7,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C603 +} diff --git a/examples/widgets/calendarwidget/window.cpp b/examples/widgets/calendarwidget/window.cpp index 2c719eb..6ba0e4f 100644 --- a/examples/widgets/calendarwidget/window.cpp +++ b/examples/widgets/calendarwidget/window.cpp @@ -167,22 +167,22 @@ void Window::reformatHeaders() //! [8] void Window::reformatCalendarPage() { - QTextCharFormat mayFirstFormat; - if (mayFirstCheckBox->isChecked()) - mayFirstFormat.setForeground(Qt::red); - - QTextCharFormat firstFridayFormat; - if (firstFridayCheckBox->isChecked()) + if (firstFridayCheckBox->isChecked()) { + QDate firstFriday(calendar->yearShown(), calendar->monthShown(), 1); + while (firstFriday.dayOfWeek() != Qt::Friday) + firstFriday = firstFriday.addDays(1); + QTextCharFormat firstFridayFormat; firstFridayFormat.setForeground(Qt::blue); + calendar->setDateTextFormat(firstFriday, firstFridayFormat); + } - QDate date(calendar->yearShown(), calendar->monthShown(), 1); - - calendar->setDateTextFormat(QDate(date.year(), 5, 1), mayFirstFormat); - - date.setDate(date.year(), date.month(), 1); - while (date.dayOfWeek() != Qt::Friday) - date = date.addDays(1); - calendar->setDateTextFormat(date, firstFridayFormat); + //May First in Red takes precedence + if (mayFirstCheckBox->isChecked()) { + const QDate mayFirst(calendar->yearShown(), 5, 1); + QTextCharFormat mayFirstFormat; + mayFirstFormat.setForeground(Qt::red); + calendar->setDateTextFormat(mayFirst, mayFirstFormat); + } } //! [8] diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro index fe0733d..eea2cb4 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro index b87b4a0..78e9eae 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro index 7175f66..2757ce1 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index 3b432d9..39c7ab2 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 +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + wince*: { imageFiles.sources = images/* wincewm*: { diff --git a/examples/widgets/icons/mainwindow.cpp b/examples/widgets/icons/mainwindow.cpp index 982ae47..20fa275 100644 --- a/examples/widgets/icons/mainwindow.cpp +++ b/examples/widgets/icons/mainwindow.cpp @@ -369,7 +369,7 @@ void MainWindow::createActions() this, SLOT(removeAllImages())); exitAct = new QAction(tr("&Quit"), this); - exitAct->setShortcut(tr("Ctrl+Q")); + exitAct->setShortcuts(QKeySequence::Quit); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); styleActionGroup = new QActionGroup(this); diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro index 31c9d47..c865618 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 +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + wince*: { DEPLOYMENT_PLUGIN += qjpeg qmng qgif } diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro index e963024..409215c 100644 --- a/examples/widgets/lineedits/lineedits.pro +++ b/examples/widgets/lineedits/lineedits.pro @@ -7,3 +7,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C604 +} diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index 6aa5780..517fec7 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 +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + wince*: { addFiles.sources += *.mng addFiles.path = . diff --git a/examples/widgets/scribble/mainwindow.cpp b/examples/widgets/scribble/mainwindow.cpp index 05b2c17..99c4d45 100644 --- a/examples/widgets/scribble/mainwindow.cpp +++ b/examples/widgets/scribble/mainwindow.cpp @@ -141,7 +141,7 @@ void MainWindow::createActions() //! [13] //! [14] { openAct = new QAction(tr("&Open..."), this); - openAct->setShortcut(tr("Ctrl+O")); + openAct->setShortcuts(QKeySequence::Open); connect(openAct, SIGNAL(triggered()), this, SLOT(open())); foreach (QByteArray format, QImageWriter::supportedImageFormats()) { @@ -157,7 +157,7 @@ void MainWindow::createActions() connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print())); exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcut(tr("Ctrl+Q")); + exitAct->setShortcuts(QKeySequence::Quit); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); penColorAct = new QAction(tr("&Pen Color..."), this); diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro index 21f24cc..cf92a25 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro index 6ef5dd0..bf4ee70 100644 --- a/examples/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/shapedclock/shapedclock.pro @@ -7,3 +7,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C605 +} diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro index b845554..fd39a22 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp new file mode 100644 index 0000000..a0f6052 --- /dev/null +++ b/examples/widgets/softkeys/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (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 http://qt.nokia.com/contact. +** $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..98ffd69 --- /dev/null +++ b/examples/widgets/softkeys/softkeys.cpp @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (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 http://qt.nokia.com/contact. +** $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..e0ee89a --- /dev/null +++ b/examples/widgets/softkeys/softkeys.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (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 http://qt.nokia.com/contact. +** $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..6c3271e --- /dev/null +++ b/examples/widgets/softkeys/softkeys.pro @@ -0,0 +1,15 @@ +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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF6B +} diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro index 4edb79a..129ec81 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro index 4c6c682..1228803 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro index 9a64c00..c67eba3 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/tablet/mainwindow.cpp b/examples/widgets/tablet/mainwindow.cpp index 854720a..3471624 100644 --- a/examples/widgets/tablet/mainwindow.cpp +++ b/examples/widgets/tablet/mainwindow.cpp @@ -212,17 +212,17 @@ void MainWindow::createActions() this, SLOT(lineWidthActionTriggered(QAction *))); exitAction = new QAction(tr("E&xit"), this); - exitAction->setShortcut(tr("Ctrl+X")); + exitAction->setShortcuts(QKeySequence::Quit); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); loadAction = new QAction(tr("&Open..."), this); - loadAction->setShortcut(tr("Ctrl+O")); + loadAction->setShortcuts(QKeySequence::Open); connect(loadAction, SIGNAL(triggered()), this, SLOT(loadAct())); saveAction = new QAction(tr("&Save As..."), this); - saveAction->setShortcut(tr("Ctrl+S")); + saveAction->setShortcuts(QKeySequence::SaveAs); connect(saveAction, SIGNAL(triggered()), this, SLOT(saveAct())); diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro index 27d8d2c..e135203 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/tablet/tabletcanvas.cpp b/examples/widgets/tablet/tabletcanvas.cpp index 33a9e3b..abb667c 100644 --- a/examples/widgets/tablet/tabletcanvas.cpp +++ b/examples/widgets/tablet/tabletcanvas.cpp @@ -137,11 +137,6 @@ void TabletCanvas::paintImage(QPainter &painter, QTabletEvent *event) QPoint brushAdjust(10, 10); switch (myTabletDevice) { - case QTabletEvent::Stylus: - painter.setBrush(myBrush); - painter.setPen(myPen); - painter.drawLine(polyLine[1], event->pos()); - break; case QTabletEvent::Airbrush: myBrush.setColor(myColor); myBrush.setStyle(brushPattern(event->pressure())); @@ -156,10 +151,32 @@ void TabletCanvas::paintImage(QPainter &painter, QTabletEvent *event) case QTabletEvent::Puck: case QTabletEvent::FourDMouse: case QTabletEvent::RotationStylus: - qWarning("This input device is not supported by the example."); + { + const QString error(tr("This input device is not supported by the example.")); +#ifndef QT_NO_STATUSTIP + QStatusTipEvent status(error); + QApplication::sendEvent(this, &status); +#else + qWarning() << error; +#endif + } break; default: - qWarning("Unknown tablet device."); + { + const QString error(tr("Unknown tablet device - treating as stylus")); +#ifndef QT_NO_STATUSTIP + QStatusTipEvent status(error); + QApplication::sendEvent(this, &status); +#else + qWarning() << error; +#endif + } + // FALL-THROUGH + case QTabletEvent::Stylus: + painter.setBrush(myBrush); + painter.setPen(myPen); + painter.drawLine(polyLine[1], event->pos()); + break; } } //! [5] @@ -250,7 +267,7 @@ void TabletCanvas::updateBrush(QTabletEvent *event) } //! [11] -void TabletCanvas::resizeEvent(QResizeEvent *event) +void TabletCanvas::resizeEvent(QResizeEvent *) { initImage(); polyLine[0] = polyLine[1] = polyLine[2] = QPoint(); diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro index 59392fa..d683f61 100644 --- a/examples/widgets/tetrix/tetrix.pro +++ b/examples/widgets/tetrix/tetrix.pro @@ -11,3 +11,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C606 +} diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro index 9f0bf41..f91abea 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro index 8e7884d..c50b63b 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index 0af83c7..d838be0 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/widgets/wiggly/dialog.cpp b/examples/widgets/wiggly/dialog.cpp index 2f798a0..da8e1aa 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 7aa2bcf..8e902d5 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 9706505..5628aac 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..857122f 100644 --- a/examples/widgets/wiggly/wiggly.pro +++ b/examples/widgets/wiggly/wiggly.pro @@ -9,3 +9,8 @@ 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 + +symbian { + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C607 +} diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro index fa8a567..27ce025 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 + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) |