\l{QML Tutorial}{simple tutorial}).
In this tutorial we write a game, \e {Same Game}, based on the Same Game application
-included in the declarative \c demos directory, which looks like this:
+included in the declarative \c examples directory, which looks like this:
\image declarative-samegame.png
\endlist
There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the
-demos and examples and the \l {Qt Quick}{documentation} to see all the things you can do with QML!
+examples and the \l {Qt Quick}{documentation} to see all the things you can do with QML!
*/
/*!
\page qdeclarativeexamples.html
- \title QML Examples and Demos
+ \title QML Examples
\brief Building UIs with QML
\ingroup all-examples
-Qt includes a set of examples and demos that show how to use various aspects
-of QML. The examples are small demonstrations of particular QML components,
-while the demos contain more complete and functional applications.
+Qt includes a set of examples that show how to use various aspects
+of QML. The examples are demonstrations of particular QML components,
+some are small code snippets, while others contain more complete and
+functional applications.
-To run the examples and demos, open them in Qt Creator or use the included
+To run the examples, open them in Qt Creator or use the included
\l {QML Viewer} tool. The \l {QML Viewer} can be run from the command line:
\code
- qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml
+ qmlviewer $QTDIR/examples/declarative/samegame/samegame.qml
\endcode
On Mac OS X, you can run the included "QMLViewer" application from the
Finder, or use the command line:
\code
- QMLViewer.app/Contents/MacOS/QMLViewer $QTDIR/demos/declarative/samegame/samegame.qml
+ QMLViewer.app/Contents/MacOS/QMLViewer $QTDIR/examples/declarative/samegame/samegame.qml
\endcode
-\section1 Demos
+The examples can be found in Qt's \c examples/declarative directory.
+
+
+\section1 Functional Applications
-The QML demos integrate a variety of features to demonstrate how QML
+These QML examples integrate a variety of features to demonstrate how QML
can be used to produce sophisticated interfaces and applications:
\row
\o
-\l{demos/declarative/calculator}{Calculator}
+\l{declarative/calculator}{Calculator}
\image qml-calculator-example-small.png
\o
-\l{demos/declarative/flickr}{Flickr Mobile}
+\l{declarative/flickr}{Flickr Mobile}
\image qml-flickr-demo-small.png
\o
-\l{demos/declarative/minehunt}{Minehunt}
+\l{declarative/minehunt}{Minehunt}
\image qml-minehunt-demo-small.png
\row
\o
-\l{demos/declarative/photoviewer}{Photo Viewer}
+\l{declarative/photoviewer}{Photo Viewer}
\image qml-photoviewer-demo-small.png
\o
-\l{demos/declarative/rssnews}{RSS News Reader}
+\l{declarative/rssnews}{RSS News Reader}
\image qml-rssnews-demo-small.png
\o
-\l{demos/declarative/samegame}{Same Game}
+\l{declarative/samegame}{Same Game}
\image qml-samegame-demo-small.png
\row
\o
-\l{demos/declarative/snake}{Snake}
+\l{declarative/snake}{Snake}
\image qml-snake-demo-small.png
\o
-\l{demos/declarative/twitter}{Twitter}
+\l{declarative/twitter}{Twitter}
\image qml-twitter-demo-small.png
\o
-\l{demos/declarative/webbrowser}{Web Browser}
+\l{declarative/webbrowser}{Web Browser}
\image qml-webbrowser-demo-small.png
\endtable
-The demos can be found in Qt's \c demos/declarative directory.
+\section1 Code Snippets
-\section1 Examples
-
-The QML examples are small, simple applications that show how to use a particular
+These QML examples are small, simple applications that show how to use a particular
QML component or feature. If you are new
to QML, you may also find the \l{QML Tutorial}{Hello World} and
\l {QML Advanced Tutorial}{Same Game} tutorials useful.
-The examples can be found in Qt's \c examples/declarative directory.
-
\section2 Animation
\list
\o \l{declarative/animation/basics}{Basics}
to access an on-line photography service would provide the QML application with URLs to
photographs, which can be directly set on an \l Image \c source property.
-See the \tt demos/declarative/flickr for a real demonstration of this.
+See the \tt examples/declarative/flickr for a real demonstration of this.
\section1 Configuring the Network Access Manager
}
\endqml
-The \l{demos/declarative/rssnews}{RSS News demo} shows how XmlListModel can
+The \l{declarative/rssnews}{RSS News demo} shows how XmlListModel can
be used to display an RSS feed.
with C++ code in many ways, including being loaded as a part of a C++ UI
and loading data models from C++ and interacting with them.
-The example launcher provided with Qt can be used to explore each of the
-examples in this directory. But most can also be viewed directly with the
+Mostof these examples can be viewed directly with the
QML viewer utility, without requiring compilation.
-Documentation for these examples can be found via the Tutorials and Examples
-link in the main Qt documentation.
-
-
-Finding the Qt Examples and Demos launcher
-==========================================
-
-On Windows:
-
-The launcher can be accessed via the Windows Start menu. Select the menu
-entry entitled "Qt Examples and Demos" entry in the submenu containing
-the Qt tools.
-
-On Mac OS X:
-For the binary distribution, the qtdemo executable is installed in the
-/Developer/Applications/Qt directory. For the source distribution, it is
-installed alongside the other Qt tools on the path specified when Qt is
-configured.
-
-On Unix/Linux:
-
-The qtdemo executable is installed alongside the other Qt tools on the path
-specified when Qt is configured.
-
-On all platforms:
-
-The source code for the launcher can be found in the demos/qtdemo directory
-in the Qt package. This example is built at the same time as the Qt libraries,
-tools, examples, and demonstrations.
+Documentation for these examples can be found via the Examples
+link in the main Qt documentation.
RESOURCES = minehunt.qrc
sources.files = minehunt.qml minehunt.pro MinehuntCore
-sources.path = $$[QT_INSTALL_DEMOS]/qtdeclarative/declarative/minehunt
-target.path = $$[QT_INSTALL_DEMOS]/qtdeclarative/declarative/minehunt
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
+target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
INSTALLS = sources target
symbian:{
TARGET.EPOCALLOWDLLDATA = 1
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
- CONFIG += qt_demo
+ CONFIG += qt_example
qmlminehuntfiles.files = MinehuntCore minehunt.qml
DEPLOYMENT += qmlminehuntfiles
}
anchors { top: parent.top; topMargin: 10; horizontalCenter: parent.horizontalCenter }
width: 300; height: 400
clip: true;
- source: "../../../../demos/declarative/samegame/samegame.qml"
+ source: "../../samegame/samegame.qml"
Component.onCompleted: item.inAnotherDemo = true;
}
}
id: shell
anchors.fill: parent
}
- VisualDataModel{//TODO: Transitions
+ VisualDataModel{//TODO: Transitions between modes
id: vdm
model: [
"../spaceexplorer/spaceexplorer.qml",
"../asteroid/asteroid.qml",
"../asteroid/blackhole.qml",
"../custom/blurparticles.qml",
- "../custom/shader.qml",
- "../custom/delegates.qml",
"../modelparticles/bubbles.qml",
"../modelparticles/gridsplosion.qml",
"../modelparticles/package.qml",
"../trails/layered.qml",
"../trails/shimmer.qml",
"../trails/turbulence.qml",
- "../trails/combustion.qml",
- "../trails/fireworks.qml",
- "../../../../demos/declarative/samegame/samegame.qml",
- "../../../../demos/declarative/plasmapatrol/plasmapatrol.qml",
- "../../../../demos/declarative/flickr/flickr.qml"
+ "../../samegame/samegame.qml",
+ "../../plasmapatrol/plasmapatrol.qml",
+ "../../flickr/flickr.qml"
]
delegate: Rectangle{
color: "white"
Rectangle {
id: screen
width: 360; height: 640
- property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos
+ property bool inAnotherDemo: false //Samegame often is just plonked straight into other examples
SystemPalette { id: activePalette }
symbian {
TARGET.UID3 = 0x$$qmlcalculator_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
LIBS += -lcone -leikcore -lavkon # Screen orientation
}
symbian {
TARGET.UID3 = 0x$$qmlclocks_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
LIBS += -lcone -leikcore -lavkon # Screen orientation
}
symbian {
TARGET.UID3 = 0x$$qmldialcontrol_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
symbian {
TARGET.UID3 = 0x$$qmleasing_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
symbian {
TARGET.UID3 = 0x$$qmlflickr_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.CAPABILITY = NetworkServices
# Maximum heap size set to 128 MB in order to allow loading large images.
TARGET.EPOCHEAPSIZE = 0x20000 0x8000000
symbian {
TARGET.UID3 = 0x$$qmlphotoviewer_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
symbian {
TARGET.UID3 = 0x$$qmltwitter_uid3 # defined in deployment.pri
- CONFIG += qt_demo
+ CONFIG += qt_example
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
\snippet examples/declarative/modelviews/package/view.qml 0
- \sa {declarative/modelviews/package}{Package example}, {demos/declarative/photoviewer}{Photo Viewer demo}, QtDeclarative
+ \sa {declarative/modelviews/package}{Package example}, {declarative/photoviewer}{Photo Viewer example}, QtDeclarative
*/
/*!
#ifdef QT_NO_WEBKIT
excludedDirs << "examples/declarative/modelviews/webview";
- excludedDirs << "demos/declarative/webbrowser";
+ excludedDirs << "examples/declarative/webbrowser";
excludedDirs << "doc/src/snippets/declarative/webview";
#endif
#ifdef QT_NO_XMLPATTERNS
excludedDirs << "examples/declarative/xml/xmldata";
- excludedDirs << "demos/declarative/twitter";
- excludedDirs << "demos/declarative/flickr";
- excludedDirs << "demos/declarative/photoviewer";
+ excludedDirs << "examples/declarative/twitter";
+ excludedDirs << "examples/declarative/flickr";
+ excludedDirs << "examples/declarative/photoviewer";
#endif
}
/*
-This tests that the demos and examples follow the naming convention required
+This tests that the examples follow the naming convention required
to have them tested by the examples() test.
*/
void tst_examples::namingConvention(const QDir &d)
This test runs all the examples in the declarative UI source tree and ensures
that they start and exit cleanly.
-Examples are any .qml files under the examples/ or demos/ directory that start
+Examples are any .qml files under the examples/ directory that start
with a lower case letter.
*/
void tst_examples::examples_data()
{
QTest::addColumn<QString>("file");
- QString examples = QLatin1String(SRCDIR) + "/../../../../demos/declarative/";
- QString demos = QLatin1String(SRCDIR) + "/../../../../examples/declarative/";
+ QString examples = QLatin1String(SRCDIR) + "/../../../../examples/declarative/";
QString snippets = QLatin1String(SRCDIR) + "/../../../../doc/src/snippets/";
QStringList files;
files << findQmlFiles(QDir(examples));
- files << findQmlFiles(QDir(demos));
files << findQmlFiles(QDir(snippets));
foreach (const QString &file, files)