From f4492bf01baae353ff63da18a9a602fb3a8058e4 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 18 May 2010 17:43:20 +1000 Subject: Rename some examples: proxyviewer -> networkaccessmanagerfactory, proxywidgets -> qwidgets, dynamic -> dynamicscene, velocity -> corkboards --- doc/src/declarative/examples.qdoc | 8 +- doc/src/examples/qml-examples.qdoc | 24 +-- .../declarative/cppextensions/cppextensions.pro | 4 +- .../networkaccessmanagerfactory/main.cpp | 109 +++++++++++++ .../networkaccessmanagerfactory.pro | 9 ++ .../networkaccessmanagerfactory.qrc | 5 + .../networkaccessmanagerfactory/view.qml | 7 + .../declarative/cppextensions/proxyviewer/main.cpp | 109 ------------- .../cppextensions/proxyviewer/proxyviewer.pro | 9 -- .../cppextensions/proxyviewer/proxyviewer.qrc | 5 - .../declarative/cppextensions/proxyviewer/view.qml | 7 - .../cppextensions/proxywidgets/ProxyWidgets/qmldir | 1 - .../declarative/cppextensions/proxywidgets/README | 4 - .../cppextensions/proxywidgets/proxywidgets.cpp | 97 ------------ .../cppextensions/proxywidgets/proxywidgets.pro | 21 --- .../cppextensions/proxywidgets/proxywidgets.qml | 70 -------- .../proxywidgets/proxywidgets.qmlproject | 16 -- .../cppextensions/qwidgets/QWidgets/qmldir | 1 + examples/declarative/cppextensions/qwidgets/README | 6 + .../cppextensions/qwidgets/qwidgets.cpp | 97 ++++++++++++ .../cppextensions/qwidgets/qwidgets.pro | 21 +++ .../cppextensions/qwidgets/qwidgets.qml | 70 ++++++++ .../cppextensions/qwidgets/qwidgets.qmlproject | 16 ++ examples/declarative/toys/corkboards/Day.qml | 101 ++++++++++++ examples/declarative/toys/corkboards/cork.jpg | Bin 0 -> 149337 bytes .../declarative/toys/corkboards/corkboards.qml | 75 +++++++++ .../toys/corkboards/corkboards.qmlproject | 16 ++ .../declarative/toys/corkboards/note-yellow.png | Bin 0 -> 54559 bytes examples/declarative/toys/corkboards/tack.png | Bin 0 -> 7282 bytes examples/declarative/toys/dynamic/dynamic.qml | 176 --------------------- .../declarative/toys/dynamic/dynamic.qmlproject | 16 -- examples/declarative/toys/dynamic/images/NOTE | 1 - .../declarative/toys/dynamic/images/face-smile.png | Bin 15408 -> 0 bytes examples/declarative/toys/dynamic/images/moon.png | Bin 1757 -> 0 bytes .../toys/dynamic/images/rabbit_brown.png | Bin 1245 -> 0 bytes .../declarative/toys/dynamic/images/rabbit_bw.png | Bin 1759 -> 0 bytes examples/declarative/toys/dynamic/images/star.png | Bin 349 -> 0 bytes examples/declarative/toys/dynamic/images/sun.png | Bin 8153 -> 0 bytes .../declarative/toys/dynamic/images/tree_s.png | Bin 3406 -> 0 bytes examples/declarative/toys/dynamic/qml/Button.qml | 40 ----- .../declarative/toys/dynamic/qml/PaletteItem.qml | 19 --- .../toys/dynamic/qml/PerspectiveItem.qml | 25 --- examples/declarative/toys/dynamic/qml/Sun.qml | 38 ----- .../declarative/toys/dynamic/qml/itemCreation.js | 65 -------- .../declarative/toys/dynamicscene/dynamicscene.qml | 176 +++++++++++++++++++++ .../toys/dynamicscene/dynamicscene.qmlproject | 16 ++ examples/declarative/toys/dynamicscene/images/NOTE | 1 + .../toys/dynamicscene/images/face-smile.png | Bin 0 -> 15408 bytes .../declarative/toys/dynamicscene/images/moon.png | Bin 0 -> 1757 bytes .../toys/dynamicscene/images/rabbit_brown.png | Bin 0 -> 1245 bytes .../toys/dynamicscene/images/rabbit_bw.png | Bin 0 -> 1759 bytes .../declarative/toys/dynamicscene/images/star.png | Bin 0 -> 349 bytes .../declarative/toys/dynamicscene/images/sun.png | Bin 0 -> 8153 bytes .../toys/dynamicscene/images/tree_s.png | Bin 0 -> 3406 bytes .../declarative/toys/dynamicscene/qml/Button.qml | 40 +++++ .../toys/dynamicscene/qml/PaletteItem.qml | 19 +++ .../toys/dynamicscene/qml/PerspectiveItem.qml | 25 +++ examples/declarative/toys/dynamicscene/qml/Sun.qml | 38 +++++ .../toys/dynamicscene/qml/itemCreation.js | 65 ++++++++ examples/declarative/toys/velocity/Day.qml | 101 ------------ examples/declarative/toys/velocity/cork.jpg | Bin 149337 -> 0 bytes examples/declarative/toys/velocity/note-yellow.png | Bin 54559 -> 0 bytes examples/declarative/toys/velocity/tack.png | Bin 7282 -> 0 bytes examples/declarative/toys/velocity/velocity.qml | 75 --------- .../declarative/toys/velocity/velocity.qmlproject | 16 -- 65 files changed, 931 insertions(+), 929 deletions(-) create mode 100644 examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp create mode 100644 examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro create mode 100644 examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc create mode 100644 examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml delete mode 100644 examples/declarative/cppextensions/proxyviewer/main.cpp delete mode 100644 examples/declarative/cppextensions/proxyviewer/proxyviewer.pro delete mode 100644 examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc delete mode 100644 examples/declarative/cppextensions/proxyviewer/view.qml delete mode 100644 examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir delete mode 100644 examples/declarative/cppextensions/proxywidgets/README delete mode 100644 examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp delete mode 100644 examples/declarative/cppextensions/proxywidgets/proxywidgets.pro delete mode 100644 examples/declarative/cppextensions/proxywidgets/proxywidgets.qml delete mode 100644 examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject create mode 100644 examples/declarative/cppextensions/qwidgets/QWidgets/qmldir create mode 100644 examples/declarative/cppextensions/qwidgets/README create mode 100644 examples/declarative/cppextensions/qwidgets/qwidgets.cpp create mode 100644 examples/declarative/cppextensions/qwidgets/qwidgets.pro create mode 100644 examples/declarative/cppextensions/qwidgets/qwidgets.qml create mode 100644 examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject create mode 100644 examples/declarative/toys/corkboards/Day.qml create mode 100644 examples/declarative/toys/corkboards/cork.jpg create mode 100644 examples/declarative/toys/corkboards/corkboards.qml create mode 100644 examples/declarative/toys/corkboards/corkboards.qmlproject create mode 100644 examples/declarative/toys/corkboards/note-yellow.png create mode 100644 examples/declarative/toys/corkboards/tack.png delete mode 100644 examples/declarative/toys/dynamic/dynamic.qml delete mode 100644 examples/declarative/toys/dynamic/dynamic.qmlproject delete mode 100644 examples/declarative/toys/dynamic/images/NOTE delete mode 100644 examples/declarative/toys/dynamic/images/face-smile.png delete mode 100644 examples/declarative/toys/dynamic/images/moon.png delete mode 100644 examples/declarative/toys/dynamic/images/rabbit_brown.png delete mode 100644 examples/declarative/toys/dynamic/images/rabbit_bw.png delete mode 100644 examples/declarative/toys/dynamic/images/star.png delete mode 100644 examples/declarative/toys/dynamic/images/sun.png delete mode 100644 examples/declarative/toys/dynamic/images/tree_s.png delete mode 100644 examples/declarative/toys/dynamic/qml/Button.qml delete mode 100644 examples/declarative/toys/dynamic/qml/PaletteItem.qml delete mode 100644 examples/declarative/toys/dynamic/qml/PerspectiveItem.qml delete mode 100644 examples/declarative/toys/dynamic/qml/Sun.qml delete mode 100644 examples/declarative/toys/dynamic/qml/itemCreation.js create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.qml create mode 100644 examples/declarative/toys/dynamicscene/dynamicscene.qmlproject create mode 100644 examples/declarative/toys/dynamicscene/images/NOTE create mode 100644 examples/declarative/toys/dynamicscene/images/face-smile.png create mode 100644 examples/declarative/toys/dynamicscene/images/moon.png create mode 100644 examples/declarative/toys/dynamicscene/images/rabbit_brown.png create mode 100644 examples/declarative/toys/dynamicscene/images/rabbit_bw.png create mode 100644 examples/declarative/toys/dynamicscene/images/star.png create mode 100644 examples/declarative/toys/dynamicscene/images/sun.png create mode 100644 examples/declarative/toys/dynamicscene/images/tree_s.png create mode 100644 examples/declarative/toys/dynamicscene/qml/Button.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/PaletteItem.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/Sun.qml create mode 100644 examples/declarative/toys/dynamicscene/qml/itemCreation.js delete mode 100644 examples/declarative/toys/velocity/Day.qml delete mode 100644 examples/declarative/toys/velocity/cork.jpg delete mode 100644 examples/declarative/toys/velocity/note-yellow.png delete mode 100644 examples/declarative/toys/velocity/tack.png delete mode 100644 examples/declarative/toys/velocity/velocity.qml delete mode 100644 examples/declarative/toys/velocity/velocity.qmlproject diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index a65614e..4ad57f2 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -139,20 +139,20 @@ For example, from your build directory, run: \list \o \l{declarative/cppextensions/referenceexamples}{Reference examples} (discussed in \l {Extending QML in C++}) \o \l{declarative/cppextensions/plugins}{Plugins} -\o \l{declarative/cppextensions/proxywidgets}{QtWidgets} \o \l{declarative/cppextensions/qgraphicslayouts}{QGraphicsLayouts} +\o \l{declarative/cppextensions/qwidgets}{QWidgets} \o \l{declarative/cppextensions/imageprovider}{Image provider} -\o \l{declarative/cppextensions/proxyviewer}{Network access manager factory} +\o \l{declarative/cppextensions/networkaccessmanagerfactory}{Network access manager factory} \endlist \section2 Toys \list \o \l{declarative/toys/clocks}{Clocks} +\o \l{declarative/toys/corkboards}{Corkboards} \o \l{declarative/toys/dial}{Dial} -\o \l{declarative/toys/dynamic}{Dynamic} +\o \l{declarative/toys/dynamicscene}{Dynamic Scene} \o \l{declarative/toys/tic-tac-toe}{Tic Tac Toe} \o \l{declarative/toys/tvtennis}{TV Tennis} -\o \l{declarative/toys/velocity}{Velocity} \endlist diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index cad713e..2973d8c 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -88,13 +88,13 @@ */ /*! - \title QtWidgets - \example declarative/cppextensions/proxywidgets + \title QGraphicsLayouts + \example declarative/cppextensions/qgraphicslayouts */ /*! - \title QGraphicsLayouts - \example declarative/cppextensions/qgraphicslayouts + \title QWidgets + \example declarative/cppextensions/qwidgets */ /*! @@ -104,7 +104,7 @@ /*! \title Network access manager - \example declarative/cppextensions/proxyviewer + \example declarative/cppextensions/networkaccessmanagerfactory */ /*! @@ -192,6 +192,11 @@ */ /*! + \title Corkboards + \example declarative/toys/corkboards +*/ + +/*! \title Dial \example declarative/toys/dial @@ -199,8 +204,8 @@ */ /*! - \title Dynamic - \example declarative/toys/dynamic + \title Dynamic Scene + \example declarative/toys/dynamicscene This example shows how to create dynamic objects QML. */ @@ -216,11 +221,6 @@ */ /*! - \title Velocity - \example declarative/toys/velocity -*/ - -/*! \title Gestures \example declarative/touchinteraction/gestures */ diff --git a/examples/declarative/cppextensions/cppextensions.pro b/examples/declarative/cppextensions/cppextensions.pro index caa6092..33762fe 100644 --- a/examples/declarative/cppextensions/cppextensions.pro +++ b/examples/declarative/cppextensions/cppextensions.pro @@ -3,8 +3,8 @@ TEMPLATE = subdirs SUBDIRS += \ imageprovider \ plugins \ - proxyviewer \ - proxywidgets \ + networkaccessmanagerfactory \ + qwidgets \ qgraphicslayouts \ referenceexamples diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp new file mode 100644 index 0000000..4ecbb5c --- /dev/null +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the demonstration applications 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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include +#include +#include + + +/* + This example illustrates using a QNetworkAccessManagerFactory to + create a QNetworkAccessManager with a proxy. + + Usage: + networkaccessmanagerfactory [-host -port ] [file] +*/ + +static QString proxyHost; +static int proxyPort = 0; + +class MyNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory +{ +public: + virtual QNetworkAccessManager *create(QObject *parent); +}; + +QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent) +{ + QNetworkAccessManager *nam = new QNetworkAccessManager(parent); + if (!proxyHost.isEmpty()) { + qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort)); + QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort); + nam->setProxy(proxy); + } + + return nam; +} + +int main(int argc, char ** argv) +{ + QUrl source("qrc:view.qml"); + + QApplication app(argc, argv); + + for (int i = 1; i < argc; ++i) { + QString arg(argv[i]); + if (arg == "-host" && i < argc-1) { + proxyHost = argv[++i]; + } else if (arg == "-port" && i < argc-1) { + arg = argv[++i]; + proxyPort = arg.toInt(); + } else if (arg[0] != '-') { + source = QUrl::fromLocalFile(arg); + } else { + qWarning() << "Usage: networkaccessmanagerfactory [-host -port ] [file]"; + exit(1); + } + } + + QDeclarativeView view; + view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory); + + view.setSource(source); + view.show(); + + return app.exec(); +} + diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro new file mode 100644 index 0000000..74d8db3 --- /dev/null +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro @@ -0,0 +1,9 @@ +TEMPLATE = app +TARGET = networkaccessmanagerfactory +DEPENDPATH += . +INCLUDEPATH += . +QT += declarative network + +# Input +SOURCES += main.cpp +RESOURCES += networkaccessmanagerfactory.qrc diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc new file mode 100644 index 0000000..17e9301 --- /dev/null +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc @@ -0,0 +1,5 @@ + + + view.qml + + diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml b/examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml new file mode 100644 index 0000000..7f1bdef --- /dev/null +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/view.qml @@ -0,0 +1,7 @@ +import Qt 4.7 + +Image { + width: 100 + height: 100 + source: "http://qt.nokia.com/logo.png" +} diff --git a/examples/declarative/cppextensions/proxyviewer/main.cpp b/examples/declarative/cppextensions/proxyviewer/main.cpp deleted file mode 100644 index b82d2c9..0000000 --- a/examples/declarative/cppextensions/proxyviewer/main.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the demonstration applications 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 Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include -#include -#include - - -/* - This example illustrates using a QNetworkAccessManagerFactory to - create a QNetworkAccessManager with a proxy. - - Usage: - proxyviewer [-host -port ] [file] -*/ - -static QString proxyHost; -static int proxyPort = 0; - -class MyNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory -{ -public: - virtual QNetworkAccessManager *create(QObject *parent); -}; - -QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent) -{ - QNetworkAccessManager *nam = new QNetworkAccessManager(parent); - if (!proxyHost.isEmpty()) { - qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort)); - QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort); - nam->setProxy(proxy); - } - - return nam; -} - -int main(int argc, char ** argv) -{ - QUrl source("qrc:view.qml"); - - QApplication app(argc, argv); - - for (int i = 1; i < argc; ++i) { - QString arg(argv[i]); - if (arg == "-host" && i < argc-1) { - proxyHost = argv[++i]; - } else if (arg == "-port" && i < argc-1) { - arg = argv[++i]; - proxyPort = arg.toInt(); - } else if (arg[0] != '-') { - source = QUrl::fromLocalFile(arg); - } else { - qWarning() << "Usage: proxyviewer [-host -port ] [file]"; - exit(1); - } - } - - QDeclarativeView view; - view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory); - - view.setSource(source); - view.show(); - - return app.exec(); -} - diff --git a/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro b/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro deleted file mode 100644 index b6bfa7f..0000000 --- a/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app -TARGET = proxyviewer -DEPENDPATH += . -INCLUDEPATH += . -QT += declarative network - -# Input -SOURCES += main.cpp -RESOURCES += proxyviewer.qrc diff --git a/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc b/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc deleted file mode 100644 index 17e9301..0000000 --- a/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - view.qml - - diff --git a/examples/declarative/cppextensions/proxyviewer/view.qml b/examples/declarative/cppextensions/proxyviewer/view.qml deleted file mode 100644 index 7f1bdef..0000000 --- a/examples/declarative/cppextensions/proxyviewer/view.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt 4.7 - -Image { - width: 100 - height: 100 - source: "http://qt.nokia.com/logo.png" -} diff --git a/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir b/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir deleted file mode 100644 index e55267c..0000000 --- a/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin proxywidgetsplugin diff --git a/examples/declarative/cppextensions/proxywidgets/README b/examples/declarative/cppextensions/proxywidgets/README deleted file mode 100644 index f50fa22..0000000 --- a/examples/declarative/cppextensions/proxywidgets/README +++ /dev/null @@ -1,4 +0,0 @@ -To run: - - make install - qml proxywidgets.qml diff --git a/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp b/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp deleted file mode 100644 index 067eb2c..0000000 --- a/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** 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 Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -class MyPushButton : public QGraphicsProxyWidget -{ - Q_OBJECT - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - -public: - MyPushButton(QGraphicsItem* parent = 0) - : QGraphicsProxyWidget(parent) - { - widget = new QPushButton("MyPushButton"); - widget->setAttribute(Qt::WA_NoSystemBackground); - setWidget(widget); - - QObject::connect(widget, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool))); - } - - QString text() const - { - return widget->text(); - } - - void setText(const QString& text) - { - if (text != widget->text()) { - widget->setText(text); - emit textChanged(); - } - } - -Q_SIGNALS: - void clicked(bool); - void textChanged(); - -private: - QPushButton *widget; -}; - -class ProxyWidgetsPlugin : public QDeclarativeExtensionPlugin -{ - Q_OBJECT -public: - void registerTypes(const char *uri) - { - qmlRegisterType(uri, 1, 0, "MyPushButton"); - } -}; - -#include "proxywidgets.moc" - -Q_EXPORT_PLUGIN2(proxywidgetsplugin, ProxyWidgetsPlugin); diff --git a/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro b/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro deleted file mode 100644 index cb07d80..0000000 --- a/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro +++ /dev/null @@ -1,21 +0,0 @@ -TEMPLATE = lib -DESTDIR = ProxyWidgets -TARGET = proxywidgetsplugin -CONFIG += qt plugin -QT += declarative - -SOURCES += proxywidgets.cpp - -sources.files += proxywidgets.pro proxywidgets.cpp proxywidgets.qml - -sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins - -target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins - -INSTALLS += sources target - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - -symbian:{ - TARGET.EPOCALLOWDLLDATA = 1 -} \ No newline at end of file diff --git a/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml deleted file mode 100644 index 88de37f..0000000 --- a/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml +++ /dev/null @@ -1,70 +0,0 @@ -import Qt 4.7 -import "ProxyWidgets" 1.0 - -Rectangle { - id: window - - property int margin: 30 - - width: 640; height: 480 - color: palette.window - - SystemPalette { id: palette } - - MyPushButton { - id: button1 - x: margin; y: margin - text: "Right" - transformOriginPoint: Qt.point(width / 2, height / 2) - - onClicked: window.state = "right" - } - - MyPushButton { - id: button2 - x: margin; y: margin + 30 - text: "Bottom" - transformOriginPoint: Qt.point(width / 2, height / 2) - - onClicked: window.state = "bottom" - } - - MyPushButton { - id: button3 - x: margin; y: margin + 60 - text: "Quit" - transformOriginPoint: Qt.point(width / 2, height / 2) - - onClicked: Qt.quit() - } - - states: [ - State { - name: "right" - PropertyChanges { target: button1; x: window.width - width - margin; text: "Left"; onClicked: window.state = "" } - PropertyChanges { target: button2; x: window.width - width - margin } - PropertyChanges { target: button3; x: window.width - width - margin } - PropertyChanges { target: window; color: Qt.darker(palette.window) } - }, - State { - name: "bottom" - PropertyChanges { target: button1; y: window.height - height - margin; rotation: 180 } - PropertyChanges { - target: button2 - x: button1.x + button1.width + 10; y: window.height - height - margin - rotation: 180 - text: "Top" - onClicked: window.state = "" - } - PropertyChanges { target: button3; x: button2.x + button2.width + 10; y: window.height - height - margin; rotation: 180 } - PropertyChanges { target: window; color: Qt.lighter(palette.window) } - } - ] - - transitions: Transition { - ParallelAnimation { - NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad } - ColorAnimation { target: window; duration: 600 } - } - } -} diff --git a/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir b/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir new file mode 100644 index 0000000..e55267c --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir @@ -0,0 +1 @@ +plugin proxywidgetsplugin diff --git a/examples/declarative/cppextensions/qwidgets/README b/examples/declarative/cppextensions/qwidgets/README new file mode 100644 index 0000000..e2f1b2b --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/README @@ -0,0 +1,6 @@ +This example shows how to embed QWidget-based objects into QML. + +To run: + + make install + qml qwidgets.qml diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.cpp b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp new file mode 100644 index 0000000..228f9f1 --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** 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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +class MyPushButton : public QGraphicsProxyWidget +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) + +public: + MyPushButton(QGraphicsItem* parent = 0) + : QGraphicsProxyWidget(parent) + { + widget = new QPushButton("MyPushButton"); + widget->setAttribute(Qt::WA_NoSystemBackground); + setWidget(widget); + + QObject::connect(widget, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool))); + } + + QString text() const + { + return widget->text(); + } + + void setText(const QString& text) + { + if (text != widget->text()) { + widget->setText(text); + emit textChanged(); + } + } + +Q_SIGNALS: + void clicked(bool); + void textChanged(); + +private: + QPushButton *widget; +}; + +class QWidgetsPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + void registerTypes(const char *uri) + { + qmlRegisterType(uri, 1, 0, "MyPushButton"); + } +}; + +#include "qwidgets.moc" + +Q_EXPORT_PLUGIN2(qwidgetsplugin, QWidgetsPlugin); diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro new file mode 100644 index 0000000..37f313d --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro @@ -0,0 +1,21 @@ +TEMPLATE = lib +DESTDIR = QWidgets +TARGET = qwidgetsplugin +CONFIG += qt plugin +QT += declarative + +SOURCES += qwidgets.cpp + +sources.files += qwidgets.pro qwidgets.cpp qwidgets.qml + +sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins + +target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins + +INSTALLS += sources target + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + +symbian:{ + TARGET.EPOCALLOWDLLDATA = 1 +} diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.qml b/examples/declarative/cppextensions/qwidgets/qwidgets.qml new file mode 100644 index 0000000..47f9573 --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.qml @@ -0,0 +1,70 @@ +import Qt 4.7 +import "QWidgets" 1.0 + +Rectangle { + id: window + + property int margin: 30 + + width: 640; height: 480 + color: palette.window + + SystemPalette { id: palette } + + MyPushButton { + id: button1 + x: margin; y: margin + text: "Right" + transformOriginPoint: Qt.point(width / 2, height / 2) + + onClicked: window.state = "right" + } + + MyPushButton { + id: button2 + x: margin; y: margin + 30 + text: "Bottom" + transformOriginPoint: Qt.point(width / 2, height / 2) + + onClicked: window.state = "bottom" + } + + MyPushButton { + id: button3 + x: margin; y: margin + 60 + text: "Quit" + transformOriginPoint: Qt.point(width / 2, height / 2) + + onClicked: Qt.quit() + } + + states: [ + State { + name: "right" + PropertyChanges { target: button1; x: window.width - width - margin; text: "Left"; onClicked: window.state = "" } + PropertyChanges { target: button2; x: window.width - width - margin } + PropertyChanges { target: button3; x: window.width - width - margin } + PropertyChanges { target: window; color: Qt.darker(palette.window) } + }, + State { + name: "bottom" + PropertyChanges { target: button1; y: window.height - height - margin; rotation: 180 } + PropertyChanges { + target: button2 + x: button1.x + button1.width + 10; y: window.height - height - margin + rotation: 180 + text: "Top" + onClicked: window.state = "" + } + PropertyChanges { target: button3; x: button2.x + button2.width + 10; y: window.height - height - margin; rotation: 180 } + PropertyChanges { target: window; color: Qt.lighter(palette.window) } + } + ] + + transitions: Transition { + ParallelAnimation { + NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad } + ColorAnimation { target: window; duration: 600 } + } + } +} diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject b/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/toys/corkboards/Day.qml b/examples/declarative/toys/corkboards/Day.qml new file mode 100644 index 0000000..350c1c4 --- /dev/null +++ b/examples/declarative/toys/corkboards/Day.qml @@ -0,0 +1,101 @@ +import Qt 4.7 + +Component { + Item { + property variant stickies + + id: page + width: 840; height: 480 + + Image { source: "cork.jpg" } + + Text { + text: name; x: 15; y: 8; height: 40; width: 370 + font.pixelSize: 18; font.bold: true; color: "white" + style: Text.Outline; styleColor: "black" + } + + Repeater { + model: notes + Item { + id: stickyPage + + property int randomX: Math.random() * 500 + 100 + property int randomY: Math.random() * 200 + 50 + + x: randomX; y: randomY + + SpringFollow on rotation { + to: -flickable.horizontalVelocity / 100 + spring: 2.0; damping: 0.15 + } + + Item { + id: sticky + scale: 0.7 + + Image { + id: stickyImage + x: 8 + -width * 0.6 / 2; y: -20 + source: "note-yellow.png" + scale: 0.6; transformOrigin: Item.TopLeft + smooth: true + } + + TextEdit { + id: myText + x: -104; y: 36; width: 215; height: 200 + smooth: true + font.pixelSize: 24 + readOnly: false + rotation: -8 + text: noteText + } + + Item { + x: stickyImage.x; y: -20 + width: stickyImage.width * stickyImage.scale + height: stickyImage.height * stickyImage.scale + + MouseArea { + id: mouse + anchors.fill: parent + drag.target: stickyPage + drag.axis: Drag.XandYAxis + drag.minimumY: 0 + drag.maximumY: page.height - 80 + drag.minimumX: 100 + drag.maximumX: page.width - 140 + onClicked: { myText.focus = true } + } + } + } + + Image { + x: -width / 2; y: -height * 0.5 / 2 + source: "tack.png" + scale: 0.7; transformOrigin: Item.TopLeft + } + + states: State { + name: "pressed" + when: mouse.pressed + PropertyChanges { target: sticky; rotation: 8; scale: 1 } + PropertyChanges { target: page; z: 8 } + } + + transitions: Transition { + NumberAnimation { properties: "rotation,scale"; duration: 200 } + } + } + } + } +} + + + + + + + + diff --git a/examples/declarative/toys/corkboards/cork.jpg b/examples/declarative/toys/corkboards/cork.jpg new file mode 100644 index 0000000..160bc00 Binary files /dev/null and b/examples/declarative/toys/corkboards/cork.jpg differ diff --git a/examples/declarative/toys/corkboards/corkboards.qml b/examples/declarative/toys/corkboards/corkboards.qml new file mode 100644 index 0000000..871bafc --- /dev/null +++ b/examples/declarative/toys/corkboards/corkboards.qml @@ -0,0 +1,75 @@ +import Qt 4.7 + +Rectangle { + width: 800; height: 480 + color: "#464646" + + ListModel { + id: list + + ListElement { + name: "Sunday" + notes: [ + ListElement { noteText: "Lunch" }, + ListElement { noteText: "Birthday Party" } + ] + } + + ListElement { + name: "Monday" + notes: [ + ListElement { noteText: "Pickup kids from\nschool\n4.30pm" }, + ListElement { noteText: "Checkout Qt" }, ListElement { noteText: "Read email" } + ] + } + + ListElement { + name: "Tuesday" + notes: [ + ListElement { noteText: "Walk dog" }, + ListElement { noteText: "Buy newspaper" } + ] + } + + ListElement { + name: "Wednesday" + notes: [ ListElement { noteText: "Cook dinner" } ] + } + + ListElement { + name: "Thursday" + notes: [ + ListElement { noteText: "Meeting\n5.30pm" }, + ListElement { noteText: "Weed garden" } + ] + } + + ListElement { + name: "Friday" + notes: [ + ListElement { noteText: "More work" }, + ListElement { noteText: "Grocery shopping" } + ] + } + + ListElement { + name: "Saturday" + notes: [ + ListElement { noteText: "Drink" }, + ListElement { noteText: "Download Qt\nPlay with QML" } + ] + } + } + + ListView { + id: flickable + + anchors.fill: parent + focus: true + highlightRangeMode: ListView.StrictlyEnforceRange + orientation: ListView.Horizontal + snapMode: ListView.SnapOneItem + model: list + delegate: Day { } + } +} diff --git a/examples/declarative/toys/corkboards/corkboards.qmlproject b/examples/declarative/toys/corkboards/corkboards.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/toys/corkboards/corkboards.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/toys/corkboards/note-yellow.png b/examples/declarative/toys/corkboards/note-yellow.png new file mode 100644 index 0000000..8ddecc8 Binary files /dev/null and b/examples/declarative/toys/corkboards/note-yellow.png differ diff --git a/examples/declarative/toys/corkboards/tack.png b/examples/declarative/toys/corkboards/tack.png new file mode 100644 index 0000000..cef2d1c Binary files /dev/null and b/examples/declarative/toys/corkboards/tack.png differ diff --git a/examples/declarative/toys/dynamic/dynamic.qml b/examples/declarative/toys/dynamic/dynamic.qml deleted file mode 100644 index 52c7c1e..0000000 --- a/examples/declarative/toys/dynamic/dynamic.qml +++ /dev/null @@ -1,176 +0,0 @@ -import Qt 4.7 -import Qt.labs.particles 1.0 -import "qml" - -Item { - id: window - - property int activeSuns: 0 - - //This is a desktop-sized example - width: 1024; height: 512 - - //This is the message box that pops up when there's an error - Rectangle { - id: dialog - - opacity: 0 - anchors.centerIn: parent - width: dialogText.width + 6; height: dialogText.height + 6 - border.color: 'black' - color: 'lightsteelblue' - z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. - - function show(str){ - dialogText.text = str; - dialogAnim.start(); - } - - Text { - id: dialogText - x: 3; y: 3 - font.pixelSize: 14 - } - - SequentialAnimation { - id: dialogAnim - NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 } - PauseAnimation { duration: 5000 } - NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 } - } - } - - // sky - Rectangle { - id: sky - anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter } - gradient: Gradient { - GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" } - GradientStop { id: gradientStopB; position: 1.0; color: "#437284" } - } - } - - // stars (when there's no sun) - Particles { - id: stars - x: 0; y: 0; width: parent.width; height: parent.height / 2 - source: "images/star.png" - angleDeviation: 360 - velocity: 0; velocityDeviation: 0 - count: parent.width / 10 - fadeInDuration: 2800 - opacity: 1 - } - - // ground - Rectangle { - id: ground - z: 2 // just above the sun so that the sun can set behind it - anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom } - gradient: Gradient { - GradientStop { position: 0.0; color: "ForestGreen" } - GradientStop { position: 1.0; color: "DarkGreen" } - } - } - - SystemPalette { id: activePalette } - - // right-hand panel - Rectangle { - id: toolbox - - width: 480 - color: activePalette.window - anchors { right: parent.right; top: parent.top; bottom: parent.bottom } - - Column { - anchors.centerIn: parent - spacing: 8 - - Text { text: "Drag an item into the scene." } - - Rectangle { - width: childrenRect.width + 10; height: childrenRect.height + 10 - border.color: "black" - - Row { - anchors.centerIn: parent - spacing: 8 - - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - componentFile: "Sun.qml" - image: "../images/sun.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - componentFile: "GenericSceneItem.qml" - image: "../images/moon.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - componentFile: "PerspectiveItem.qml" - image: "../images/tree_s.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - componentFile: "PerspectiveItem.qml" - image: "../images/rabbit_brown.png" - } - PaletteItem { - anchors.verticalCenter: parent.verticalCenter - componentFile: "PerspectiveItem.qml" - image: "../images/rabbit_bw.png" - } - } - } - - Text { text: "Active Suns: " + activeSuns } - - Rectangle { width: parent.width; height: 1; color: "black" } - - Text { text: "Arbitrary QML:" } - - Rectangle { - width: 460; height: 240 - - TextEdit { - id: qmlText - anchors.fill: parent; anchors.margins: 5 - readOnly: false - focusOnPress: true - font.pixelSize: 14 - - text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}" - } - } - - Button { - text: "Create" - onClicked: { - try { - Qt.createQmlObject(qmlText.text, window, 'CustomObject'); - } catch(err) { - dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message); - } - } - } - } - } - - //Day state, for when a sun is added to the scene - states: State { - name: "Day" - when: window.activeSuns > 0 - - PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" } - PropertyChanges { target: gradientStopB; color: "SkyBlue" } - PropertyChanges { target: stars; opacity: 0 } - } - - transitions: Transition { - PropertyAnimation { duration: 3000 } - ColorAnimation { duration: 3000 } - } - -} diff --git a/examples/declarative/toys/dynamic/dynamic.qmlproject b/examples/declarative/toys/dynamic/dynamic.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/toys/dynamic/dynamic.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/toys/dynamic/images/NOTE b/examples/declarative/toys/dynamic/images/NOTE deleted file mode 100644 index fcd87f9..0000000 --- a/examples/declarative/toys/dynamic/images/NOTE +++ /dev/null @@ -1 +0,0 @@ -Images (except star.png) are from the KDE project. diff --git a/examples/declarative/toys/dynamic/images/face-smile.png b/examples/declarative/toys/dynamic/images/face-smile.png deleted file mode 100644 index 3d66d72..0000000 Binary files a/examples/declarative/toys/dynamic/images/face-smile.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/moon.png b/examples/declarative/toys/dynamic/images/moon.png deleted file mode 100644 index 1c0d606..0000000 Binary files a/examples/declarative/toys/dynamic/images/moon.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/rabbit_brown.png b/examples/declarative/toys/dynamic/images/rabbit_brown.png deleted file mode 100644 index ebfdeed..0000000 Binary files a/examples/declarative/toys/dynamic/images/rabbit_brown.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/rabbit_bw.png b/examples/declarative/toys/dynamic/images/rabbit_bw.png deleted file mode 100644 index 7bff9b9..0000000 Binary files a/examples/declarative/toys/dynamic/images/rabbit_bw.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/star.png b/examples/declarative/toys/dynamic/images/star.png deleted file mode 100644 index 27ef924..0000000 Binary files a/examples/declarative/toys/dynamic/images/star.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/sun.png b/examples/declarative/toys/dynamic/images/sun.png deleted file mode 100644 index 7713ca5..0000000 Binary files a/examples/declarative/toys/dynamic/images/sun.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/images/tree_s.png b/examples/declarative/toys/dynamic/images/tree_s.png deleted file mode 100644 index 6eac35a..0000000 Binary files a/examples/declarative/toys/dynamic/images/tree_s.png and /dev/null differ diff --git a/examples/declarative/toys/dynamic/qml/Button.qml b/examples/declarative/toys/dynamic/qml/Button.qml deleted file mode 100644 index 963a850..0000000 --- a/examples/declarative/toys/dynamic/qml/Button.qml +++ /dev/null @@ -1,40 +0,0 @@ -import Qt 4.7 - -Rectangle { - id: container - - property variant text - signal clicked - - height: text.height + 10; width: text.width + 20 - border.width: 1 - radius: 4 - smooth: true - - gradient: Gradient { - GradientStop { - position: 0.0 - color: !mouseArea.pressed ? activePalette.light : activePalette.button - } - GradientStop { - position: 1.0 - color: !mouseArea.pressed ? activePalette.button : activePalette.dark - } - } - - SystemPalette { id: activePalette } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: container.clicked() - } - - Text { - id: text - anchors.centerIn:parent - font.pointSize: 10 - text: parent.text - color: activePalette.buttonText - } -} diff --git a/examples/declarative/toys/dynamic/qml/PaletteItem.qml b/examples/declarative/toys/dynamic/qml/PaletteItem.qml deleted file mode 100644 index dcb5cc3..0000000 --- a/examples/declarative/toys/dynamic/qml/PaletteItem.qml +++ /dev/null @@ -1,19 +0,0 @@ -import Qt 4.7 -import "itemCreation.js" as Code - -Image { - id: paletteItem - - property string componentFile - property string image - - source: image - - MouseArea { - anchors.fill: parent - - onPressed: Code.startDrag(mouse); - onPositionChanged: Code.continueDrag(mouse); - onReleased: Code.endDrag(mouse); - } -} diff --git a/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml deleted file mode 100644 index c04d3dc..0000000 --- a/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml +++ /dev/null @@ -1,25 +0,0 @@ -import Qt 4.7 - -Image { - id: rootItem - - property bool created: false - property string image - - property double scaledBottom: y + (height + height*scale) / 2 - property bool onLand: scaledBottom > window.height / 2 - - source: image - opacity: onLand ? 1 : 0.25 - scale: Math.max((y + height - 250) * 0.01, 0.3) - smooth: true - - onCreatedChanged: { - if (created && !onLand) - rootItem.destroy(); - else - z = scaledBottom; - } - - onYChanged: z = scaledBottom; -} diff --git a/examples/declarative/toys/dynamic/qml/Sun.qml b/examples/declarative/toys/dynamic/qml/Sun.qml deleted file mode 100644 index 43dcb9a..0000000 --- a/examples/declarative/toys/dynamic/qml/Sun.qml +++ /dev/null @@ -1,38 +0,0 @@ -import Qt 4.7 - -Image { - id: sun - - property bool created: false - property string image: "../images/sun.png" - - source: image - - // once item is created, start moving offscreen - NumberAnimation on y { - to: window.height / 2 - running: created - onRunningChanged: { - if (running) - duration = (window.height - sun.y) * 10; - else - state = "OffScreen" - } - } - - states: State { - name: "OffScreen" - StateChangeScript { - script: { sun.created = false; sun.destroy() } - } - } - - onCreatedChanged: { - if (created) { - sun.z = 1; // above the sky but below the ground layer - window.activeSuns++; - } else { - window.activeSuns--; - } - } -} diff --git a/examples/declarative/toys/dynamic/qml/itemCreation.js b/examples/declarative/toys/dynamic/qml/itemCreation.js deleted file mode 100644 index 59750f3..0000000 --- a/examples/declarative/toys/dynamic/qml/itemCreation.js +++ /dev/null @@ -1,65 +0,0 @@ -var itemComponent = null; -var draggedItem = null; -var startingMouse; -var posnInWindow; - -function startDrag(mouse) -{ - posnInWindow = paletteItem.mapToItem(null, 0, 0); - startingMouse = { x: mouse.x, y: mouse.y } - loadComponent(); -} - -//Creation is split into two functions due to an asynchronous wait while -//possible external files are loaded. - -function loadComponent() { - if (itemComponent != null) { // component has been previously loaded - createItem(); - return; - } - - itemComponent = Qt.createComponent(paletteItem.componentFile); - if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately - component.statusChanged.connect(createItem); - else - createItem(); -} - -function createItem() { - if (itemComponent.status == Component.Ready && draggedItem == null) { - draggedItem = itemComponent.createObject(window); - draggedItem.image = paletteItem.image; - draggedItem.x = posnInWindow.x; - draggedItem.y = posnInWindow.y; - draggedItem.z = 3; // make sure created item is above the ground layer - } else if (itemComponent.status == Component.Error) { - draggedItem = null; - console.log("error creating component"); - console.log(component.errorsString()); - } -} - -function continueDrag(mouse) -{ - if (draggedItem == null) - return; - - draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x; - draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y; -} - -function endDrag(mouse) -{ - if (draggedItem == null) - return; - - if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox - draggedItem.destroy(); - draggedItem = null; - } else { - draggedItem.created = true; - draggedItem = null; - } -} - diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/dynamicscene.qml new file mode 100644 index 0000000..52c7c1e --- /dev/null +++ b/examples/declarative/toys/dynamicscene/dynamicscene.qml @@ -0,0 +1,176 @@ +import Qt 4.7 +import Qt.labs.particles 1.0 +import "qml" + +Item { + id: window + + property int activeSuns: 0 + + //This is a desktop-sized example + width: 1024; height: 512 + + //This is the message box that pops up when there's an error + Rectangle { + id: dialog + + opacity: 0 + anchors.centerIn: parent + width: dialogText.width + 6; height: dialogText.height + 6 + border.color: 'black' + color: 'lightsteelblue' + z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. + + function show(str){ + dialogText.text = str; + dialogAnim.start(); + } + + Text { + id: dialogText + x: 3; y: 3 + font.pixelSize: 14 + } + + SequentialAnimation { + id: dialogAnim + NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 } + PauseAnimation { duration: 5000 } + NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 } + } + } + + // sky + Rectangle { + id: sky + anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter } + gradient: Gradient { + GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" } + GradientStop { id: gradientStopB; position: 1.0; color: "#437284" } + } + } + + // stars (when there's no sun) + Particles { + id: stars + x: 0; y: 0; width: parent.width; height: parent.height / 2 + source: "images/star.png" + angleDeviation: 360 + velocity: 0; velocityDeviation: 0 + count: parent.width / 10 + fadeInDuration: 2800 + opacity: 1 + } + + // ground + Rectangle { + id: ground + z: 2 // just above the sun so that the sun can set behind it + anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom } + gradient: Gradient { + GradientStop { position: 0.0; color: "ForestGreen" } + GradientStop { position: 1.0; color: "DarkGreen" } + } + } + + SystemPalette { id: activePalette } + + // right-hand panel + Rectangle { + id: toolbox + + width: 480 + color: activePalette.window + anchors { right: parent.right; top: parent.top; bottom: parent.bottom } + + Column { + anchors.centerIn: parent + spacing: 8 + + Text { text: "Drag an item into the scene." } + + Rectangle { + width: childrenRect.width + 10; height: childrenRect.height + 10 + border.color: "black" + + Row { + anchors.centerIn: parent + spacing: 8 + + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "Sun.qml" + image: "../images/sun.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "GenericSceneItem.qml" + image: "../images/moon.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/tree_s.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_brown.png" + } + PaletteItem { + anchors.verticalCenter: parent.verticalCenter + componentFile: "PerspectiveItem.qml" + image: "../images/rabbit_bw.png" + } + } + } + + Text { text: "Active Suns: " + activeSuns } + + Rectangle { width: parent.width; height: 1; color: "black" } + + Text { text: "Arbitrary QML:" } + + Rectangle { + width: 460; height: 240 + + TextEdit { + id: qmlText + anchors.fill: parent; anchors.margins: 5 + readOnly: false + focusOnPress: true + font.pixelSize: 14 + + text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}" + } + } + + Button { + text: "Create" + onClicked: { + try { + Qt.createQmlObject(qmlText.text, window, 'CustomObject'); + } catch(err) { + dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message); + } + } + } + } + } + + //Day state, for when a sun is added to the scene + states: State { + name: "Day" + when: window.activeSuns > 0 + + PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" } + PropertyChanges { target: gradientStopB; color: "SkyBlue" } + PropertyChanges { target: stars; opacity: 0 } + } + + transitions: Transition { + PropertyAnimation { duration: 3000 } + ColorAnimation { duration: 3000 } + } + +} diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject b/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/toys/dynamicscene/images/NOTE b/examples/declarative/toys/dynamicscene/images/NOTE new file mode 100644 index 0000000..fcd87f9 --- /dev/null +++ b/examples/declarative/toys/dynamicscene/images/NOTE @@ -0,0 +1 @@ +Images (except star.png) are from the KDE project. diff --git a/examples/declarative/toys/dynamicscene/images/face-smile.png b/examples/declarative/toys/dynamicscene/images/face-smile.png new file mode 100644 index 0000000..3d66d72 Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/face-smile.png differ diff --git a/examples/declarative/toys/dynamicscene/images/moon.png b/examples/declarative/toys/dynamicscene/images/moon.png new file mode 100644 index 0000000..1c0d606 Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/moon.png differ diff --git a/examples/declarative/toys/dynamicscene/images/rabbit_brown.png b/examples/declarative/toys/dynamicscene/images/rabbit_brown.png new file mode 100644 index 0000000..ebfdeed Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/rabbit_brown.png differ diff --git a/examples/declarative/toys/dynamicscene/images/rabbit_bw.png b/examples/declarative/toys/dynamicscene/images/rabbit_bw.png new file mode 100644 index 0000000..7bff9b9 Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/rabbit_bw.png differ diff --git a/examples/declarative/toys/dynamicscene/images/star.png b/examples/declarative/toys/dynamicscene/images/star.png new file mode 100644 index 0000000..27ef924 Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/star.png differ diff --git a/examples/declarative/toys/dynamicscene/images/sun.png b/examples/declarative/toys/dynamicscene/images/sun.png new file mode 100644 index 0000000..7713ca5 Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/sun.png differ diff --git a/examples/declarative/toys/dynamicscene/images/tree_s.png b/examples/declarative/toys/dynamicscene/images/tree_s.png new file mode 100644 index 0000000..6eac35a Binary files /dev/null and b/examples/declarative/toys/dynamicscene/images/tree_s.png differ diff --git a/examples/declarative/toys/dynamicscene/qml/Button.qml b/examples/declarative/toys/dynamicscene/qml/Button.qml new file mode 100644 index 0000000..963a850 --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/Button.qml @@ -0,0 +1,40 @@ +import Qt 4.7 + +Rectangle { + id: container + + property variant text + signal clicked + + height: text.height + 10; width: text.width + 20 + border.width: 1 + radius: 4 + smooth: true + + gradient: Gradient { + GradientStop { + position: 0.0 + color: !mouseArea.pressed ? activePalette.light : activePalette.button + } + GradientStop { + position: 1.0 + color: !mouseArea.pressed ? activePalette.button : activePalette.dark + } + } + + SystemPalette { id: activePalette } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked() + } + + Text { + id: text + anchors.centerIn:parent + font.pointSize: 10 + text: parent.text + color: activePalette.buttonText + } +} diff --git a/examples/declarative/toys/dynamicscene/qml/PaletteItem.qml b/examples/declarative/toys/dynamicscene/qml/PaletteItem.qml new file mode 100644 index 0000000..dcb5cc3 --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/PaletteItem.qml @@ -0,0 +1,19 @@ +import Qt 4.7 +import "itemCreation.js" as Code + +Image { + id: paletteItem + + property string componentFile + property string image + + source: image + + MouseArea { + anchors.fill: parent + + onPressed: Code.startDrag(mouse); + onPositionChanged: Code.continueDrag(mouse); + onReleased: Code.endDrag(mouse); + } +} diff --git a/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml new file mode 100644 index 0000000..c04d3dc --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Image { + id: rootItem + + property bool created: false + property string image + + property double scaledBottom: y + (height + height*scale) / 2 + property bool onLand: scaledBottom > window.height / 2 + + source: image + opacity: onLand ? 1 : 0.25 + scale: Math.max((y + height - 250) * 0.01, 0.3) + smooth: true + + onCreatedChanged: { + if (created && !onLand) + rootItem.destroy(); + else + z = scaledBottom; + } + + onYChanged: z = scaledBottom; +} diff --git a/examples/declarative/toys/dynamicscene/qml/Sun.qml b/examples/declarative/toys/dynamicscene/qml/Sun.qml new file mode 100644 index 0000000..43dcb9a --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/Sun.qml @@ -0,0 +1,38 @@ +import Qt 4.7 + +Image { + id: sun + + property bool created: false + property string image: "../images/sun.png" + + source: image + + // once item is created, start moving offscreen + NumberAnimation on y { + to: window.height / 2 + running: created + onRunningChanged: { + if (running) + duration = (window.height - sun.y) * 10; + else + state = "OffScreen" + } + } + + states: State { + name: "OffScreen" + StateChangeScript { + script: { sun.created = false; sun.destroy() } + } + } + + onCreatedChanged: { + if (created) { + sun.z = 1; // above the sky but below the ground layer + window.activeSuns++; + } else { + window.activeSuns--; + } + } +} diff --git a/examples/declarative/toys/dynamicscene/qml/itemCreation.js b/examples/declarative/toys/dynamicscene/qml/itemCreation.js new file mode 100644 index 0000000..59750f3 --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/itemCreation.js @@ -0,0 +1,65 @@ +var itemComponent = null; +var draggedItem = null; +var startingMouse; +var posnInWindow; + +function startDrag(mouse) +{ + posnInWindow = paletteItem.mapToItem(null, 0, 0); + startingMouse = { x: mouse.x, y: mouse.y } + loadComponent(); +} + +//Creation is split into two functions due to an asynchronous wait while +//possible external files are loaded. + +function loadComponent() { + if (itemComponent != null) { // component has been previously loaded + createItem(); + return; + } + + itemComponent = Qt.createComponent(paletteItem.componentFile); + if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately + component.statusChanged.connect(createItem); + else + createItem(); +} + +function createItem() { + if (itemComponent.status == Component.Ready && draggedItem == null) { + draggedItem = itemComponent.createObject(window); + draggedItem.image = paletteItem.image; + draggedItem.x = posnInWindow.x; + draggedItem.y = posnInWindow.y; + draggedItem.z = 3; // make sure created item is above the ground layer + } else if (itemComponent.status == Component.Error) { + draggedItem = null; + console.log("error creating component"); + console.log(component.errorsString()); + } +} + +function continueDrag(mouse) +{ + if (draggedItem == null) + return; + + draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x; + draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y; +} + +function endDrag(mouse) +{ + if (draggedItem == null) + return; + + if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox + draggedItem.destroy(); + draggedItem = null; + } else { + draggedItem.created = true; + draggedItem = null; + } +} + diff --git a/examples/declarative/toys/velocity/Day.qml b/examples/declarative/toys/velocity/Day.qml deleted file mode 100644 index 350c1c4..0000000 --- a/examples/declarative/toys/velocity/Day.qml +++ /dev/null @@ -1,101 +0,0 @@ -import Qt 4.7 - -Component { - Item { - property variant stickies - - id: page - width: 840; height: 480 - - Image { source: "cork.jpg" } - - Text { - text: name; x: 15; y: 8; height: 40; width: 370 - font.pixelSize: 18; font.bold: true; color: "white" - style: Text.Outline; styleColor: "black" - } - - Repeater { - model: notes - Item { - id: stickyPage - - property int randomX: Math.random() * 500 + 100 - property int randomY: Math.random() * 200 + 50 - - x: randomX; y: randomY - - SpringFollow on rotation { - to: -flickable.horizontalVelocity / 100 - spring: 2.0; damping: 0.15 - } - - Item { - id: sticky - scale: 0.7 - - Image { - id: stickyImage - x: 8 + -width * 0.6 / 2; y: -20 - source: "note-yellow.png" - scale: 0.6; transformOrigin: Item.TopLeft - smooth: true - } - - TextEdit { - id: myText - x: -104; y: 36; width: 215; height: 200 - smooth: true - font.pixelSize: 24 - readOnly: false - rotation: -8 - text: noteText - } - - Item { - x: stickyImage.x; y: -20 - width: stickyImage.width * stickyImage.scale - height: stickyImage.height * stickyImage.scale - - MouseArea { - id: mouse - anchors.fill: parent - drag.target: stickyPage - drag.axis: Drag.XandYAxis - drag.minimumY: 0 - drag.maximumY: page.height - 80 - drag.minimumX: 100 - drag.maximumX: page.width - 140 - onClicked: { myText.focus = true } - } - } - } - - Image { - x: -width / 2; y: -height * 0.5 / 2 - source: "tack.png" - scale: 0.7; transformOrigin: Item.TopLeft - } - - states: State { - name: "pressed" - when: mouse.pressed - PropertyChanges { target: sticky; rotation: 8; scale: 1 } - PropertyChanges { target: page; z: 8 } - } - - transitions: Transition { - NumberAnimation { properties: "rotation,scale"; duration: 200 } - } - } - } - } -} - - - - - - - - diff --git a/examples/declarative/toys/velocity/cork.jpg b/examples/declarative/toys/velocity/cork.jpg deleted file mode 100644 index 160bc00..0000000 Binary files a/examples/declarative/toys/velocity/cork.jpg and /dev/null differ diff --git a/examples/declarative/toys/velocity/note-yellow.png b/examples/declarative/toys/velocity/note-yellow.png deleted file mode 100644 index 8ddecc8..0000000 Binary files a/examples/declarative/toys/velocity/note-yellow.png and /dev/null differ diff --git a/examples/declarative/toys/velocity/tack.png b/examples/declarative/toys/velocity/tack.png deleted file mode 100644 index cef2d1c..0000000 Binary files a/examples/declarative/toys/velocity/tack.png and /dev/null differ diff --git a/examples/declarative/toys/velocity/velocity.qml b/examples/declarative/toys/velocity/velocity.qml deleted file mode 100644 index 871bafc..0000000 --- a/examples/declarative/toys/velocity/velocity.qml +++ /dev/null @@ -1,75 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 800; height: 480 - color: "#464646" - - ListModel { - id: list - - ListElement { - name: "Sunday" - notes: [ - ListElement { noteText: "Lunch" }, - ListElement { noteText: "Birthday Party" } - ] - } - - ListElement { - name: "Monday" - notes: [ - ListElement { noteText: "Pickup kids from\nschool\n4.30pm" }, - ListElement { noteText: "Checkout Qt" }, ListElement { noteText: "Read email" } - ] - } - - ListElement { - name: "Tuesday" - notes: [ - ListElement { noteText: "Walk dog" }, - ListElement { noteText: "Buy newspaper" } - ] - } - - ListElement { - name: "Wednesday" - notes: [ ListElement { noteText: "Cook dinner" } ] - } - - ListElement { - name: "Thursday" - notes: [ - ListElement { noteText: "Meeting\n5.30pm" }, - ListElement { noteText: "Weed garden" } - ] - } - - ListElement { - name: "Friday" - notes: [ - ListElement { noteText: "More work" }, - ListElement { noteText: "Grocery shopping" } - ] - } - - ListElement { - name: "Saturday" - notes: [ - ListElement { noteText: "Drink" }, - ListElement { noteText: "Download Qt\nPlay with QML" } - ] - } - } - - ListView { - id: flickable - - anchors.fill: parent - focus: true - highlightRangeMode: ListView.StrictlyEnforceRange - orientation: ListView.Horizontal - snapMode: ListView.SnapOneItem - model: list - delegate: Day { } - } -} diff --git a/examples/declarative/toys/velocity/velocity.qmlproject b/examples/declarative/toys/velocity/velocity.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/toys/velocity/velocity.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} -- cgit v0.12