Skip to content

Commit

Permalink
Start of examples refactor
Browse files Browse the repository at this point in the history
This is the general reorg of the examples directory structure, plus additional
guidelines.

calculator, animations and accessibility have been updated to the new standards
and tested, as an example.

Task-number: QTBUG-24133
Change-Id: I76c3b86751d3195ba2a5474ff23afb875765e9a4
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Feb 24, 2012
1 parent 91d543f commit 9d2b618
Show file tree
Hide file tree
Showing 893 changed files with 1,193 additions and 1,205 deletions.
16 changes: 1 addition & 15 deletions .gitignore
@@ -1,20 +1,6 @@
# This file is used to ignore files which are generated in the Qt build system
# ----------------------------------------------------------------------------

examples/*/*/*
!examples/*/*/*[.]*
!examples/*/*/README
examples/*/*/*[.]app
!examples/declarative/*
!examples/tutorials/*
!examples/tutorials/*/*
!examples/ja_JP/*/*
demos/*/*
!demos/spectrum/*
demos/spectrum/bin
!demos/*/*[.]*
demos/*/*[.]app
!demos/declarative/*
config.tests/*/*/*
!config.tests/*/*/*[.]*
config.tests/*/*/*[.]app
Expand Down Expand Up @@ -273,4 +259,4 @@ tests/auto/*/*.o
tests/auto/*/*.moc
tests/auto/*/*/*.o
tests/auto/*/*/*.moc
src/declarative/generated/
src/declarative/generated/
3 changes: 2 additions & 1 deletion doc/config/qtquick.qdocconf
Expand Up @@ -19,7 +19,8 @@ headerdirs += ../src \
imagedirs += ../src/images \

sourcedirs += ../src \
../../src
../../src \
../../examples

#indexes = $QT5DOC/doc/html/qt.index

Expand Down
19 changes: 0 additions & 19 deletions doc/src/examples/examples-groups.qdoc
Expand Up @@ -31,15 +31,6 @@
\image qml-i18n-example.png
\brief This is an internationalization example
*/
/*!
\title QML Examples - Shader Effects
\example declarative/shadereffects
\image qml-shadereffects-example.png
\brief This is a shader effects example

This example demonstrates a couple of visual effects that you can perform
with shaders in QtQuick 2.0
*/
/*!
\title QML Examples - Positioners
\example declarative/positioners
Expand All @@ -48,16 +39,6 @@

This example demonstrates the positioners and some of their animations.
*/
/*!
\title QML Examples - Animation
\example declarative/animation
\brief This is a collection of QML examples
\image qml-animations-example.png

This is a collection of small QML examples relating to animation. Each example is
a small QML file, usually containing or emphasizing a particular element or
feature. You can run and observe the behavior of each example.
*/
/*!
\title QML Examples - Image Elements
\example declarative/imageelements
Expand Down
7 changes: 0 additions & 7 deletions doc/src/examples/examples-toys.qdoc
Expand Up @@ -26,13 +26,6 @@
****************************************************************************/


/*!
\title QML Example - Calculator
\example declarative/calculator
\brief This is an example application written in QML.
\image qml-calculator-demo-small.png
*/

/*!
\title QML Example - Samegame
\example declarative/samegame
Expand Down
23 changes: 23 additions & 0 deletions examples/HACKING
@@ -0,0 +1,23 @@
Some guidelines for QtDeclarative examples

Snippets
---
Snippets are snatches of QML code that won't even run on their own. They don't belong here, they belong in doc/src/snippets. They should be contained in files that will compile on their own, for automated syntax validation, but don't have to look like anything.

Examples
---

Examples are large blocks of QML code that demonstrate a feature. You should be able to launch an example and visually see the feature take effect. Examples should be written in a small form, and should automatically activate any features. Ideally, when you run an example, you see the feature demonstrate itself over and over until you get bored and close the application using your platform's close window mechanism. Examples shouldn't contain their own close buttons or start screen, explanatory text should be kept to a minimum (show, not tell), and reserve interaction for demonstrating interactive elements). The code should be held to a high level of quality, and should be understandable by people new to QML.

Unless the demonstrated feature uses it, assume no interface devices other than a screen that can show a 320x480 rectangle and a generic pointing device (with the shared subset of mouse/touch functionality).

Groups of similar examples should be placed in one folder with a single launcher application, which uses the QtQuick.Examples module for common components.

The example, or launcher application in case of groups, should contain a qdoc comment explaining the example. The example or launcher should be buildable as a full C++ application and runnable with the standard qml file launcher.

Demos
---

Demos are examples of creating full applications using QML. They should fit both a desktop and a mobile form factor, they should have their own start screen and method of exiting the application. They should be at a level of quality that you'd be comfortable submitting them to an app store for a platform of the appropriate hardware (screen size, input methods, etc.). The code should be written to a level that is easily understood and modified by a QML expert.

Demos should have a qdoc file in their directory explaining the demo at a high level. The demo should be buildable as a full C++ application and preferably runnable with the standard qml file launcher.
1 change: 0 additions & 1 deletion examples/declarative/README → examples/README
Expand Up @@ -8,6 +8,5 @@ and loading data models from C++ and interacting with them.
Mostof these examples can be viewed directly with the
QML viewer utility, without requiring compilation.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.
38 changes: 0 additions & 38 deletions examples/declarative/declarative.pro

This file was deleted.

0 comments on commit 9d2b618

Please sign in to comment.