aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/HACKING2
-rw-r--r--examples/qml/doc/src/qml-extending.qdoc (renamed from examples/quick/doc/src/qml-extending.qdoc)36
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/app.qml (renamed from examples/quick/tutorials/extending/chapter1-basics/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro (renamed from examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/main.cpp (renamed from examples/quick/tutorials/extending/chapter1-basics/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter1-basics/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/piechart.h (renamed from examples/quick/tutorials/extending/chapter1-basics/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/app.qml (renamed from examples/quick/tutorials/extending/chapter2-methods/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro (renamed from examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/main.cpp (renamed from examples/quick/tutorials/extending/chapter2-methods/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter2-methods/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/piechart.h (renamed from examples/quick/tutorials/extending/chapter2-methods/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/app.qml (renamed from examples/quick/tutorials/extending/chapter3-bindings/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro (renamed from examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/main.cpp (renamed from examples/quick/tutorials/extending/chapter3-bindings/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/piechart.h (renamed from examples/quick/tutorials/extending/chapter3-bindings/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/app.qml (renamed from examples/quick/tutorials/extending/chapter5-listproperties/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro (renamed from examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/main.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/piechart.h (renamed from examples/quick/tutorials/extending/chapter5-listproperties/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h (renamed from examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir (renamed from examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/app.qml (renamed from examples/quick/tutorials/extending/chapter6-plugins/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro (renamed from examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/piechart.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/pieslice.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/extending.pro (renamed from examples/quick/tutorials/extending/extending.pro)0
-rw-r--r--examples/quick/accessibility/doc/src/accessibility.qdoc4
-rw-r--r--examples/quick/animation/doc/src/animation.qdoc20
-rw-r--r--examples/quick/canvas/doc/src/canvas.qdoc10
-rw-r--r--examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml5
-rw-r--r--examples/quick/customitems/maskedmousearea/maskedmousearea.cpp4
-rw-r--r--examples/quick/customitems/painteditem/painteditem.pro3
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.pro19
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qml11
-rw-r--r--examples/quick/demos/calqlatr/content/Display.qml20
-rw-r--r--examples/quick/demos/calqlatr/content/NumberPad.qml2
-rw-r--r--examples/quick/demos/calqlatr/content/calculator.js8
-rw-r--r--examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png (renamed from examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png)bin37120 -> 37120 bytes
-rw-r--r--examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc10
-rw-r--r--examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.pngbin0 -> 26067 bytes
-rw-r--r--examples/quick/demos/clocks/doc/src/clocks.qdoc35
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.pngbin0 -> 73390 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.pngbin0 -> 61303 bytes
-rw-r--r--examples/quick/demos/maroon/doc/src/maroon.qdoc36
-rw-r--r--examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png (renamed from examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png)bin47271 -> 47271 bytes
-rw-r--r--examples/quick/demos/photosurface/doc/src/photosurface.qdoc8
-rw-r--r--examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.pngbin0 -> 73662 bytes
-rw-r--r--examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc35
-rw-r--r--examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.pngbin0 -> 43372 bytes
-rw-r--r--examples/quick/demos/rssnews/doc/src/rssnews.qdoc35
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.pngbin0 -> 100713 bytes
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.pngbin0 -> 134892 bytes
-rw-r--r--examples/quick/demos/samegame/doc/src/samegame.qdoc36
-rw-r--r--examples/quick/demos/stocqt/content/CheckBox.qml21
-rw-r--r--examples/quick/demos/stocqt/content/StockSettings.qml3
-rw-r--r--examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.pngbin0 -> 24592 bytes
-rw-r--r--examples/quick/demos/stocqt/doc/src/stocqt.qdoc35
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.pngbin0 -> 18531 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.pngbin0 -> 90622 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc36
-rw-r--r--examples/quick/dialogs/ColorDialogs.qml40
-rw-r--r--examples/quick/dialogs/FileDialogs.qml79
-rw-r--r--examples/quick/dialogs/dialogs.pro17
-rw-r--r--examples/quick/dialogs/dialogs.qml (renamed from examples/quick/window/window/Window.qml)25
-rw-r--r--examples/quick/dialogs/dialogs.qrc7
-rw-r--r--examples/quick/dialogs/doc/images/dialogs-example.jpgbin0 -> 47413 bytes
-rw-r--r--examples/quick/dialogs/doc/src/dialogs.qdoc44
-rw-r--r--examples/quick/dialogs/main.cpp41
-rw-r--r--examples/quick/draganddrop/doc/src/draganddrop.qdoc10
-rw-r--r--examples/quick/imageelements/doc/src/imageelements.qdoc10
-rw-r--r--examples/quick/mousearea/doc/src/mousearea.qdoc4
-rw-r--r--examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc18
-rw-r--r--examples/quick/particles/affectors/content/attractor.qml6
-rw-r--r--examples/quick/particles/affectors/content/groupgoal.qml4
-rw-r--r--examples/quick/particles/affectors/content/move.qml6
-rw-r--r--examples/quick/particles/affectors/content/spritegoal.qml4
-rw-r--r--examples/quick/particles/affectors/content/turbulence.qml4
-rw-r--r--examples/quick/particles/affectors/doc/src/affectors.qdoc34
-rw-r--r--examples/quick/particles/customparticle/content/imagecolors.qml2
-rw-r--r--examples/quick/particles/customparticle/doc/src/customparticle.qdoc10
-rw-r--r--examples/quick/particles/emitters/content/burstandpulse.qml2
-rw-r--r--examples/quick/particles/emitters/content/customemitter.qml2
-rw-r--r--examples/quick/particles/emitters/content/emitmask.qml2
-rw-r--r--examples/quick/particles/emitters/content/maximumemitted.qml2
-rw-r--r--examples/quick/particles/emitters/content/shapeanddirection.qml2
-rw-r--r--examples/quick/particles/emitters/content/trailemitter.qml4
-rw-r--r--examples/quick/particles/emitters/content/velocityfrommotion.qml8
-rw-r--r--examples/quick/particles/emitters/doc/src/emitters.qdoc12
-rw-r--r--examples/quick/particles/imageparticle/content/colored.qml4
-rw-r--r--examples/quick/particles/imageparticle/content/colortable.qml2
-rw-r--r--examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc14
-rw-r--r--examples/quick/particles/images.qrc3
-rw-r--r--examples/quick/particles/images/particle.pngbin861 -> 0 bytes
-rw-r--r--examples/quick/particles/images/particle4.pngbin1799 -> 0 bytes
-rw-r--r--examples/quick/particles/images/star.pngbin1550 -> 0 bytes
-rw-r--r--examples/quick/particles/system/content/dynamiccomparison.qml4
-rw-r--r--examples/quick/particles/system/content/dynamicemitters.qml2
-rw-r--r--examples/quick/particles/system/content/multiplepainters.qml2
-rw-r--r--examples/quick/particles/system/content/startstop.qml2
-rw-r--r--examples/quick/particles/system/content/timedgroupchanges.qml2
-rw-r--r--examples/quick/particles/system/doc/src/system.qdoc12
-rw-r--r--examples/quick/positioners/doc/src/positioners.qdoc8
-rw-r--r--examples/quick/quick.pro1
-rw-r--r--examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc32
-rw-r--r--examples/quick/scenegraph/graph/doc/images/graph-example.jpgbin0 -> 18923 bytes
-rw-r--r--examples/quick/scenegraph/graph/doc/src/graph.qdoc38
-rw-r--r--examples/quick/scenegraph/graph/graph.cpp128
-rw-r--r--examples/quick/scenegraph/graph/graph.h67
-rw-r--r--examples/quick/scenegraph/graph/graph.pro34
-rw-r--r--examples/quick/scenegraph/graph/graph.qrc9
-rw-r--r--examples/quick/scenegraph/graph/gridnode.cpp95
-rw-r--r--examples/quick/scenegraph/graph/gridnode.h59
-rw-r--r--examples/quick/scenegraph/graph/linenode.cpp151
-rw-r--r--examples/quick/scenegraph/graph/linenode.h58
-rw-r--r--examples/quick/scenegraph/graph/main.cpp60
-rw-r--r--examples/quick/scenegraph/graph/main.qml85
-rw-r--r--examples/quick/scenegraph/graph/noisynode.cpp142
-rw-r--r--examples/quick/scenegraph/graph/noisynode.h56
-rw-r--r--examples/quick/scenegraph/graph/shaders/line.fsh (renamed from examples/quick/window/window/nogui.qml)20
-rw-r--r--examples/quick/scenegraph/graph/shaders/line.vsh56
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.fsh55
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.vsh54
-rw-r--r--examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc32
-rw-r--r--examples/quick/scenegraph/openglunderqml/squircle.cpp11
-rw-r--r--examples/quick/scenegraph/openglunderqml/squircle.h6
-rw-r--r--examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc26
-rw-r--r--examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc2
-rw-r--r--examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc2
-rw-r--r--examples/quick/scenegraph/textureinthread/error.qml49
-rw-r--r--examples/quick/scenegraph/textureinthread/main.cpp42
-rw-r--r--examples/quick/scenegraph/textureinthread/textureinthread.pro6
-rw-r--r--examples/quick/scenegraph/textureinthread/textureinthread.qrc3
-rw-r--r--examples/quick/scenegraph/textureinthread/threadrenderer.cpp69
-rw-r--r--examples/quick/scenegraph/textureinthread/threadrenderer.h6
-rw-r--r--examples/quick/shadereffects/doc/src/shadereffects.qdoc12
-rw-r--r--examples/quick/shared/TabSet.qml (renamed from examples/quick/window/screen/screenInfo.qml)85
-rw-r--r--examples/quick/shared/images/qt-logo.pngbin0 -> 13923 bytes
-rw-r--r--examples/quick/shared/images/tab.pngbin0 -> 507 bytes
-rw-r--r--examples/quick/shared/qmldir1
-rw-r--r--examples/quick/shared/shared.h2
-rw-r--r--examples/quick/shared/shared.qrc4
-rw-r--r--examples/quick/text/doc/src/text.qdoc18
-rw-r--r--examples/quick/textureprovider/etcprovider.cpp6
-rw-r--r--examples/quick/threading/doc/src/threading.qdoc10
-rw-r--r--examples/quick/touchinteraction/doc/src/touchinteraction.qdoc10
-rw-r--r--examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc20
-rw-r--r--examples/quick/views/doc/src/views.qdoc32
-rw-r--r--examples/quick/window/ScreenInfo.qml (renamed from examples/quick/window/window/twowindows.qml)92
-rw-r--r--examples/quick/window/Splash.qml79
-rw-r--r--examples/quick/window/doc/images/qml-window-example.pngbin0 -> 9863 bytes
-rw-r--r--examples/quick/window/doc/src/window.qdoc71
-rw-r--r--examples/quick/window/main.cpp (renamed from examples/quick/window/window/window.cpp)4
-rw-r--r--examples/quick/window/resources/icon.icnsbin0 -> 59662 bytes
-rw-r--r--examples/quick/window/resources/icon.icobin0 -> 11825 bytes
-rw-r--r--examples/quick/window/resources/icon.svg208
-rw-r--r--examples/quick/window/resources/icon64.pngbin0 -> 3004 bytes
-rw-r--r--examples/quick/window/resources/window.rc32
-rw-r--r--examples/quick/window/window.pro18
-rw-r--r--examples/quick/window/window.qml181
-rw-r--r--examples/quick/window/window.qrc7
-rw-r--r--examples/quick/window/window/standalone.qml128
-rw-r--r--examples/quick/window/window/window.pro13
-rw-r--r--examples/quick/window/window/window.qrc5
178 files changed, 2780 insertions, 600 deletions
diff --git a/examples/HACKING b/examples/HACKING
index 9539d2d129..7d2a61a481 100644
--- a/examples/HACKING
+++ b/examples/HACKING
@@ -1,4 +1,4 @@
-Some guidelines for QtQml examples
+Some guidelines for Qt QML examples
Snippets
---
diff --git a/examples/quick/doc/src/qml-extending.qdoc b/examples/qml/doc/src/qml-extending.qdoc
index ee2dd06623..7dbd147cc1 100644
--- a/examples/quick/doc/src/qml-extending.qdoc
+++ b/examples/qml/doc/src/qml-extending.qdoc
@@ -34,7 +34,7 @@
The Adding Types Example shows how to add a new object type, \c Person, to QML.
The \c Person type can be used from QML like this:
-\snippet qml/referenceexamples/adding/example.qml 0
+\snippet referenceexamples/adding/example.qml 0
\section1 Declare the Person class
@@ -43,11 +43,11 @@ with the two properties we want accessible on the QML type - name and shoeSize.
Although in this example we use the same name for the C++ class as the QML
type, the C++ class can be named differently, or appear in a namespace.
-\snippet qml/referenceexamples/adding/person.h 0
+\snippet referenceexamples/adding/person.h 0
\section1 Define the Person class
-\snippet qml/referenceexamples/adding/person.cpp 0
+\snippet referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
@@ -78,33 +78,33 @@ properties in QML. This example adds a BirthdayParty type that specifies
a birthday party, consisting of a celebrant and a list of guests. People are
specified using the People QML type built in the previous example.
-\snippet qml/referenceexamples/properties/example.qml 0
+\snippet referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty
The BirthdayParty class is declared like this:
-\snippet qml/referenceexamples/properties/birthdayparty.h 0
-\snippet qml/referenceexamples/properties/birthdayparty.h 1
-\snippet qml/referenceexamples/properties/birthdayparty.h 2
-\snippet qml/referenceexamples/properties/birthdayparty.h 3
+\snippet referenceexamples/properties/birthdayparty.h 0
+\snippet referenceexamples/properties/birthdayparty.h 1
+\snippet referenceexamples/properties/birthdayparty.h 2
+\snippet referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a
QList<Person *> member.
In QML, the type of a list properties - and the guests property is a list of
-people - are all of type QDeclarativeListProperty<T>. QDeclarativeListProperty is simple value
+people - are all of type QQmlListProperty<T>. QQmlListProperty is simple value
type that contains a set of function pointers. QML calls these function
pointers whenever it needs to read from, write to or otherwise interact with
the list. In addition to concrete lists like the people list used in this
-example, the use of QDeclarativeListProperty allows for "virtual lists" and other advanced
+example, the use of QQmlListProperty allows for "virtual lists" and other advanced
scenarios.
\section2 Define the BirthdayParty
The implementation of BirthdayParty property accessors is straight forward.
-\snippet qml/referenceexamples/properties/birthdayparty.cpp 0
+\snippet referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example
@@ -128,11 +128,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
types of more than one type to a property. It specializes the Person type
developed in the previous examples into two types - a \c Boy and a \c Girl.
-\snippet qml/referenceexamples/coercion/example.qml 0
+\snippet referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl
-\snippet qml/referenceexamples/coercion/person.h 0
+\snippet referenceexamples/coercion/person.h 0
The Person class remains unaltered in this example and the Boy and Girl C++
classes are trivial extensions of it. As an example, the inheritance used here
@@ -147,7 +147,7 @@ previous example. However, as we have repurposed the People class as a common
base for Boy and Girl, we want to prevent it from being instantiated from QML
directly - an explicit Boy or Girl should be instantiated instead.
-\snippet qml/referenceexamples/coercion/main.cpp 0
+\snippet referenceexamples/coercion/main.cpp 0
While we want to disallow instantiating Person from within QML, it still needs
to be registered with the QML engine, so that it can be used as a property type
@@ -157,7 +157,7 @@ and other types can be coerced to it.
The implementation of Boy and Girl are trivial.
-\snippet qml/referenceexamples/coercion/person.cpp 1
+\snippet referenceexamples/coercion/person.cpp 1
All that is necessary is to implement the constructor, and to register the types
and their QML name with the QML engine.
@@ -167,7 +167,7 @@ and their QML name with the QML engine.
The BirthdayParty type has not changed since the previous example. The
celebrant and guests property still use the People type.
-\snippet qml/referenceexamples/coercion/birthdayparty.h 0
+\snippet referenceexamples/coercion/birthdayparty.h 0
However, as all three types, Person, Boy and Girl, have been registered with the
QML system, on assignment QML automatically (and type-safely) converts the Boy
@@ -194,14 +194,14 @@ The Default Property Example is a minor modification of the
\l {Extending QML - Inheritance and Coercion Example} that simplifies the
specification of a BirthdayParty through the use of a default property.
-\snippet qml/referenceexamples/default/example.qml 0
+\snippet referenceexamples/default/example.qml 0
\section1 Declaring the BirthdayParty class
The only difference between this example and the last, is the addition of the
\c DefaultProperty class info annotation.
-\snippet qml/referenceexamples/default/birthdayparty.h 0
+\snippet referenceexamples/default/birthdayparty.h 0
The default property specifies the property to assign to whenever an explicit
property is not specified, in the case of the BirthdayParty type the guest
diff --git a/examples/quick/tutorials/extending/chapter1-basics/app.qml b/examples/qml/tutorials/extending/chapter1-basics/app.qml
index d2f03daf83..d2f03daf83 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/app.qml
+++ b/examples/qml/tutorials/extending/chapter1-basics/app.qml
diff --git a/examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro
+++ b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
diff --git a/examples/quick/tutorials/extending/chapter1-basics/main.cpp b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/main.cpp
+++ b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter1-basics/piechart.cpp b/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp
index fa005781d8..fa005781d8 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter1-basics/piechart.h b/examples/qml/tutorials/extending/chapter1-basics/piechart.h
index a6272453ce..a6272453ce 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/piechart.h
+++ b/examples/qml/tutorials/extending/chapter1-basics/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter2-methods/app.qml b/examples/qml/tutorials/extending/chapter2-methods/app.qml
index 06ecb3a09d..06ecb3a09d 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/app.qml
+++ b/examples/qml/tutorials/extending/chapter2-methods/app.qml
diff --git a/examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro
+++ b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
diff --git a/examples/quick/tutorials/extending/chapter2-methods/main.cpp b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/main.cpp
+++ b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter2-methods/piechart.cpp b/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp
index ddcb1b3efd..ddcb1b3efd 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter2-methods/piechart.h b/examples/qml/tutorials/extending/chapter2-methods/piechart.h
index 86750197d2..86750197d2 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/piechart.h
+++ b/examples/qml/tutorials/extending/chapter2-methods/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/app.qml b/examples/qml/tutorials/extending/chapter3-bindings/app.qml
index afb9e25c51..afb9e25c51 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/app.qml
+++ b/examples/qml/tutorials/extending/chapter3-bindings/app.qml
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
+++ b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/main.cpp b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/main.cpp
+++ b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp
index a63035033f..a63035033f 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/piechart.h b/examples/qml/tutorials/extending/chapter3-bindings/piechart.h
index 25e82d66cc..25e82d66cc 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/piechart.h
+++ b/examples/qml/tutorials/extending/chapter3-bindings/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml
index 441b7f9b82..441b7f9b82 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
index 23eb222ea3..23eb222ea3 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
index 5b6e1cf451..5b6e1cf451 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
index c1e2996e83..c1e2996e83 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h
index 9f0ea47eb9..9f0ea47eb9 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
index 2afe82048f..2afe82048f 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
index 4eef9bb6d1..4eef9bb6d1 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/app.qml b/examples/qml/tutorials/extending/chapter5-listproperties/app.qml
index a57d1b833f..a57d1b833f 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/app.qml
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/app.qml
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
index 23eb222ea3..23eb222ea3 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/main.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
index f8826f6c31..f8826f6c31 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/main.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp
index 9fb61d9cd8..9fb61d9cd8 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.h b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h
index 55488f4900..55488f4900 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.h
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp
index 52b409aa22..52b409aa22 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h
index f324179481..f324179481 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir b/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir
index d9e8471b3c..d9e8471b3c 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir
+++ b/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/app.qml b/examples/qml/tutorials/extending/chapter6-plugins/app.qml
index 417fc6651a..417fc6651a 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/app.qml
+++ b/examples/qml/tutorials/extending/chapter6-plugins/app.qml
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 6bf44b4d15..6bf44b4d15 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index fea4c1aa85..fea4c1aa85 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h
index d768306967..d768306967 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp b/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp
index 295bb8961d..295bb8961d 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/piechart.h b/examples/qml/tutorials/extending/chapter6-plugins/piechart.h
index b37bcdd411..b37bcdd411 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/piechart.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp
index 52b409aa22..52b409aa22 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.h b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h
index 0b488b4835..0b488b4835 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h
diff --git a/examples/quick/tutorials/extending/extending.pro b/examples/qml/tutorials/extending/extending.pro
index 967473fda0..967473fda0 100644
--- a/examples/quick/tutorials/extending/extending.pro
+++ b/examples/qml/tutorials/extending/extending.pro
diff --git a/examples/quick/accessibility/doc/src/accessibility.qdoc b/examples/quick/accessibility/doc/src/accessibility.qdoc
index a637383324..0281ffff4e 100644
--- a/examples/quick/accessibility/doc/src/accessibility.qdoc
+++ b/examples/quick/accessibility/doc/src/accessibility.qdoc
@@ -33,8 +33,8 @@
Types in this example are augmented with meta-data for accessiblity systems.
For example, the button identifies itself and its functionality to the accessibility system:
- \snippet quick/accessibility/content/Button.qml button
+ \snippet accessibility/content/Button.qml button
As do Text types inside the example:
- \snippet quick/accessibility/accessibility.qml text
+ \snippet accessibility/accessibility.qml text
*/
diff --git a/examples/quick/animation/doc/src/animation.qdoc b/examples/quick/animation/doc/src/animation.qdoc
index 064717835d..734b1af118 100644
--- a/examples/quick/animation/doc/src/animation.qdoc
+++ b/examples/quick/animation/doc/src/animation.qdoc
@@ -36,37 +36,37 @@
a small QML file emphasizing a particular type or feature.
ColorAnimation demonstrates using a color animation to fade a sky from day to night.
- \snippet quick/animation/basics/color-animation.qml 0
+ \snippet animation/basics/color-animation.qml 0
PropertyAnimation demonstrates using a number animation to bounce a circle up and down.
- \snippet quick/animation/basics/property-animation.qml 0
+ \snippet animation/basics/property-animation.qml 0
Behaviors demonstrates using behaviors to animate moving a rectangle to whereever you click.
- \snippet quick/animation/behaviors/behavior-example.qml 0
+ \snippet animation/behaviors/behavior-example.qml 0
Wiggly Text demonstrates using more complex behaviors to animate and wiggle some text around as you drag it.
It does this by assigning a complex binding to each letter:
- \snippet quick/animation/behaviors/wigglytext.qml 0
+ \snippet animation/behaviors/wigglytext.qml 0
Then, it uses behaviors to animate the movement on each letter:
- \snippet quick/animation/behaviors/wigglytext.qml 1
+ \snippet animation/behaviors/wigglytext.qml 1
Tv Tennis demonstrates using more complex behaviors to get paddles following a ball for an infinite game.
Again a binding which depends on other values is applied to the position and a behavior provided the animation.
- \snippet quick/animation/behaviors/tvtennis.qml 0
+ \snippet animation/behaviors/tvtennis.qml 0
Easing Curves shows off all the easing curves available in Qt Quick animations.
States demonstrates how the properties of an item can vary between states.
It defines several states:
- \snippet quick/animation/states/states.qml 0
+ \snippet animation/states/states.qml 0
Note that there is also the implicit 'base state' from properties set directly on objects.
Transitions takes the States example and animates the property changes by setting transitions:
- \snippet quick/animation/states/transitions.qml 0
+ \snippet animation/states/transitions.qml 0
PathAnimation animates an image along a beizer curve using a PathAnimation.
- \snippet quick/animation/pathanimation/pathanimation.qml 0
+ \snippet animation/pathanimation/pathanimation.qml 0
PathInterpolator animates an image along the same beizer curve, using a PathInterpolator instead.
- \snippet quick/animation/pathinterpolator/pathinterpolator.qml 0
+ \snippet animation/pathinterpolator/pathinterpolator.qml 0
*/
diff --git a/examples/quick/canvas/doc/src/canvas.qdoc b/examples/quick/canvas/doc/src/canvas.qdoc
index 638d25d83f..f3eb78e1d1 100644
--- a/examples/quick/canvas/doc/src/canvas.qdoc
+++ b/examples/quick/canvas/doc/src/canvas.qdoc
@@ -36,12 +36,12 @@
a small QML file emphasizing a particular type or feature.
Red heart demonstrates using a bezierCurve API to stroke and fill a red heart.
- \snippet quick/canvas/bezierCurve/bezierCurve.qml 0
+ \snippet canvas/bezierCurve/bezierCurve.qml 0
Talk bubble demonstrates using a quadraticCurveTo API to stroke and fill a customized talk bubble:
- \snippet quick/canvas/quadraticCurveTo/quadraticCurveTo.qml 0
+ \snippet canvas/quadraticCurveTo/quadraticCurveTo.qml 0
This example also demonstrates the fillText API:
- \snippet quick/canvas/quadraticCurveTo/quadraticCurveTo.qml 1
+ \snippet canvas/quadraticCurveTo/quadraticCurveTo.qml 1
Squircle demonstrates using a collection of simple moveTo/lineTo path APIs to draw a smooth squircle.
@@ -50,9 +50,9 @@
Smile face demonstrates using several complex path APIs to draw an fill a smile face.
Clip demonstrates using clip API to clip a given image.
- \snippet quick/canvas/clip/clip.qml 0
+ \snippet canvas/clip/clip.qml 0
Tiger demonstrates using SVG path API to draw a tiger with a collection of SVG path strings.
- \snippet quick/canvas/tiger/tiger.qml 0
+ \snippet canvas/tiger/tiger.qml 0
*/
diff --git a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
index 0756d339ff..69e703cca7 100644
--- a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
+++ b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
@@ -116,13 +116,12 @@ Item {
if (canvas.stroke)
ctx.stroke();
- ctx.restore();
-
// ![1]
ctx.fillStyle = "white";
ctx.font = "Bold 17px";
- ctx.fillText("Qt Quick", 110, 140);
+ ctx.fillText("Qt Quick", 40, 70);
// ![1]
+ ctx.restore();
}
}
}
diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
index be37a5936d..4f0818ac71 100644
--- a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
+++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
@@ -42,7 +42,7 @@
#include <QStyleHints>
#include <QGuiApplication>
-
+#include <qqmlfile.h>
MaskedMouseArea::MaskedMouseArea(QQuickItem *parent)
: QQuickItem(parent),
@@ -74,7 +74,7 @@ void MaskedMouseArea::setMaskSource(const QUrl &source)
{
if (m_maskSource != source) {
m_maskSource = source;
- m_maskImage = QImage(source.toLocalFile());
+ m_maskImage = QImage(QQmlFile::urlToLocalFileOrQrc(source));
emit maskSourceChanged();
}
}
diff --git a/examples/quick/customitems/painteditem/painteditem.pro b/examples/quick/customitems/painteditem/painteditem.pro
index 77e4d146e1..3ec6420abf 100644
--- a/examples/quick/customitems/painteditem/painteditem.pro
+++ b/examples/quick/customitems/painteditem/painteditem.pro
@@ -18,3 +18,6 @@ qmldir.files = TextBalloonPlugin/qmldir
qmldir.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/painteditem/TextBalloonPlugin
INSTALLS += qmldir target
+
+OTHER_FILES += \
+ textballoons.qml
diff --git a/examples/quick/demos/calqlatr/calqlatr.pro b/examples/quick/demos/calqlatr/calqlatr.pro
index 1b002a5f27..91d52a293e 100644
--- a/examples/quick/demos/calqlatr/calqlatr.pro
+++ b/examples/quick/demos/calqlatr/calqlatr.pro
@@ -6,5 +6,24 @@ SOURCES += main.cpp
RESOURCES += calqlatr.qrc \
../../shared/shared.qrc
+OTHER_FILES = calqlatr.qml \
+ content/Button.qml \
+ content/Display.qml \
+ content/NumberPad.qml \
+ content/StyleLabel.qml \
+ content/audio/touch.wav \
+ content/calculator.js \
+ content/images/icon-back.png \
+ content/images/icon-close.png \
+ content/images/icon-settings.png \
+ content/images/logo.png \
+ content/images/paper-edge-left.png \
+ content/images/paper-edge-right.png \
+ content/images/paper-grip.png \
+ content/images/settings-selected-a.png \
+ content/images/settings-selected-b.png \
+ content/images/touch-green.png \
+ content/images/touch-white.png
+
target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/calqlatr
INSTALLS += target
diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml
index 16b2e19724..0a092c25da 100644
--- a/examples/quick/demos/calqlatr/calqlatr.qml
+++ b/examples/quick/demos/calqlatr/calqlatr.qml
@@ -57,7 +57,7 @@ Rectangle {
Item {
id: pad
- width: window.width * 0.58
+ width: 180
NumberPad { y: 10; anchors.horizontalCenter: parent.horizontalCenter }
}
@@ -77,7 +77,7 @@ Rectangle {
Display {
id: display
x: -16
- width: window.width * 0.42
+ width: window.width - pad.width
height: parent.height
MouseArea {
@@ -85,7 +85,12 @@ Rectangle {
property real oldP: 0
property bool rewind: false
- anchors.fill: parent
+ anchors {
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+ height: 50
onPositionChanged: {
var reverse = startX > window.width / 2
var mx = mapToItem(window, mouse.x).x
diff --git a/examples/quick/demos/calqlatr/content/Display.qml b/examples/quick/demos/calqlatr/content/Display.qml
index 4a78a3ebcd..ec8edfea66 100644
--- a/examples/quick/demos/calqlatr/content/Display.qml
+++ b/examples/quick/demos/calqlatr/content/Display.qml
@@ -42,23 +42,38 @@ import QtQuick 2.0
Item {
id: display
+ property bool enteringDigits: false
function displayOperator(operator)
{
listView.model.append({ "operator": operator, "operand": "" })
+ enteringDigits = true
}
function newLine(operator, operand)
{
listView.model.append({ "operator": operator, "operand": operand })
+ enteringDigits = false
+ listView.positionViewAtEnd()
}
function appendDigit(digit)
{
- if (!listView.model.count)
+ if (!enteringDigits)
listView.model.append({ "operator": "", "operand": "" })
var i = listView.model.count - 1;
listView.model.get(i).operand = listView.model.get(i).operand + digit;
+ enteringDigits = true
+ }
+
+ function clear()
+ {
+ if (enteringDigits) {
+ var i = listView.model.count - 1
+ if (i >= 0)
+ listView.model.remove(i)
+ enteringDigits = false
+ }
}
Item {
@@ -87,6 +102,7 @@ Item {
}
Image {
+ id: grip
source: "images/paper-grip.png"
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
@@ -97,7 +113,7 @@ Item {
id: listView
x: 16; y: 30
width: display.width
- height: display.height
+ height: display.height - 50 - y
delegate: Item {
height: 20
width: parent.width
diff --git a/examples/quick/demos/calqlatr/content/NumberPad.qml b/examples/quick/demos/calqlatr/content/NumberPad.qml
index 3203e18431..c7f2680651 100644
--- a/examples/quick/demos/calqlatr/content/NumberPad.qml
+++ b/examples/quick/demos/calqlatr/content/NumberPad.qml
@@ -60,7 +60,7 @@ Grid {
Button { text: "±"; color: "#6da43d"; operator: true }
Button { text: "−"; color: "#6da43d"; operator: true }
Button { text: "+"; color: "#6da43d"; operator: true }
- Button { text: " "; color: "#6da43d"; operator: true }
+ Button { text: "√"; color: "#6da43d"; operator: true }
Button { text: "÷"; color: "#6da43d"; operator: true }
Button { text: "×"; color: "#6da43d"; operator: true }
Button { text: "C"; color: "#6da43d"; operator: true }
diff --git a/examples/quick/demos/calqlatr/content/calculator.js b/examples/quick/demos/calqlatr/content/calculator.js
index d86fecbf39..da8e940b16 100644
--- a/examples/quick/demos/calqlatr/content/calculator.js
+++ b/examples/quick/demos/calqlatr/content/calculator.js
@@ -84,7 +84,7 @@ function operatorPressed(op)
} else if (previousOperator == "×") {
digits = Number(curVal) * Number(digits.valueOf())
} else if (previousOperator == "÷") {
- digits = Number(Number(curVal) / Number(digits.valueOf())).toString()
+ digits = Number(curVal) / Number(digits.valueOf())
} else if (previousOperator == "=") {
}
@@ -110,9 +110,9 @@ function operatorPressed(op)
digits = (Math.abs(digits.valueOf())).toString()
} else if (op == "Int") {
digits = (Math.floor(digits.valueOf())).toString()
- } else if (op == window.plusminus) {
+ } else if (op == "±") {
digits = (digits.valueOf() * -1).toString()
- } else if (op == window.squareRoot) {
+ } else if (op == "√") {
digits = (Math.sqrt(digits.valueOf())).toString()
} else if (op == "mc") {
memory = 0;
@@ -130,7 +130,7 @@ function operatorPressed(op)
} else if (op == "Off") {
Qt.quit();
} else if (op == "C") {
- digits = "0"
+ display.clear()
} else if (op == "AC") {
curVal = 0
memory = 0
diff --git a/examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
index af67f63dd1..af67f63dd1 100644
--- a/examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png
+++ b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
Binary files differ
diff --git a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
index 60a9725e53..7217c7d806 100644
--- a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
+++ b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
@@ -26,13 +26,11 @@
****************************************************************************/
/*!
- \title QML Demo - Calqlatr
+ \title Qt Quick Demo - Calqlatr
+ \ingroup qtquickdemos
\example demos/calqlatr
- \brief This is an example calculator written in QML.
- \image qml-calqlatr-demo-small.png
- \ingroup qmldemos
-
- This demo implements a simple calculator app, designed for portrait devices.
+ \brief A simple calculator app, designed for portrait devices.
+ \image qtquick-demo-calqlatr.png
This app has the logic implemented in Javascipt and the appearance implemented in QML.
*/
diff --git a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
new file mode 100644
index 0000000000..94b641d891
--- /dev/null
+++ b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
Binary files differ
diff --git a/examples/quick/demos/clocks/doc/src/clocks.qdoc b/examples/quick/demos/clocks/doc/src/clocks.qdoc
new file mode 100644
index 0000000000..b34f844cc6
--- /dev/null
+++ b/examples/quick/demos/clocks/doc/src/clocks.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Clocks
+ \ingroup qtquickdemos
+ \example demos/clocks
+ \brief An app that shows the current time in different cities.
+ \image qtquick-demo-clocks-small.png
+*/
+
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
new file mode 100644
index 0000000000..6d41179c23
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
new file mode 100644
index 0000000000..c8f37486f6
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/src/maroon.qdoc b/examples/quick/demos/maroon/doc/src/maroon.qdoc
new file mode 100644
index 0000000000..c18b6bc874
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/src/maroon.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Maroon in Trouble
+ \ingroup qtquickdemos
+ \example demos/maroon
+ \brief A cute game designed for touchscreens.
+ \image qtquick-demo-maroon-med-1.png
+ \image qtquick-demo-maroon-med-2.png
+*/
+
diff --git a/examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
index a0cd823999..a0cd823999 100644
--- a/examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png
+++ b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
Binary files differ
diff --git a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
index 343acce14a..48f8e8a14b 100644
--- a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
+++ b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \title QML Demo - Photo Surface
+ \title Qt Quick Demo - Photo Surface
+ \ingroup qtquickdemos
\example demos/photosurface
- \brief This is the typical touch photo-shuffling example written in QML.
- \image qml-photosurface-example-small.png
- \ingroup qtquickexamples
+ \brief A touch-based app for shuffling photos around a virtual surface.
+ \image qtquick-demo-photosurface-small.png
This example demonstrates how to handle dragging, rotation and
pinch zooming within the same item using a PinchArea containing a MouseArea.
diff --git a/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
new file mode 100644
index 0000000000..d872310a3e
--- /dev/null
+++ b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
Binary files differ
diff --git a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
new file mode 100644
index 0000000000..b0f1368a1c
--- /dev/null
+++ b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Photo Viewer
+ \ingroup qtquickdemos
+ \example demos/photoviewer
+ \brief An online photo viewer that displays Flickr feeds.
+ \image qtquick-demo-photoviewer-small.png
+*/
+
diff --git a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
new file mode 100644
index 0000000000..0ad6c02251
--- /dev/null
+++ b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
Binary files differ
diff --git a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
new file mode 100644
index 0000000000..019b54d609
--- /dev/null
+++ b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - RSS News
+ \ingroup qtquickdemos
+ \example demos/rssnews
+ \brief An RSS news reader.
+ \image qtquick-demo-rssnews-small.png
+*/
+
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
new file mode 100644
index 0000000000..cce9f11017
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
new file mode 100644
index 0000000000..ca9e8368b1
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/src/samegame.qdoc b/examples/quick/demos/samegame/doc/src/samegame.qdoc
new file mode 100644
index 0000000000..70042d73f0
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/src/samegame.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Same Game
+ \ingroup qtquickdemos
+ \example demos/samegame
+ \brief A QML implementation of the popular puzzle game by Kuniaki Moribe.
+ \image qtquick-demo-samegame-med-1.png
+ \image qtquick-demo-samegame-med-2.png
+*/
+
diff --git a/examples/quick/demos/stocqt/content/CheckBox.qml b/examples/quick/demos/stocqt/content/CheckBox.qml
index 9c429d65dc..1e7dcf7c74 100644
--- a/examples/quick/demos/stocqt/content/CheckBox.qml
+++ b/examples/quick/demos/stocqt/content/CheckBox.qml
@@ -40,13 +40,12 @@
import QtQuick 2.0
-Row {
+Item {
id: button
property alias text: txt.text
property bool buttonEnabled: true
width: 140
height: 25
- spacing: 5
x: 5
MouseArea {
id: mouse
@@ -75,14 +74,14 @@ Row {
radius: 1
color: mouse.pressed || buttonEnabled ? "#76644A" : "transparent"
}
- Text {
- id: txt
- anchors.left: checkbox.right
- anchors.leftMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- text: "Close "
- color: "#ecc089"
- font.pixelSize: 18
- }
+ }
+ Text {
+ id: txt
+ anchors.left: checkbox.right
+ anchors.leftMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Close "
+ color: "#ecc089"
+ font.pixelSize: 18
}
}
diff --git a/examples/quick/demos/stocqt/content/StockSettings.qml b/examples/quick/demos/stocqt/content/StockSettings.qml
index 5978a3b6a0..07152410fa 100644
--- a/examples/quick/demos/stocqt/content/StockSettings.qml
+++ b/examples/quick/demos/stocqt/content/StockSettings.qml
@@ -88,7 +88,6 @@ Rectangle {
anchors.leftMargin: 30
anchors.top: startDateText.bottom
anchors.topMargin: 8
- date: new Date(1995, 3, 25)
}
Text {
@@ -212,4 +211,6 @@ Rectangle {
onClicked: root.chartType = "all"
}
}
+
+ Component.onCompleted: startDatePicker.date = new Date(1995, 3, 25)
}
diff --git a/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png b/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png
new file mode 100644
index 0000000000..1783881e1f
--- /dev/null
+++ b/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png
Binary files differ
diff --git a/examples/quick/demos/stocqt/doc/src/stocqt.qdoc b/examples/quick/demos/stocqt/doc/src/stocqt.qdoc
new file mode 100644
index 0000000000..7001bfb395
--- /dev/null
+++ b/examples/quick/demos/stocqt/doc/src/stocqt.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - StocQt
+ \ingroup qtquickdemos
+ \example demos/stocqt
+ \brief A configurable stock chart for the NASDAQ-100.
+ \image qtquick-demo-stocqt.png
+*/
+
diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png
new file mode 100644
index 0000000000..930ee39929
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png
new file mode 100644
index 0000000000..9eff191a47
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
new file mode 100644
index 0000000000..9ba252fcb5
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Tweet Search
+ \ingroup qtquickdemos
+ \example demos/tweetsearch
+ \brief A Twitter search client with 3D effects.
+ \image qtquick-demo-tweetsearch-med-1.png
+ \image qtquick-demo-tweetsearch-med-2.png
+*/
+
diff --git a/examples/quick/dialogs/ColorDialogs.qml b/examples/quick/dialogs/ColorDialogs.qml
index 7817c8edf8..6a0af7f730 100644
--- a/examples/quick/dialogs/ColorDialogs.qml
+++ b/examples/quick/dialogs/ColorDialogs.qml
@@ -46,9 +46,10 @@ Rectangle {
width: 320
height: 200
color: palette.window
-
SystemPalette { id: palette }
+ clip: true
+ //! [colordialog]
ColorDialog {
id: colorDialog
visible: colorDialogVisible.checked
@@ -59,10 +60,11 @@ Rectangle {
onAccepted: { console.log("Accepted: " + color) }
onRejected: { console.log("Rejected") }
}
+ //! [colordialog]
Column {
anchors.fill: parent
- anchors.margins: 8
+ anchors.margins: 12
spacing: 8
Text {
font.bold: true
@@ -106,4 +108,38 @@ Rectangle {
}
}
}
+
+ Rectangle {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: 50
+ color: Qt.darker(palette.window, 1.1)
+ border.color: Qt.darker(palette.window, 1.3)
+ Row {
+ spacing: 6
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 12
+ height: parent.height - 6
+ width: parent.width
+ Button {
+ text: "Open"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.open()
+ }
+ Button {
+ text: "Close"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.close()
+ }
+ Button {
+ text: "set to green"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.color = "green"
+ }
+ }
+ }
}
diff --git a/examples/quick/dialogs/FileDialogs.qml b/examples/quick/dialogs/FileDialogs.qml
index a6df29bb37..d1278609f9 100644
--- a/examples/quick/dialogs/FileDialogs.qml
+++ b/examples/quick/dialogs/FileDialogs.qml
@@ -43,44 +43,13 @@ import QtQuick.Dialogs 1.0
import "../shared"
Rectangle {
-
width: 580
- height: 360
+ height: 400
color: palette.window
SystemPalette { id: palette }
+ clip: true
- Rectangle {
- id: toolbar
- width: parent.width
- height: 40
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 8
- height: parent.height - 6
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.close()
- }
- Button {
- text: "/tmp"
- anchors.verticalCenter: parent.verticalCenter
- // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
- onClicked: fileDialog.folder = "/tmp"
- }
- }
- }
-
+ //! [filedialog]
FileDialog {
id: fileDialog
visible: fileDialogVisible.checked
@@ -95,12 +64,11 @@ Rectangle {
onAccepted: { console.log("Accepted: " + fileUrls) }
onRejected: { console.log("Rejected") }
}
+ //! [filedialog]
Column {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: toolbar.bottom
- anchors.margins: 8
+ anchors.fill: parent
+ anchors.margins: 12
spacing: 8
Text {
color: palette.windowText
@@ -163,4 +131,39 @@ Rectangle {
wrapMode: Text.Wrap
}
}
+
+ Rectangle {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: 50
+ color: Qt.darker(palette.window, 1.1)
+ border.color: Qt.darker(palette.window, 1.3)
+ Row {
+ spacing: 6
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 12
+ height: parent.height - 6
+ width: parent.width
+ Button {
+ text: "Open"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: fileDialog.open()
+ }
+ Button {
+ text: "Close"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: fileDialog.close()
+ }
+ Button {
+ text: "go to /tmp"
+ anchors.verticalCenter: parent.verticalCenter
+ // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
+ onClicked: fileDialog.folder = "/tmp"
+ }
+ }
+ }
}
diff --git a/examples/quick/dialogs/dialogs.pro b/examples/quick/dialogs/dialogs.pro
new file mode 100644
index 0000000000..b76f396e9d
--- /dev/null
+++ b/examples/quick/dialogs/dialogs.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+
+QT += quick qml
+SOURCES += main.cpp
+RESOURCES += dialogs.qrc ../shared/shared.qrc
+
+OTHER_FILES += \
+ dialogs.qml \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+EXAMPLE_FILES = \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/dialogs
+INSTALLS += target
diff --git a/examples/quick/window/window/Window.qml b/examples/quick/dialogs/dialogs.qml
index 07900930d3..b5f9841a3f 100644
--- a/examples/quick/window/window/Window.qml
+++ b/examples/quick/dialogs/dialogs.qml
@@ -39,20 +39,21 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0
+import "../shared"
-Window {
- width: 640
- height: 480
- visible: true //It's false by default
- property Component self
- Component.onCompleted: self = Qt.createComponent("Window.qml")
- Text{
- text: "Hello World!"
- anchors.centerIn: parent
+TabSet {
+ width: 580
+ height: 440
+
+ FileDialogs {
+ property string title: "File Dialog"
+ anchors.fill: parent
+ color: "#e3e3e3" // to match tab.png
}
- MouseArea{
+
+ ColorDialogs {
+ property string title: "Color Dialog"
anchors.fill: parent
- onClicked: self.createObject();
+ color: "#e3e3e3" // to match tab.png
}
}
diff --git a/examples/quick/dialogs/dialogs.qrc b/examples/quick/dialogs/dialogs.qrc
new file mode 100644
index 0000000000..efebfe4845
--- /dev/null
+++ b/examples/quick/dialogs/dialogs.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/dialogs">
+ <file>dialogs.qml</file>
+ <file>FileDialogs.qml</file>
+ <file>ColorDialogs.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/dialogs/doc/images/dialogs-example.jpg b/examples/quick/dialogs/doc/images/dialogs-example.jpg
new file mode 100644
index 0000000000..4517a39308
--- /dev/null
+++ b/examples/quick/dialogs/doc/images/dialogs-example.jpg
Binary files differ
diff --git a/examples/quick/dialogs/doc/src/dialogs.qdoc b/examples/quick/dialogs/doc/src/dialogs.qdoc
new file mode 100644
index 0000000000..daac914c60
--- /dev/null
+++ b/examples/quick/dialogs/doc/src/dialogs.qdoc
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \title Qt Quick Dialog Examples
+ \example dialogs
+ \brief This example demonstrates the dialog types in QML
+ \image dialogs-example.jpg
+ \ingroup qtquickdialog_examples
+
+ This example demonstrates the system dialogs in the \l{Qt Quick Dialogs}
+ module. The appearance and behavior is platform-dependent.
+
+ A \l FileDialog is used to choose a single file, multiple files or a
+ single directory, depending on how it is configured.
+ \snippet dialogs/FileDialogs.qml filedialog
+
+ A \l ColorDialog is used to choose a color, with or without alpha (transparency)
+ depending on how it is configured.
+ \snippet dialogs/ColorDialogs.qml colordialog
+*/
diff --git a/examples/quick/dialogs/main.cpp b/examples/quick/dialogs/main.cpp
new file mode 100644
index 0000000000..bbf0c48104
--- /dev/null
+++ b/examples/quick/dialogs/main.cpp
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "../shared/shared.h"
+DECLARATIVE_EXAMPLE_MAIN(dialogs/dialogs)
diff --git a/examples/quick/draganddrop/doc/src/draganddrop.qdoc b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
index 381fdd1299..2c62e271e6 100644
--- a/examples/quick/draganddrop/doc/src/draganddrop.qdoc
+++ b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
@@ -37,12 +37,12 @@
It has a DragTile component which uses a MouseArea to move an item when dragged:
- \snippet quick/draganddrop/tiles/DragTile.qml 0
- \snippet quick/draganddrop/tiles/DragTile.qml 1
+ \snippet draganddrop/tiles/DragTile.qml 0
+ \snippet draganddrop/tiles/DragTile.qml 1
And a DropTile component which the dragged tiles can be dropped onto:
- \snippet quick/draganddrop/tiles/DropTile.qml 0
+ \snippet draganddrop/tiles/DropTile.qml 0
The keys property of the DropArea will only allow an item with matching key in
it's Drag.keys property to be dropped on it.
@@ -52,7 +52,7 @@
It uses a DelegateModel to move a delegate item to the position of another item
it is dragged over.
- \snippet quick/draganddrop/views/gridview.qml 0
- \snippet quick/draganddrop/views/gridview.qml 1
+ \snippet draganddrop/views/gridview.qml 0
+ \snippet draganddrop/views/gridview.qml 1
*/
diff --git a/examples/quick/imageelements/doc/src/imageelements.qdoc b/examples/quick/imageelements/doc/src/imageelements.qdoc
index 5abcece4fc..d88201faf9 100644
--- a/examples/quick/imageelements/doc/src/imageelements.qdoc
+++ b/examples/quick/imageelements/doc/src/imageelements.qdoc
@@ -25,7 +25,7 @@
**
****************************************************************************/
/*!
- \title QML Examples - Image Elements
+ \title Qt Quick Examples - Image Elements
\example imageelements
\brief This is a collection of QML examples relating to image types.
\image qml-imageelements-example.png
@@ -40,20 +40,20 @@
'Shadows' shows how to create a drop shadow effect for a rectangular item
using a BorderImage:
- \snippet quick/imageelements/content/ShadowRectangle.qml shadow
+ \snippet imageelements/content/ShadowRectangle.qml shadow
'AnimatedSprite' shows how to display a simple animation using an
AnimatedSprite object:
- \snippet quick/imageelements/animatedsprite.qml sprite
+ \snippet imageelements/animatedsprite.qml sprite
The sprite animation will loop 3 times.
'SpriteSequence' demonstrates using a sprite sequence to draw an animated
and interactive bear.
The SpriteSequence defines 5 different sprites. The bear is initially in
a 'still' state:
- \snippet quick/imageelements/spritesequence.qml still
+ \snippet imageelements/spritesequence.qml still
When the scene is clicked, an animation sets the sprite sequence to the
'falling' states and animates the bear's y property.
- \snippet quick/imageelements/spritesequence.qml animation
+ \snippet imageelements/spritesequence.qml animation
At the end of the animation the bear is set back to its initial state.
*/
diff --git a/examples/quick/mousearea/doc/src/mousearea.qdoc b/examples/quick/mousearea/doc/src/mousearea.qdoc
index b0d9abce8f..091be69e5d 100644
--- a/examples/quick/mousearea/doc/src/mousearea.qdoc
+++ b/examples/quick/mousearea/doc/src/mousearea.qdoc
@@ -37,10 +37,10 @@
of that click which are available to QML.
Signals are emitted by the MouseArea when clicks or other discrete operations occur within it
- \snippet quick/mousearea/mousearea.qml clicks
+ \snippet mousearea/mousearea.qml clicks
The MouseArea can also be used to drag items around. By setting the parameters of the drag property,
the target item will be dragged around if the user starts to drag within the MouseArea.
- \snippet quick/mousearea/mousearea.qml drag
+ \snippet mousearea/mousearea.qml drag
*/
diff --git a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
index d4aabc01d8..7869383ca2 100644
--- a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
+++ b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
@@ -27,7 +27,7 @@
/*!
- \title Scenegraph Painted Item Example
+ \title Scene Graph - Painted Item
\brief Shows how to implement QPainter-based custom scenegraph items.
\example customitems/painteditem
\ingroup qtquickexamples
@@ -43,12 +43,12 @@
The example consists of an item class, a plugin class and a QML file
to use this plugin. The \c TextBalloon class represents the individual
text balloons extending QQuickPaintedItem, the \c TextBalloonPlugin class
- represents the skeleton code for a QtQuick plugin and the
+ represents the skeleton code for a \l {Qt Quick} plugin and the
\c textballoons.qml file is used to load the plugin and display the text
balloons.
We will focus on the \c TextBalloon class first and continue with the
- \c textballoons.qml file. For an example on how to implement a QtQuick
+ \c textballoons.qml file. For an example on how to implement a \l {Qt Quick}
plugin please look at \l{declarative/tutorials/extending/chapter6-plugins}
{Writing an Extension Plugin}
@@ -58,7 +58,7 @@
is the base class for all QPainter based items in the QML Scene Graph
framework.
- \snippet quick/customitems/painteditem/textballoon.h 0
+ \snippet customitems/painteditem/textballoon.h 0
To implement a QQuickPaintedItem you must implement QQuickPaintedIem's pure
virtual function \l {QQuickPaintedItem::}{paint()} which implements the
@@ -69,13 +69,13 @@
We have to be sure to initialize the rightAligned property for a
TextBalloon item.
- \snippet quick/customitems/painteditem/textballoon.cpp 0
+ \snippet customitems/painteditem/textballoon.cpp 0
Then we implement the \c paint() function which is automatically called by
- the Scenegraph framework to paint the contents of the item. The function
+ the Scene Graph framework to paint the contents of the item. The function
paints the item in local coordinates.
- \snippet quick/customitems/painteditem/textballoon.cpp 1
+ \snippet customitems/painteditem/textballoon.cpp 1
We start with setting the pen and brush on the item to define the look of
the item. After that we start drawing. Note that the \l {QQuickPaintedItem::}{boundingRect()}
@@ -90,7 +90,7 @@
\section2 BalloonView
- \snippet quick/customitems/painteditem/textballoons.qml 0
+ \snippet customitems/painteditem/textballoons.qml 0
The balloonModel contains two types at application start which will be
displayed by the balloonView. The balloonView alernates the TextBalloon
@@ -98,7 +98,7 @@
\section2 Controls
- \snippet quick/customitems/painteditem/textballoons.qml 1
+ \snippet customitems/painteditem/textballoons.qml 1
The controls part of the UI contains a rectangle with a MouseArea which
changes color when the mouse hovers over it. This control 'button' adds
diff --git a/examples/quick/particles/affectors/content/attractor.qml b/examples/quick/particles/affectors/content/attractor.qml
index fd7fd65b9c..349132e61a 100644
--- a/examples/quick/particles/affectors/content/attractor.qml
+++ b/examples/quick/particles/affectors/content/attractor.qml
@@ -77,7 +77,7 @@ Rectangle {
ImageParticle {
id: stars
groups: ["stars"]
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color: "white"
colorVariation: 0.1
alpha: 0
@@ -96,7 +96,7 @@ Rectangle {
ImageParticle {
id: shot
groups: ["shot"]
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color: "#0FF06600"
colorVariation: 0.3
@@ -104,7 +104,7 @@ Rectangle {
ImageParticle {
id: engine
groups: ["engine"]
- source: "../../images/particle4.png"
+ source: "qrc:///particleresources/fuzzydot.png"
color: "orange"
SequentialAnimation on color {
diff --git a/examples/quick/particles/affectors/content/groupgoal.qml b/examples/quick/particles/affectors/content/groupgoal.qml
index 19fa041288..cf4361eb94 100644
--- a/examples/quick/particles/affectors/content/groupgoal.qml
+++ b/examples/quick/particles/affectors/content/groupgoal.qml
@@ -124,7 +124,7 @@ Rectangle {
id: smoke
anchors.fill: parent
groups: ["smoke"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorVariation: 0
color: "#00111111"
}
@@ -132,7 +132,7 @@ Rectangle {
id: pilot
anchors.fill: parent
groups: ["pilot"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
redVariation: 0.01
blueVariation: 0.4
color: "#0010004f"
diff --git a/examples/quick/particles/affectors/content/move.qml b/examples/quick/particles/affectors/content/move.qml
index b4d83318b0..e90f8c685c 100644
--- a/examples/quick/particles/affectors/content/move.qml
+++ b/examples/quick/particles/affectors/content/move.qml
@@ -50,7 +50,7 @@ Rectangle {
ImageParticle {
groups: ["A"]
anchors.fill: parent
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color:"#FF1010"
redVariation: 0.8
}
@@ -80,7 +80,7 @@ Rectangle {
ImageParticle {
groups: ["B"]
anchors.fill: parent
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color:"#10FF10"
greenVariation: 0.8
}
@@ -112,7 +112,7 @@ Rectangle {
ImageParticle {
groups: ["C"]
anchors.fill: parent
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color:"#1010FF"
blueVariation: 0.8
}
diff --git a/examples/quick/particles/affectors/content/spritegoal.qml b/examples/quick/particles/affectors/content/spritegoal.qml
index 78b161f25b..ab108bb065 100644
--- a/examples/quick/particles/affectors/content/spritegoal.qml
+++ b/examples/quick/particles/affectors/content/spritegoal.qml
@@ -66,7 +66,7 @@ Item {
ImageParticle {
system: sys
groups: ["starfield"]
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
colorVariation: 0.3
color: "white"
}
@@ -170,7 +170,7 @@ Item {
z:0
system: sys
groups: ["exhaust"]
- source: "../../images/particle4.png"
+ source: "qrc:///particleresources/fuzzydot.png"
color: "orange"
SequentialAnimation on color {
diff --git a/examples/quick/particles/affectors/content/turbulence.qml b/examples/quick/particles/affectors/content/turbulence.qml
index d7a86039b4..eacedbe153 100644
--- a/examples/quick/particles/affectors/content/turbulence.qml
+++ b/examples/quick/particles/affectors/content/turbulence.qml
@@ -75,13 +75,13 @@ Rectangle {
ImageParticle {
groups: ["smoke"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
color: "#11111111"
colorVariation: 0
}
ImageParticle {
groups: ["flame"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
color: "#11ff400f"
colorVariation: 0.1
}
diff --git a/examples/quick/particles/affectors/doc/src/affectors.qdoc b/examples/quick/particles/affectors/doc/src/affectors.qdoc
index 58661d5b70..a1407abda2 100644
--- a/examples/quick/particles/affectors/doc/src/affectors.qdoc
+++ b/examples/quick/particles/affectors/doc/src/affectors.qdoc
@@ -35,7 +35,7 @@
Each example is a small QML file emphasizing a particular type or feature.
Age demonstrates using an Age affector to prematurely end the lives of particles.
- \snippet quick/particles/affectors/content/age.qml 0
+ \snippet particles/affectors/content/age.qml 0
As you move the affector around the screen, the particles inside it
(which haven't already been affected) jump to a period near the end
@@ -44,7 +44,7 @@
the end of their life instantly.
Attractor demonstrates using an Attractor affector to simulate a black hole
- \snippet quick/particles/affectors/content/attractor.qml 0
+ \snippet particles/affectors/content/attractor.qml 0
All particles in the scene, including the rocket ship's exhaust and pellets, are pulled
towards the black hole. This effect is stronger closer to the black hole, so the
@@ -55,58 +55,58 @@
Custom Affector manipulates the properties of the particles directly in javascript.
One Affector is used to make the leaves rock back and forth as they fall, looking more
leaf-like than just spinning in circles:
- \snippet quick/particles/affectors/content/customaffector.qml 0
+ \snippet particles/affectors/content/customaffector.qml 0
Another is used to provide a slightly varying friction to the leaves as they 'land',
to look more natural:
- \snippet quick/particles/affectors/content/customaffector.qml 1
+ \snippet particles/affectors/content/customaffector.qml 1
Friction is similar to the falling leaves in the custom affector, except that it uses a
flat friction the whole way down instead of custom affectors.
- \snippet quick/particles/affectors/content/friction.qml 0
+ \snippet particles/affectors/content/friction.qml 0
Gravity is a convenience affector for applying a constant acceleration to particles inside it
- \snippet quick/particles/affectors/content/gravity.qml 0
+ \snippet particles/affectors/content/gravity.qml 0
GroupGoal sets up two particle groups for flaming and non-flaming balls, and gives you various
ways to transition between them.
- \snippet quick/particles/affectors/content/groupgoal.qml unlit
+ \snippet particles/affectors/content/groupgoal.qml unlit
The non-flaming balls have a one in a hundred chance of lighting on their own each second, but they also
have a GroupGoal set on the whole group. This affector affects all particles of the unlit group, when colliding
with particles in the lit group, and cause them to move to the lighting group.
- \snippet quick/particles/affectors/content/groupgoal.qml lighting
+ \snippet particles/affectors/content/groupgoal.qml lighting
lighting is an intermediate group so that the glow builds up and the transition is less jarring. So it automatically
moves into the lit group after 100ms.
- \snippet quick/particles/affectors/content/groupgoal.qml lit
+ \snippet particles/affectors/content/groupgoal.qml lit
The lit group also has TrailEmitters on it for additional fire and smoke, but does not transition anywhere.
There are two more GroupGoal objects that allow particles in the unlit group to transition to the lighting group
(and then to the lit group).
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-pilot
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-pilot
The first is just an area bound to the location of an image of a pilot flame. When unlit balls pass through the flame,
they go straight to lit because the pilot flame is so hot.
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-ma
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-ma
The second is bound to the location of the last pointer interaction, so that touching or clicking on unlit balls (which
is hard due to their constant movement) causes them to move to the lighting group.
Move shows some simple effects you can get by altering trajectory midway.
The red particles have an affector that affects their position, jumping them forwards by 120px.
- \snippet quick/particles/affectors/content/move.qml A
+ \snippet particles/affectors/content/move.qml A
The green particles have an affector that affects their velocity, but with some angle variation. By adding some random direction
velocity to their existing forwards velocity, they begin to spray off in a cone.
- \snippet quick/particles/affectors/content/move.qml B
+ \snippet particles/affectors/content/move.qml B
The blue particles have an affector that affects their acceleration, and because it sets relative to false this resets the acceleration instead of
adding to it. Once the blue particles reach the affector, their horizontal velocity stops increasing as their vertical velocity decreases.
- \snippet quick/particles/affectors/content/move.qml C
+ \snippet particles/affectors/content/move.qml C
SpriteGoal has an affector which interacts with the sprite engine of particles, if they are being drawn as sprites by ImageParticle.
- \snippet quick/particles/affectors/content/spritegoal.qml 0
+ \snippet particles/affectors/content/spritegoal.qml 0
The SpriteGoal follows the image of the rocket ship on screen, and when it interacts with particles drawn by ImageParticle as sprites,
it instructs them to move immediately to the "explode" state, which in this case is the animation of the asteroid breaking into many pieces.
Turbulence has a flame with smoke, and both sets of particles being affected by a Turbulence affector. This gives a faint wind effect.
- \snippet quick/particles/affectors/content/turbulence.qml 0
+ \snippet particles/affectors/content/turbulence.qml 0
To make the wind change direction, subsitute a black and white noise image in the noiseSource parameter (it currently uses a default noise source).
Wander uses a Wander affector to add some horizontal drift to snowflakes as they fall down.
- \snippet quick/particles/affectors/content/wander.qml 0
+ \snippet particles/affectors/content/wander.qml 0
There are different movements given by applying the Wander to different attributes of the trajectory, so the example makes it easy to play around and see the difference.
*/
diff --git a/examples/quick/particles/customparticle/content/imagecolors.qml b/examples/quick/particles/customparticle/content/imagecolors.qml
index 130518a6f9..3fb4c9f378 100644
--- a/examples/quick/particles/customparticle/content/imagecolors.qml
+++ b/examples/quick/particles/customparticle/content/imagecolors.qml
@@ -71,7 +71,7 @@ Rectangle {
}
Image {
id: particle
- source: "../../images/particle4.png"
+ source: "qrc:///particleresources/fuzzydot.png"
}
//! [vertex]
vertexShader:"
diff --git a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
index ccef82c922..fb53a67831 100644
--- a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
+++ b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
@@ -36,19 +36,19 @@
Blur Particles adds a blur effect to the particles, which increases over the particle's life time.
It uses a custom vertex shader:
- \snippet quick/particles/customparticle/content/blurparticles.qml vertex
+ \snippet particles/customparticle/content/blurparticles.qml vertex
to propagate life time simulation to a custom fragement shader:
- \snippet quick/particles/customparticle/content/blurparticles.qml fragment
+ \snippet particles/customparticle/content/blurparticles.qml fragment
which has access to both the normal image sampler and a blurred sampler, the image plus a ShaderEffect.
Fragment Shader just uses the particle system as a vertex delivery system.
- \snippet quick/particles/customparticle/content/fragmentshader.qml 0
+ \snippet particles/customparticle/content/fragmentshader.qml 0
Image Colors uses CustomParticle to assign colors to particles based on their location in a picture.
The vertex shader,
- \snippet quick/particles/customparticle/content/imagecolors.qml vertex
+ \snippet particles/customparticle/content/imagecolors.qml vertex
passes along the starting position for each vertex to the fragment shader,
- \snippet quick/particles/customparticle/content/imagecolors.qml fragment
+ \snippet particles/customparticle/content/imagecolors.qml fragment
which uses it to determine the color for that particle.
*/
diff --git a/examples/quick/particles/emitters/content/burstandpulse.qml b/examples/quick/particles/emitters/content/burstandpulse.qml
index 18d1c43933..28c56b326d 100644
--- a/examples/quick/particles/emitters/content/burstandpulse.qml
+++ b/examples/quick/particles/emitters/content/burstandpulse.qml
@@ -67,7 +67,7 @@ Rectangle {
id: particles
anchors.fill: parent
ImageParticle {
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
alpha: 0
colorVariation: 0.6
}
diff --git a/examples/quick/particles/emitters/content/customemitter.qml b/examples/quick/particles/emitters/content/customemitter.qml
index 966c78e70f..9ad504ebc8 100644
--- a/examples/quick/particles/emitters/content/customemitter.qml
+++ b/examples/quick/particles/emitters/content/customemitter.qml
@@ -90,7 +90,7 @@ ParticleSystem {
}
ImageParticle {
- source: "../../images/particle4.png"
+ source: "qrc:///particleresources/fuzzydot.png"
alpha: 0.0
}
}
diff --git a/examples/quick/particles/emitters/content/emitmask.qml b/examples/quick/particles/emitters/content/emitmask.qml
index 08c04f6e5f..1c2e7b458f 100644
--- a/examples/quick/particles/emitters/content/emitmask.qml
+++ b/examples/quick/particles/emitters/content/emitmask.qml
@@ -51,7 +51,7 @@ Rectangle {
anchors.centerIn: parent
ImageParticle {
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
z: 2
anchors.fill: parent
color: "#336666CC"
diff --git a/examples/quick/particles/emitters/content/maximumemitted.qml b/examples/quick/particles/emitters/content/maximumemitted.qml
index df92f05f4b..4bd9079770 100644
--- a/examples/quick/particles/emitters/content/maximumemitted.qml
+++ b/examples/quick/particles/emitters/content/maximumemitted.qml
@@ -53,7 +53,7 @@ Rectangle {
ImageParticle {
system: sys
id: cp
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorVariation: 0.4
color: "#000000FF"
}
diff --git a/examples/quick/particles/emitters/content/shapeanddirection.qml b/examples/quick/particles/emitters/content/shapeanddirection.qml
index 1dec5b2fa7..0ca433cfba 100644
--- a/examples/quick/particles/emitters/content/shapeanddirection.qml
+++ b/examples/quick/particles/emitters/content/shapeanddirection.qml
@@ -58,7 +58,7 @@ Rectangle {
ImageParticle {
groups: ["center","edge"]
anchors.fill: parent
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorVariation: 0.1
color: "#009999FF"
}
diff --git a/examples/quick/particles/emitters/content/trailemitter.qml b/examples/quick/particles/emitters/content/trailemitter.qml
index a4972b7b73..3186b511ef 100644
--- a/examples/quick/particles/emitters/content/trailemitter.qml
+++ b/examples/quick/particles/emitters/content/trailemitter.qml
@@ -56,7 +56,7 @@ Rectangle {
system: particles
anchors.fill: parent
groups: ["A", "B"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorVariation: 0
color: "#00111111"
}
@@ -65,7 +65,7 @@ Rectangle {
anchors.fill: parent
system: particles
groups: ["C", "D"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorVariation: 0.1
color: "#00ff400f"
}
diff --git a/examples/quick/particles/emitters/content/velocityfrommotion.qml b/examples/quick/particles/emitters/content/velocityfrommotion.qml
index 1f1d6607d0..d325f9b7e1 100644
--- a/examples/quick/particles/emitters/content/velocityfrommotion.qml
+++ b/examples/quick/particles/emitters/content/velocityfrommotion.qml
@@ -61,7 +61,7 @@ Rectangle {
ParticleSystem { id: sys1 }
ImageParticle {
system: sys1
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
color: "cyan"
alpha: 0
SequentialAnimation on color {
@@ -127,7 +127,7 @@ Rectangle {
}
}
colorVariation: 0.5
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
}
Emitter {
id: trailsStars
@@ -149,7 +149,7 @@ Rectangle {
}
ParticleSystem { id: sys3; }
ImageParticle {
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
system: sys3
color: "orange"
alpha: 0
@@ -191,7 +191,7 @@ Rectangle {
ParticleSystem { id: sys4; }
ImageParticle {
system: sys4
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
color: "green"
alpha: 0
SequentialAnimation on color {
diff --git a/examples/quick/particles/emitters/doc/src/emitters.qdoc b/examples/quick/particles/emitters/doc/src/emitters.qdoc
index 8eb7919000..acf8ce41c4 100644
--- a/examples/quick/particles/emitters/doc/src/emitters.qdoc
+++ b/examples/quick/particles/emitters/doc/src/emitters.qdoc
@@ -34,27 +34,27 @@
Each example is a small QML file emphasizing a particular type or feature.
Velocity from motion gives the effect of strong particle motion through primarily moving the emitters:
- \snippet quick/particles/emitters/content/velocityfrommotion.qml 0
+ \snippet particles/emitters/content/velocityfrommotion.qml 0
Burst and pulse calls the burst and pulse methods on two idential emitters.
- \snippet quick/particles/emitters/content/burstandpulse.qml 0
+ \snippet particles/emitters/content/burstandpulse.qml 0
Note how burst takes an argument of number of particles to emit, and pulse takes an argument of number of milliseconds to emit for.
This gives a slightly different behaviour, which is easy to see in this example.
Custom Emitter connects to the emitParticles signal to set arbitrary values on particle data as they're emitted;
- \snippet quick/particles/emitters/content/customemitter.qml 0
+ \snippet particles/emitters/content/customemitter.qml 0
This is used to emit curving particles in six rotating spokes.
Emit mask sets an image mask on the Emitter, to emit out of an arbitrary shape.
- \snippet quick/particles/emitters/content/emitmask.qml 0
+ \snippet particles/emitters/content/emitmask.qml 0
Maximum emitted emits no more than a certain number of particles at a time. This example makes it easy to see what happens when the limit is reached.
Shape and Direction emits particles out of an unfilled Ellipse shape, using a TargetDirection
- \snippet quick/particles/emitters/content/shapeanddirection.qml 0
+ \snippet particles/emitters/content/shapeanddirection.qml 0
This sends the particles towards the center of the ellipse with proportional speed, keeping the ellipse outline as they move to the center.
TrailEmitter uses that type to add smoke particles to trail the fire particles in the scene.
- \snippet quick/particles/emitters/content/customemitter.qml 0
+ \snippet particles/emitters/content/customemitter.qml 0
*/
diff --git a/examples/quick/particles/imageparticle/content/colored.qml b/examples/quick/particles/imageparticle/content/colored.qml
index 939ec7e437..236cc0f372 100644
--- a/examples/quick/particles/imageparticle/content/colored.qml
+++ b/examples/quick/particles/imageparticle/content/colored.qml
@@ -50,7 +50,7 @@ Rectangle {
ImageParticle {
groups: ["stars"]
anchors.fill: parent
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
}
Emitter {
group: "stars"
@@ -64,7 +64,7 @@ Rectangle {
// ![0]
ImageParticle {
anchors.fill: parent
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
alpha: 0
alphaVariation: 0.2
colorVariation: 1.0
diff --git a/examples/quick/particles/imageparticle/content/colortable.qml b/examples/quick/particles/imageparticle/content/colortable.qml
index 4090163872..87b5ae2678 100644
--- a/examples/quick/particles/imageparticle/content/colortable.qml
+++ b/examples/quick/particles/imageparticle/content/colortable.qml
@@ -55,7 +55,7 @@ Rectangle {
alpha: 0
//! [0]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
colorTable: "../../images/colortable.png"
sizeTable: "../../images/colortable.png"
//! [0]
diff --git a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
index c8f2dc988b..4fda13746a 100644
--- a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
+++ b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
@@ -35,25 +35,25 @@
Each example is a small QML file emphasizing a particular type or feature.
All at once shows off several of the features of ImageParticle at the same time.
- \snippet quick/particles/imageparticle/content/allatonce.qml 0
+ \snippet particles/imageparticle/content/allatonce.qml 0
Colored shows a simple ImageParticle with some color variation.
- \snippet quick/particles/imageparticle/content/colored.qml 0
+ \snippet particles/imageparticle/content/colored.qml 0
Color Table sets the color over life on the particles to provide a fixed rainbow effect.
- \snippet quick/particles/imageparticle/content/colortable.qml 0
+ \snippet particles/imageparticle/content/colortable.qml 0
Deformation spins and squishes a starfish particle.
- \snippet quick/particles/imageparticle/content/deformation.qml spin
- \snippet quick/particles/imageparticle/content/deformation.qml deform
+ \snippet particles/imageparticle/content/deformation.qml spin
+ \snippet particles/imageparticle/content/deformation.qml deform
Rotation demonstrates the autoRotate property, so that particles rotate in the direction that they travel.
Sharing demonstrates what happens when multiple ImageParticles try to render the same particle.
The following ImageParticle renders the particles inside the ListView:
- \snippet quick/particles/imageparticle/content/sharing.qml 0
+ \snippet particles/imageparticle/content/sharing.qml 0
The following ImageParticle is placed inside the list highlight, and renders the particles above the other ImageParticle.
- \snippet quick/particles/imageparticle/content/sharing.qml 1
+ \snippet particles/imageparticle/content/sharing.qml 1
Note that because it sets the color and alpha in this ImageParticle, it renders the particles in a different color.
Since it doesn't specify anything about the rotation, it shares the rotation with the other ImageParticle so that the flowers are rotated the same way in both.
Note that you can undo rotation in another ImageParticle, you just need to explicity set rotationVariation to 0.
diff --git a/examples/quick/particles/images.qrc b/examples/quick/particles/images.qrc
index 9f284a087d..1f754838a8 100644
--- a/examples/quick/particles/images.qrc
+++ b/examples/quick/particles/images.qrc
@@ -12,10 +12,8 @@
<file>images/meteor.png</file>
<file>images/meteors.png</file>
<file>images/nullRock.png</file>
- <file>images/particle.png</file>
<file>images/particle2.png</file>
<file>images/particle3.png</file>
- <file>images/particle4.png</file>
<file>images/particleA.png</file>
<file>images/portal_bg.png</file>
<file>images/realLeaf1.png</file>
@@ -27,7 +25,6 @@
<file>images/sizeInOut.png</file>
<file>images/snowflake.png</file>
<file>images/sparkleSize.png</file>
- <file>images/star.png</file>
<file>images/starfish_0.png</file>
<file>images/starfish_1.png</file>
<file>images/starfish_2.png</file>
diff --git a/examples/quick/particles/images/particle.png b/examples/quick/particles/images/particle.png
deleted file mode 100644
index 5c83896d22..0000000000
--- a/examples/quick/particles/images/particle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/particles/images/particle4.png b/examples/quick/particles/images/particle4.png
deleted file mode 100644
index bc95b703c1..0000000000
--- a/examples/quick/particles/images/particle4.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/particles/images/star.png b/examples/quick/particles/images/star.png
deleted file mode 100644
index 0d592cfa87..0000000000
--- a/examples/quick/particles/images/star.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/particles/system/content/dynamiccomparison.qml b/examples/quick/particles/system/content/dynamiccomparison.qml
index 247a25a17d..9db7c0a1ec 100644
--- a/examples/quick/particles/system/content/dynamiccomparison.qml
+++ b/examples/quick/particles/system/content/dynamiccomparison.qml
@@ -52,7 +52,7 @@ Rectangle {
ImageParticle {
system: sys
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
color: "white"
colorVariation: 1.0
alpha: 0.1
@@ -90,7 +90,7 @@ Rectangle {
property int lifeSpan: 10000
width: 32
height: 32
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
y: 0
PropertyAnimation on y {from: -16; to: root.height-16; duration: container.lifeSpan; running: true}
SequentialAnimation on opacity {
diff --git a/examples/quick/particles/system/content/dynamicemitters.qml b/examples/quick/particles/system/content/dynamicemitters.qml
index 10ac33bd76..72ec1ffc23 100644
--- a/examples/quick/particles/system/content/dynamicemitters.qml
+++ b/examples/quick/particles/system/content/dynamicemitters.qml
@@ -51,7 +51,7 @@ Rectangle {
}
ImageParticle {
system: sys
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
color: "white"
colorVariation: 1.0
alpha: 0.1
diff --git a/examples/quick/particles/system/content/multiplepainters.qml b/examples/quick/particles/system/content/multiplepainters.qml
index 8a38874533..e0a1288588 100644
--- a/examples/quick/particles/system/content/multiplepainters.qml
+++ b/examples/quick/particles/system/content/multiplepainters.qml
@@ -91,6 +91,6 @@ Rectangle {
height: 240
width: root.width
z: 1
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
}
}
diff --git a/examples/quick/particles/system/content/startstop.qml b/examples/quick/particles/system/content/startstop.qml
index 5ce8729a43..e787919b05 100644
--- a/examples/quick/particles/system/content/startstop.qml
+++ b/examples/quick/particles/system/content/startstop.qml
@@ -69,7 +69,7 @@ Rectangle {
ImageParticle {
anchors.fill: parent
system: particles
- source: "../../images/star.png"
+ source: "qrc:///particleresources/star.png"
sizeTable: "../../images/sparkleSize.png"
alpha: 0
colorVariation: 0.6
diff --git a/examples/quick/particles/system/content/timedgroupchanges.qml b/examples/quick/particles/system/content/timedgroupchanges.qml
index 6443878a36..7131633769 100644
--- a/examples/quick/particles/system/content/timedgroupchanges.qml
+++ b/examples/quick/particles/system/content/timedgroupchanges.qml
@@ -119,7 +119,7 @@ Rectangle {
ImageParticle {
groups: ["works", "fire", "splode"]
- source: "../../images/particle.png"
+ source: "qrc:///particleresources/glowdot.png"
entryEffect: ImageParticle.Scale
}
}
diff --git a/examples/quick/particles/system/doc/src/system.qdoc b/examples/quick/particles/system/doc/src/system.qdoc
index 04dc1727d2..99be23d9d1 100644
--- a/examples/quick/particles/system/doc/src/system.qdoc
+++ b/examples/quick/particles/system/doc/src/system.qdoc
@@ -35,7 +35,7 @@
Each example is a small QML file emphasizing a particular type or feature.
Dynamic comparison compares using the particle system to getting a similar effect with the following code that dynamically instantiates Image types.
- \snippet quick/particles/system/content/dynamiccomparison.qml fake
+ \snippet particles/system/content/dynamiccomparison.qml fake
Note how the Image objects are not able to be randomly colorized.
Start and Stop simply sets the running and paused states of a ParticleSystem. While the system does not perform any simulation when stopped or paused, a restart restarts the simulation from the beginning, while unpausing resumes the simulation from where it was.
@@ -43,16 +43,16 @@
Timed group changes is an example that highlights the ParticleGroup type. While normally referring to groups with a string name is sufficient, additional effects can be
done by setting properties on groups.
The first group has a variable duration on it, but always transitions to the second group.
- \snippet quick/particles/system/content/timedgroupchanges.qml 0
+ \snippet particles/system/content/timedgroupchanges.qml 0
The second group has a TrailEmitter on it, and a fixed duration for emitting into the third group. By placing the TrailEmitter as a direct child of the ParticleGroup, it automatically selects that group to follow.
- \snippet quick/particles/system/content/timedgroupchanges.qml 1
+ \snippet particles/system/content/timedgroupchanges.qml 1
The third group has an Affector as a direct child, which makes the affector automatically target this group. The affector means that as soon as particles enter this group, a burst function can be called on another emitter, using the x,y positions of this particle.
- \snippet quick/particles/system/content/timedgroupchanges.qml 2
+ \snippet particles/system/content/timedgroupchanges.qml 2
If TrailEmitter does not suit your needs for multiple emitters, you can also dynamically create Emitters while still using the same ParticleSystem and image particle
- \snippet quick/particles/system/content/dynamicemitters.qml 0
+ \snippet particles/system/content/dynamicemitters.qml 0
Note that this effect, a flurry of flying rainbow spears, would be better served with TrailEmitter. It is only done with dynamic emitters in this example to show the concept more simply.
- Multiple Painters shows how to control paint ordering of individual particles. While the paint ordering of particles within one ImagePainter is not strictly defined, ImageParticle objects follow the normal Z-ordering rules for QtQuick items. This example allow you to paint the inside of the particles above the black borders using a pair of ImageParticles each painting different parts of the same logical particle.
+ Multiple Painters shows how to control paint ordering of individual particles. While the paint ordering of particles within one ImagePainter is not strictly defined, ImageParticle objects follow the normal Z-ordering rules for \l {Qt Quick} items. This example allow you to paint the inside of the particles above the black borders using a pair of ImageParticles each painting different parts of the same logical particle.
*/
diff --git a/examples/quick/positioners/doc/src/positioners.qdoc b/examples/quick/positioners/doc/src/positioners.qdoc
index 3a20b145ef..794b3b25f9 100644
--- a/examples/quick/positioners/doc/src/positioners.qdoc
+++ b/examples/quick/positioners/doc/src/positioners.qdoc
@@ -38,15 +38,15 @@
It consists of a scene populated with items in a variety of positioners: Column, Row, Grid and Flow.
Each positioner has animations described as Transitions.
- \snippet quick/positioners/positioners-transitions.qml move
+ \snippet positioners/positioners-transitions.qml move
The move transition specifies how items inside a positioner will animate when they are displaced by the appearance or disappearance of other items.
- \snippet quick/positioners/positioners-transitions.qml add
+ \snippet positioners/positioners-transitions.qml add
The add transition specifies how items will appear when they are added to a positioner.
- \snippet quick/positioners/positioners-transitions.qml populate
+ \snippet positioners/positioners-transitions.qml populate
The populate transition specifies how items will appear when their parent positioner is first created.
Attached Properties shows how the Positioner attached property can be used to determine where an item is within a positioner.
- \snippet quick/positioners/positioners-attachedproperties.qml 0
+ \snippet positioners/positioners-attachedproperties.qml 0
*/
diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro
index 2d8acb3345..311e264af1 100644
--- a/examples/quick/quick.pro
+++ b/examples/quick/quick.pro
@@ -20,6 +20,7 @@ SUBDIRS = accessibility \
customitems \
imageprovider \
window \
+ dialogs \
particles \
demos
diff --git a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
index d98407b6c1..e3cef52bf7 100644
--- a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
+++ b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
@@ -41,7 +41,7 @@
\section1 BezierCurve Declaration
- \snippet quick/scenegraph/customgeometry/beziercurve.h 1
+ \snippet scenegraph/customgeometry/beziercurve.h 1
The item declaration subclasses the QQuickItem class and adds five
properties. One for each of the four control points in the bezier
@@ -52,7 +52,7 @@
signals for each of them so changes will be picked up the QML
engine and used accordingly.
- \snippet quick/scenegraph/customgeometry/beziercurve.h 2
+ \snippet scenegraph/customgeometry/beziercurve.h 2
The synchronization point between the QML scene and the rendering
scene graph is the virtual function \l
@@ -67,7 +67,7 @@
\section1 BezierCurve Implementation
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 1
+ \snippet scenegraph/customgeometry/beziercurve.cpp 1
The BezierCurve constructor sets up default values for the
control points and the number of segments. The bezier curve
@@ -80,7 +80,7 @@
QQuickItem::updatePaintNode() when it is time for the QML scene to
be synchronized with the rendering scene graph.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 2
+ \snippet scenegraph/customgeometry/beziercurve.cpp 2
The BezierCurve class has no data members that need to be cleaned
up so the destructor does nothing. It is worth mentioning that the
@@ -89,7 +89,7 @@
QSGNode references in the QQuickItem class nor try to clean them
up explicitly.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 3
+ \snippet scenegraph/customgeometry/beziercurve.cpp 3
The setter function for the p1 property checks if the value is
unchanged and exits early if this is the case. Then it updates the
@@ -103,7 +103,7 @@
The other property setters are equivalent, and are omitted from
this example.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 4
+ \snippet scenegraph/customgeometry/beziercurve.cpp 4
The updatePaintNode() function is the primary integration point
for synchronizing the state of the QML scene with the rendering
@@ -113,7 +113,7 @@
our QSGGeometryNode which we will fill with geometry and a
material.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 5
+ \snippet scenegraph/customgeometry/beziercurve.cpp 5
We then create the geometry and add it to the node. The first
argument to the QSGGeometry constructor is a definition of the
@@ -135,7 +135,7 @@
geometry a member of a QSGGeometryNode subclass, in which case, we
would not have set the QSGGeometryNode::OwnsGeometry flag.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 6
+ \snippet scenegraph/customgeometry/beziercurve.cpp 6
The scene graph API provides a few commonly used used material
implementations. In this example we use the QSGFlatColorMaterial
@@ -143,7 +143,7 @@
color. Again we pass the ownership of the material to the node, so
it can be cleaned up by the scene graph.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 7
+ \snippet scenegraph/customgeometry/beziercurve.cpp 7
In the case where the QML item has changed and we only want to
modify the existing node's geometry, we cast the \c oldNode to a
@@ -151,7 +151,7 @@
segment count has changed, we call QSGGeometry::allocate() to make
sure it has the right number of vertices.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 8
+ \snippet scenegraph/customgeometry/beziercurve.cpp 8
To fill the geometry, we first extract the vertex array from
it. Since we are using one of the default attribute sets, we can
@@ -159,14 +159,14 @@
Then we go through each segment and calculate its position and
write that value to the vertex.
- \snippet quick/scenegraph/customgeometry/beziercurve.cpp 9
+ \snippet scenegraph/customgeometry/beziercurve.cpp 9
In the end of the function, we return the node so the scene graph
can render it.
\section1 Application Entry-Point
- \snippet quick/scenegraph/customgeometry/main.cpp 1
+ \snippet scenegraph/customgeometry/main.cpp 1
The application is a straightforward QML application, with a
QGuiApplication and a QQuickView that we pass a .qml file. To make
@@ -183,24 +183,24 @@
\section1 Using the Item
- \snippet quick/scenegraph/customgeometry/main.qml 1
+ \snippet scenegraph/customgeometry/main.qml 1
Our .qml file imports the \c {QtQuick 2.0} module to get the
standard types and also our own \c {CustomGeometry 1.0} module
which contains our newly created BezierCurve objects.
- \snippet quick/scenegraph/customgeometry/main.qml 2
+ \snippet scenegraph/customgeometry/main.qml 2
Then we create the our root item and an instance of the
BezierCurve which we anchor to fill the root.
- \snippet quick/scenegraph/customgeometry/main.qml 3
+ \snippet scenegraph/customgeometry/main.qml 3
To make the example a bit more interesting we add an animation to
change the two control points in the curve. The end points stay
unchanged.
- \snippet quick/scenegraph/customgeometry/main.qml 4
+ \snippet scenegraph/customgeometry/main.qml 4
Finally we overlay a short text outlining what the example shows.
diff --git a/examples/quick/scenegraph/graph/doc/images/graph-example.jpg b/examples/quick/scenegraph/graph/doc/images/graph-example.jpg
new file mode 100644
index 0000000000..74975ee7c4
--- /dev/null
+++ b/examples/quick/scenegraph/graph/doc/images/graph-example.jpg
Binary files differ
diff --git a/examples/quick/scenegraph/graph/doc/src/graph.qdoc b/examples/quick/scenegraph/graph/doc/src/graph.qdoc
new file mode 100644
index 0000000000..d5a07cdc48
--- /dev/null
+++ b/examples/quick/scenegraph/graph/doc/src/graph.qdoc
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example scenegraph/graph
+ \title Scene Graph - Graph
+ \ingroup qtquickexamples
+
+ \brief Demonstrates how one can combine custom materials and geometries
+ under a single QQuickItem.
+
+ \image graph-example.jpg
+
+ */
diff --git a/examples/quick/scenegraph/graph/graph.cpp b/examples/quick/scenegraph/graph/graph.cpp
new file mode 100644
index 0000000000..ad75307e57
--- /dev/null
+++ b/examples/quick/scenegraph/graph/graph.cpp
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "graph.h"
+
+#include "noisynode.h"
+#include "gridnode.h"
+#include "linenode.h"
+
+Graph::Graph()
+ : m_samplesChanged(false)
+ , m_geometryChanged(false)
+{
+ setFlag(ItemHasContents, true);
+}
+
+
+void Graph::appendSample(qreal value)
+{
+ m_samples << value;
+ m_samplesChanged = true;
+ update();
+}
+
+
+void Graph::removeFirstSample()
+{
+ m_samples.removeFirst();
+ m_samplesChanged = true;
+ update();
+}
+
+void Graph::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ m_geometryChanged = true;
+ update();
+ QQuickItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+
+class GraphNode : public QSGNode
+{
+public:
+ NoisyNode *background;
+ GridNode *grid;
+ LineNode *line;
+ LineNode *shadow;
+};
+
+
+QSGNode *Graph::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+{
+ GraphNode *n= static_cast<GraphNode *>(oldNode);
+
+ QRectF rect = boundingRect();
+
+ if (rect.isEmpty()) {
+ delete n;
+ return 0;
+ }
+
+ if (!n) {
+ n = new GraphNode();
+
+ n->background = new NoisyNode(window());
+ n->grid = new GridNode();
+ n->line = new LineNode(10, 0.5, QColor("steelblue"));
+ n->shadow = new LineNode(20, 0.2, QColor::fromRgbF(0.2, 0.2, 0.2, 0.4));
+
+ n->appendChildNode(n->background);
+ n->appendChildNode(n->grid);
+ n->appendChildNode(n->shadow);
+ n->appendChildNode(n->line);
+ }
+
+ if (m_geometryChanged) {
+ n->background->setRect(rect);
+ n->grid->setRect(rect);
+ }
+
+ if (m_geometryChanged || m_samplesChanged) {
+ n->line->updateGeometry(rect, m_samples);
+ // We don't need to calculate the geometry twice, so just steal it from the other one...
+ n->shadow->setGeometry(n->line->geometry());
+ }
+
+ m_geometryChanged = false;
+ m_samplesChanged = false;
+
+ return n;
+}
diff --git a/examples/quick/scenegraph/graph/graph.h b/examples/quick/scenegraph/graph/graph.h
new file mode 100644
index 0000000000..28d14f166a
--- /dev/null
+++ b/examples/quick/scenegraph/graph/graph.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GRAPH_H
+#define GRAPH_H
+
+#include <QQuickItem>
+
+class Graph : public QQuickItem
+{
+ Q_OBJECT
+public:
+ Graph();
+
+protected:
+ QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
+
+public slots:
+ void appendSample(qreal value);
+ void removeFirstSample();
+
+private:
+ QList<qreal> m_samples;
+
+ bool m_samplesChanged;
+ bool m_geometryChanged;
+};
+
+#endif // GRAPH_H
diff --git a/examples/quick/scenegraph/graph/graph.pro b/examples/quick/scenegraph/graph/graph.pro
new file mode 100644
index 0000000000..5991f799dc
--- /dev/null
+++ b/examples/quick/scenegraph/graph/graph.pro
@@ -0,0 +1,34 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2013-06-11T13:13:18
+#
+#-------------------------------------------------
+
+QT += core gui quick
+
+TARGET = graph
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+ graph.cpp \
+ noisynode.cpp \
+ gridnode.cpp \
+ linenode.cpp
+
+HEADERS += \
+ graph.h \
+ noisynode.h \
+ gridnode.h \
+ linenode.h
+
+RESOURCES += \
+ graph.qrc
+
+OTHER_FILES += \
+ main.qml \
+ shaders/noisy.vsh \
+ shaders/noisy.fsh \
+ shaders/line.fsh \
+ shaders/line.vsh
+
diff --git a/examples/quick/scenegraph/graph/graph.qrc b/examples/quick/scenegraph/graph/graph.qrc
new file mode 100644
index 0000000000..2adaeac751
--- /dev/null
+++ b/examples/quick/scenegraph/graph/graph.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/scenegraph/graph">
+ <file>main.qml</file>
+ <file>shaders/noisy.vsh</file>
+ <file>shaders/noisy.fsh</file>
+ <file>shaders/line.vsh</file>
+ <file>shaders/line.fsh</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/scenegraph/graph/gridnode.cpp b/examples/quick/scenegraph/graph/gridnode.cpp
new file mode 100644
index 0000000000..2b5e8cac16
--- /dev/null
+++ b/examples/quick/scenegraph/graph/gridnode.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gridnode.h"
+
+#include "qmath.h"
+
+#define GRID_SIZE 32
+
+GridNode::GridNode()
+ : m_geometry(QSGGeometry::defaultAttributes_Point2D(), 0)
+{
+ setGeometry(&m_geometry);
+ m_geometry.setDrawingMode(GL_LINES);
+
+ setMaterial(&m_material);
+ m_material.setColor(Qt::gray);
+}
+
+/*
+ * The function hardcodes a fixed set of grid lines and scales
+ * those to the bounding rect.
+ */
+void GridNode::setRect(const QRectF &rect)
+{
+ int vCount = int((rect.width() - 1) / GRID_SIZE);
+ int hCount = int((rect.height() - 1) / GRID_SIZE);
+
+ int lineCount = vCount + hCount;
+
+ QSGGeometry *g = geometry();
+
+ g->allocate(lineCount * 2);
+
+ float x = rect.x();
+ float y = rect.y();
+ float w = rect.width();
+ float h = rect.height();
+
+ QSGGeometry::Point2D *v = g->vertexDataAsPoint2D();
+
+ // Then write the vertical lines
+ for (int i=0; i<vCount; ++i) {
+ float dx = (i + 1) * GRID_SIZE;
+ v[i*2].set(dx, y);
+ v[i*2+1].set(dx, y + h);
+ }
+ v += vCount * 2;
+ // Then write the horizontal lines
+ for (int i=0; i<hCount; ++i) {
+ float dy = (i + 1) * GRID_SIZE;
+ v[i*2].set(x, dy);
+ v[i*2+1].set(x + w, dy);
+ }
+
+ // Tell the scenegraph we updated the geometry..
+ markDirty(QSGNode::DirtyGeometry);
+}
diff --git a/examples/quick/scenegraph/graph/gridnode.h b/examples/quick/scenegraph/graph/gridnode.h
new file mode 100644
index 0000000000..8581a993ae
--- /dev/null
+++ b/examples/quick/scenegraph/graph/gridnode.h
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GRIDNODE_H
+#define GRIDNODE_H
+
+#include <QtQuick/QSGGeometryNode>
+#include <QtQuick/QSGFlatColorMaterial>
+
+class GridNode : public QSGGeometryNode
+{
+public:
+ GridNode();
+
+ void setRect(const QRectF &rect);
+
+private:
+ QSGFlatColorMaterial m_material;
+ QSGGeometry m_geometry;
+};
+
+#endif // GRIDNODE_H
diff --git a/examples/quick/scenegraph/graph/linenode.cpp b/examples/quick/scenegraph/graph/linenode.cpp
new file mode 100644
index 0000000000..0d1229cf1d
--- /dev/null
+++ b/examples/quick/scenegraph/graph/linenode.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "linenode.h"
+
+#include <QtCore/QResource>
+
+#include <QtGui/QColor>
+
+#include <QtQuick/QSGSimpleMaterial>
+
+struct LineMaterial
+{
+ QColor color;
+ float spread;
+ float size;
+};
+
+class LineShader : public QSGSimpleMaterialShader<LineMaterial>
+{
+ QSG_DECLARE_SIMPLE_SHADER(LineShader, LineMaterial)
+
+public:
+ const char *vertexShader() const {
+ QResource r(":/scenegraph/graph/shaders/line.vsh");
+ Q_ASSERT(r.isValid());
+ return (const char *) r.data();
+ }
+
+ const char *fragmentShader() const {
+ QResource r(":/scenegraph/graph/shaders/line.fsh");
+ Q_ASSERT(r.isValid());
+ return (const char *) r.data();
+ }
+
+ QList<QByteArray> attributes() const { return QList<QByteArray>() << "pos" << "t"; }
+
+ void updateState(const LineMaterial *m, const LineMaterial *) {
+ program()->setUniformValue(id_color, m->color);
+ program()->setUniformValue(id_spread, m->spread);
+ program()->setUniformValue(id_size, m->size);
+ }
+
+ void resolveUniforms() {
+ id_spread = program()->uniformLocation("spread");
+ id_size = program()->uniformLocation("size");
+ id_color = program()->uniformLocation("color");
+ }
+
+private:
+ int id_color;
+ int id_spread;
+ int id_size;
+};
+
+struct LineVertex {
+ float x;
+ float y;
+ float t;
+ inline void set(float xx, float yy, float tt) { x = xx; y = yy; t = tt; }
+};
+
+static const QSGGeometry::AttributeSet &attributes()
+{
+ static QSGGeometry::Attribute attr[] = {
+ QSGGeometry::Attribute::create(0, 2, GL_FLOAT, true),
+ QSGGeometry::Attribute::create(1, 1, GL_FLOAT)
+ };
+ static QSGGeometry::AttributeSet set = { 2, 3 * sizeof(float), attr };
+ return set;
+}
+
+LineNode::LineNode(float size, float spread, const QColor &color)
+ : m_geometry(attributes(), 0)
+{
+ setGeometry(&m_geometry);
+ m_geometry.setDrawingMode(GL_TRIANGLE_STRIP);
+
+ QSGSimpleMaterial<LineMaterial> *m = LineShader::createMaterial();
+ m->state()->color = color;
+ m->state()->size = size;
+ m->state()->spread = spread;
+ m->setFlag(QSGMaterial::Blending);
+ setMaterial(m);
+ setFlag(OwnsMaterial);
+}
+
+/*
+ * Assumes that samples have values in the range of 0 to 1 and scales them to
+ * the height of bounds. The samples are stretched out horizontally along the
+ * width of the bounds.
+ *
+ * The position of each pair of points is identical, but we use the third value
+ * "t" to shift the point up or down and to add antialiasing.
+ */
+void LineNode::updateGeometry(const QRectF &bounds, const QList<qreal> &samples)
+{
+ m_geometry.allocate(samples.size() * 2);
+
+ float x = bounds.x();
+ float y = bounds.y();
+ float w = bounds.width();
+ float h = bounds.height();
+
+ float dx = w / (samples.size() - 1);
+
+ LineVertex *v = (LineVertex *) m_geometry.vertexData();
+ for (int i=0; i<samples.size(); ++i) {
+ v[i*2+0].set(x + dx * i, y + samples.at(i) * h, 0);
+ v[i*2+1].set(x + dx * i, y + samples.at(i) * h, 1);
+ }
+
+ markDirty(QSGNode::DirtyGeometry);
+}
diff --git a/examples/quick/scenegraph/graph/linenode.h b/examples/quick/scenegraph/graph/linenode.h
new file mode 100644
index 0000000000..192bedbefc
--- /dev/null
+++ b/examples/quick/scenegraph/graph/linenode.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LINENODE_H
+#define LINENODE_H
+
+#include <QSGGeometryNode>
+
+class LineNode : public QSGGeometryNode
+{
+public:
+ LineNode(float size, float spread, const QColor &color);
+
+ void updateGeometry(const QRectF &bounds, const QList<qreal> &samples);
+
+private:
+ QSGGeometry m_geometry;
+
+};
+
+#endif // LINENODE_H
diff --git a/examples/quick/scenegraph/graph/main.cpp b/examples/quick/scenegraph/graph/main.cpp
new file mode 100644
index 0000000000..ed54ae59b1
--- /dev/null
+++ b/examples/quick/scenegraph/graph/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQuickView>
+
+#include "graph.h"
+#include <QtQml/QQmlContext>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication a(argc, argv);
+
+ qmlRegisterType<Graph>("Graph", 1, 0, "Graph");
+
+ QQuickView view;
+ view.resize(800, 400);
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:///scenegraph/graph/main.qml"));
+ view.show();
+
+ return a.exec();
+}
diff --git a/examples/quick/scenegraph/graph/main.qml b/examples/quick/scenegraph/graph/main.qml
new file mode 100644
index 0000000000..ad952bcf1a
--- /dev/null
+++ b/examples/quick/scenegraph/graph/main.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+import Graph 1.0
+
+Item {
+ width: 800
+ height: 400
+
+ Graph {
+ id: graph
+ anchors.fill: parent
+ anchors.margins: 100
+
+ function newSample(i) {
+ return (Math.sin(i / 100.0 * Math.PI * 2) + 1) * 0.4 + Math.random() * 0.05;
+ }
+
+ Component.onCompleted: {
+ for (var i=0; i<100; ++i)
+ appendSample(newSample(i));
+ }
+
+ property int offset: 100;
+ }
+
+ Timer {
+ id: timer
+ interval: 500
+ repeat: true
+ running: true
+ onTriggered: {
+ graph.removeFirstSample();
+ graph.appendSample(graph.newSample(++graph.offset));
+ }
+
+ }
+
+ Rectangle {
+ anchors.fill: graph
+ color: "transparent"
+ border.color: "black"
+ border.width: 2
+ }
+
+}
diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp
new file mode 100644
index 0000000000..1fc87a2b97
--- /dev/null
+++ b/examples/quick/scenegraph/graph/noisynode.cpp
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "noisynode.h"
+
+#include <QtCore/QResource>
+
+#include <QtQuick/QSGSimpleMaterialShader>
+#include <QtQuick/QSGTexture>
+#include <QtQuick/QQuickWindow>
+
+#define NOISE_SIZE 64
+
+struct NoisyMaterial
+{
+ ~NoisyMaterial() {
+ delete texture;
+ }
+
+ QColor color;
+ QSGTexture *texture;
+};
+
+class NoisyShader : public QSGSimpleMaterialShader<NoisyMaterial>
+{
+ QSG_DECLARE_SIMPLE_SHADER(NoisyShader, NoisyMaterial)
+
+public:
+ const char *vertexShader() const {
+ QResource r(":/scenegraph/graph/shaders/noisy.vsh");
+ Q_ASSERT(r.isValid());
+ return (const char *) r.data();
+ }
+
+ const char *fragmentShader() const {
+ QResource r(":/scenegraph/graph/shaders/noisy.fsh");
+ Q_ASSERT(r.isValid());
+ return (const char *) r.data();
+ }
+
+ QList<QByteArray> attributes() const { return QList<QByteArray>() << "aVertex" << "aTexCoord"; }
+
+ void updateState(const NoisyMaterial *m, const NoisyMaterial *) {
+
+ // Set the color
+ program()->setUniformValue(id_color, m->color);
+
+ // Bind the texture and set program to use texture unit 0 (the default)
+ m->texture->bind();
+
+ // Then set the texture size so we can adjust the texture coordinates accordingly in the
+ // vertex shader..
+ QSize s = m->texture->textureSize();
+ program()->setUniformValue(id_textureSize, QSizeF(1.0 / s.width(), 1.0 / s.height()));
+ }
+
+ void resolveUniforms() {
+ id_texture = program()->uniformLocation("texture");
+ id_textureSize = program()->uniformLocation("textureSize");
+ id_color = program()->uniformLocation("color");
+
+ // We will only use texture unit 0, so set it only once.
+ program()->setUniformValue(id_texture, 0);
+ }
+
+private:
+ int id_color;
+ int id_texture;
+ int id_textureSize;
+};
+
+NoisyNode::NoisyNode(QQuickWindow *window)
+{
+ // Make some noise...
+ QImage image(NOISE_SIZE, NOISE_SIZE, QImage::Format_RGB32);
+ uint *data = (uint *) image.bits();
+ for (int i=0; i<NOISE_SIZE * NOISE_SIZE; ++i) {
+ uint g = rand() & 0xff;
+ data[i] = 0xff000000 | (g << 16) | (g << 8) | g;
+ }
+
+ QSGTexture *t = window->createTextureFromImage(image);
+ t->setFiltering(QSGTexture::Nearest);
+ t->setHorizontalWrapMode(QSGTexture::Repeat);
+ t->setVerticalWrapMode(QSGTexture::Repeat);
+
+ QSGSimpleMaterial<NoisyMaterial> *m = NoisyShader::createMaterial();
+ m->state()->texture = t;
+ m->state()->color = QColor::fromRgbF(0.95, 0.95, 0.97);
+ m->setFlag(QSGMaterial::Blending);
+
+ setMaterial(m);
+ setFlag(OwnsMaterial, true);
+
+ QSGGeometry *g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
+ QSGGeometry::updateTexturedRectGeometry(g, QRect(), QRect());
+ setGeometry(g);
+ setFlag(OwnsGeometry, true);
+}
+
+void NoisyNode::setRect(const QRectF &bounds)
+{
+ QSGGeometry::updateTexturedRectGeometry(geometry(), bounds, QRectF(0, 0, 1, 1));
+ markDirty(QSGNode::DirtyGeometry);
+}
diff --git a/examples/quick/scenegraph/graph/noisynode.h b/examples/quick/scenegraph/graph/noisynode.h
new file mode 100644
index 0000000000..b5a291330f
--- /dev/null
+++ b/examples/quick/scenegraph/graph/noisynode.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef NOISYNODE_H
+#define NOISYNODE_H
+
+#include <QSGGeometryNode>
+
+class QQuickWindow;
+
+class NoisyNode : public QSGGeometryNode
+{
+public:
+ NoisyNode(QQuickWindow *window);
+
+ void setRect(const QRectF &bounds);
+};
+
+#endif // NOISYNODE_H
diff --git a/examples/quick/window/window/nogui.qml b/examples/quick/scenegraph/graph/shaders/line.fsh
index 2a5734c773..b07558c2ab 100644
--- a/examples/quick/window/window/nogui.qml
+++ b/examples/quick/scenegraph/graph/shaders/line.fsh
@@ -38,13 +38,17 @@
**
****************************************************************************/
-import QtQml 2.0
+uniform lowp vec4 color;
+uniform lowp float qt_Opacity;
+uniform lowp float spread;
-/*
- This object's only functionality is to exist as a root object and
- display nothing, proving that qmlscene can run without windows.
- (A QtObject can't even have Component.onCompleted)
-*/
-QtObject {
- property string philosophy: "hello bleak windowless world"
+varying lowp float vT;
+
+#define PI 3.14159265359
+
+void main(void)
+{
+ lowp float tt = smoothstep(spread, 1.0, sin(vT * PI));
+
+ gl_FragColor = color * qt_Opacity * tt;
}
diff --git a/examples/quick/scenegraph/graph/shaders/line.vsh b/examples/quick/scenegraph/graph/shaders/line.vsh
new file mode 100644
index 0000000000..84353b852c
--- /dev/null
+++ b/examples/quick/scenegraph/graph/shaders/line.vsh
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+attribute highp vec4 pos;
+attribute highp float t;
+
+uniform lowp float size;
+uniform highp mat4 qt_Matrix;
+
+varying lowp float vT;
+
+void main(void)
+{
+ vec4 adjustedPos = pos;
+ adjustedPos.y += (t * size);
+ gl_Position = qt_Matrix * adjustedPos;
+
+ vT = t;
+}
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.fsh b/examples/quick/scenegraph/graph/shaders/noisy.fsh
new file mode 100644
index 0000000000..227c2b5974
--- /dev/null
+++ b/examples/quick/scenegraph/graph/shaders/noisy.fsh
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+uniform sampler2D texture;
+uniform lowp float qt_Opacity;
+uniform lowp vec4 color;
+
+varying highp vec2 vTexCoord;
+varying lowp vec2 vShadeCoord;
+
+#define PI 3.14159265359
+
+void main()
+{
+ lowp float shade = texture2D(texture, vTexCoord).r * 0.05 - length(vec2(0.5, 0.4) - vShadeCoord) * 0.3;
+ lowp vec4 c = vec4(color.xyz + shade, color.w);
+ gl_FragColor = c * qt_Opacity;
+}
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.vsh b/examples/quick/scenegraph/graph/shaders/noisy.vsh
new file mode 100644
index 0000000000..ce648e51b9
--- /dev/null
+++ b/examples/quick/scenegraph/graph/shaders/noisy.vsh
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+attribute highp vec4 aVertex;
+attribute highp vec2 aTexCoord;
+
+uniform highp mat4 qt_Matrix;
+uniform highp vec2 textureSize;
+
+varying highp vec2 vTexCoord;
+varying lowp vec2 vShadeCoord;
+
+void main() {
+ gl_Position = qt_Matrix * aVertex;
+ vTexCoord = aVertex.xy * textureSize;
+ vShadeCoord = aTexCoord;
+}
diff --git a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
index 4bf5444d79..1f87412aa4 100644
--- a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
+++ b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
@@ -50,7 +50,7 @@
in the QML file and this value is used by the OpenGL shader
program that draws the squircles.
- \snippet quick/scenegraph/openglunderqml/squircle.h 1
+ \snippet scenegraph/openglunderqml/squircle.h 1
First of all, we need a QObject with a slot to connect the signals
to. We subclass QQuickItem in order to use the \l
@@ -73,13 +73,13 @@
Lets move on to the implementation.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 7
+ \snippet scenegraph/openglunderqml/squircle.cpp 7
The constructor of the \c Squircle class simply initializes the
values. The shader program will be initialized during rendering
later.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 8
+ \snippet scenegraph/openglunderqml/squircle.cpp 8
The property setter checks that the value has indeed changed
before updating its internal variable. It then calls \l
@@ -88,13 +88,13 @@
initialization, before the object has been entered into the scene
and before it has a window.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 1
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 2
+ \snippet scenegraph/openglunderqml/squircle.cpp 1
+ \snippet scenegraph/openglunderqml/squircle.cpp 2
For our paint function to be called, we need to connect to the
window's signals. When Squircle object is populated into the
- scene, the itemChange function is called with the change type \c
- ItemSceneChange. We connect \l QQuickWindow::beforeRendering() to
+ scene, the windowChanged signal is emitted. In our handler,
+ we connect \l QQuickWindow::beforeRendering() to
\c paint() to do the rendering, and \l
QQuickWindow::beforeSynchronizing() to \c sync() to copy the state
of the \c t property for the upcoming frame.
@@ -106,14 +106,14 @@
slots are invoked on the wrong thread with no OpenGL context
present.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 3
+ \snippet scenegraph/openglunderqml/squircle.cpp 3
The default behavior of the scene graph is to clear the
framebuffer before rendering. Since we render before the scene
graph, we need to turn this clearing off. This means that we need
to clear ourselves in the \c paint() function.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 4
+ \snippet scenegraph/openglunderqml/squircle.cpp 4
The first thing we do in the \c paint() function is to
initialize the shader program. By initializing the shader program
@@ -126,18 +126,18 @@
all rendering related operations must happen on the rendering
thread.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 5
+ \snippet scenegraph/openglunderqml/squircle.cpp 5
We use the shader program to draw the squircle. At the end of the
\c paint function we release the program and disable the
attributes we used so that the OpenGL context is in a "clean"
state for the scene graph to pick it up.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 6
+ \snippet scenegraph/openglunderqml/squircle.cpp 6
In the \c cleanup() function we delete the program.
- \snippet quick/scenegraph/openglunderqml/squircle.cpp 9
+ \snippet scenegraph/openglunderqml/squircle.cpp 9
We use the \c sync() function to copy the state of the
object in the GUI thread into the rendering thread.
@@ -146,20 +146,20 @@
thread is blocked, so it is safe to simply copy the value without
any additional protection.
- \snippet quick/scenegraph/openglunderqml/main.cpp 1
+ \snippet scenegraph/openglunderqml/main.cpp 1
The application's \c main() function instantiates a QQuickView and
launches the \c main.qml file. The only thing worth noting is that
we export the \c Squircle class to QML using the \l
qmlRegisterType() macro.
- \snippet quick/scenegraph/openglunderqml/main.qml 1
+ \snippet scenegraph/openglunderqml/main.qml 1
We import the Squircle QML type with the name we registered in the
\c main() function. We then instantiate it and create a running
- NumberAnimation on the its \c t property.
+ NumberAnimation on its \c t property.
- \snippet quick/scenegraph/openglunderqml/main.qml 2
+ \snippet scenegraph/openglunderqml/main.qml 2
Then we overlay a short descriptive text, so that it is clearly
visible that we are in fact rendering OpenGL under our Qt Quick
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp
index 84509fb615..8ceb9c5f9e 100644
--- a/examples/quick/scenegraph/openglunderqml/squircle.cpp
+++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp
@@ -51,6 +51,7 @@ Squircle::Squircle()
, m_t(0)
, m_thread_t(0)
{
+ connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(handleWindowChanged(QQuickWindow*)));
}
//! [7]
@@ -66,17 +67,11 @@ void Squircle::setT(qreal t)
}
//! [8]
-
//! [1]
-void Squircle::itemChange(ItemChange change, const ItemChangeData &)
+void Squircle::handleWindowChanged(QQuickWindow *win)
{
- // The ItemSceneChange event is sent when we are first attached to a window.
- if (change == ItemSceneChange) {
- QQuickWindow *win = window();
- if (!win)
- return;
+ if (win) {
//! [1]
-
// Connect the beforeRendering signal to our paint function.
// Since this call is executed on the rendering thread it must be
// a Qt::DirectConnection
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.h b/examples/quick/scenegraph/openglunderqml/squircle.h
index e292ca325f..449e02bbf1 100644
--- a/examples/quick/scenegraph/openglunderqml/squircle.h
+++ b/examples/quick/scenegraph/openglunderqml/squircle.h
@@ -61,14 +61,14 @@ public:
signals:
void tChanged();
-protected:
- void itemChange(ItemChange change, const ItemChangeData &);
-
public slots:
void paint();
void cleanup();
void sync();
+private slots:
+ void handleWindowChanged(QQuickWindow *win);
+
private:
QOpenGLShaderProgram *m_program;
diff --git a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
index 1529649798..5d83b9fa5f 100644
--- a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
+++ b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
@@ -47,7 +47,7 @@
material state is what we assign to each individual node, in this
case to give them different colors.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 1
+ \snippet scenegraph/simplematerial/simplematerial.cpp 1
The first thing we do when creating custom materials with the
simplified scheme is to create a state class. In this case the
@@ -55,7 +55,7 @@
compare function which the scene graph can use to reorder the node
rendering.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 2
+ \snippet scenegraph/simplematerial/simplematerial.cpp 2
Next we define the material shader, by subclassing a template
instantiation of \l QSGSimpleMaterialShader with our \c State.
@@ -74,21 +74,21 @@
classes. Using the same \c State class in multiple shaders will
will lead to undefined behavior.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 3
+ \snippet scenegraph/simplematerial/simplematerial.cpp 3
Next comes the declaration of the shader source code, where we
define a vertex and fragment shader. The simple material assumes
the presence of \c qt_Matrix in the vertex shader and \c
qt_Opacity in the fragment shader.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 4
+ \snippet scenegraph/simplematerial/simplematerial.cpp 4
We reimplement the \c attributes function to return the name of
the \c aVertex and \c aTexCoord attribute names. These attributes
will be mapped to attribute indices 0 and 1 in the node's
geometry.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 6
+ \snippet scenegraph/simplematerial/simplematerial.cpp 6
Uniforms can be accessed either by name or by index, where index
is faster than name, so we reimplement the \c resolveUniforms()
@@ -96,7 +96,7 @@
to worry about resolving \c qt_Opacity or \c qt_Matrix as these
are handled by the baseclass.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 5
+ \snippet scenegraph/simplematerial/simplematerial.cpp 5
The \c updateState() function is called once for every unique
state and we use it to update the shader program with the current
@@ -105,7 +105,7 @@
usecase, where all the colors are different, the updateState will
be called once for every node.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 7
+ \snippet scenegraph/simplematerial/simplematerial.cpp 7
The \c ColorNode class is supposed to draw something, so it needs
to be a subclass of \l QSGGeometryNode.
@@ -129,12 +129,12 @@
Finally, we tell the node to take ownership of the material, so we
do not have to explicitly memorymanage it.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 8
+ \snippet scenegraph/simplematerial/simplematerial.cpp 8
Since the Item is providing its own graphics to the scene graph,
we set the flag \l QQuickItem::ItemHasContents.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 9
+ \snippet scenegraph/simplematerial/simplematerial.cpp 9
Whenever the Item has changed graphically, the \l
QQuickItem::updatePaintNode() function is called.
@@ -157,23 +157,23 @@
state. Finally, we notify the scene graph that the node has
undergone changes to its geometry and material.
- \snippet quick/scenegraph/simplematerial/simplematerial.cpp 11
+ \snippet scenegraph/simplematerial/simplematerial.cpp 11
The \c main() function of the application adds the custom QML type
using \l qmlRegisterType() and opens up a \l QQuickView with our
QML file.
- \snippet quick/scenegraph/simplematerial/main.qml 1
+ \snippet scenegraph/simplematerial/main.qml 1
In the QML file, we import our custom type so we can instantiate
it.
- \snippet quick/scenegraph/simplematerial/main.qml 2
+ \snippet scenegraph/simplematerial/main.qml 2
Then we create a column of three instances of our custom item,
each with a different color.
- \snippet quick/scenegraph/simplematerial/main.qml 3
+ \snippet scenegraph/simplematerial/main.qml 3
And finally we overlay a short descriptive text.
diff --git a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
index b24b0bd97b..0917604a35 100644
--- a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
+++ b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/textureinsgnode
+ \example scenegraph/textureinsgnode
\title Scene Graph - Rendering FBOs
\ingroup qtquickexamples
diff --git a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
index 476605b268..6f4a2514f0 100644
--- a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
+++ b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/textureinthread
+ \example scenegraph/textureinthread
\title Scene Graph - Rendering FBOs in a thread
\ingroup qtquickexamples
diff --git a/examples/quick/scenegraph/textureinthread/error.qml b/examples/quick/scenegraph/textureinthread/error.qml
new file mode 100644
index 0000000000..1dbd576ef7
--- /dev/null
+++ b/examples/quick/scenegraph/textureinthread/error.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Text {
+ width: 400
+ height: 100
+ text: 'Platform does not support threaded OpenGL needed by this example.'
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+}
diff --git a/examples/quick/scenegraph/textureinthread/main.cpp b/examples/quick/scenegraph/textureinthread/main.cpp
index e415d254a1..801f1891b9 100644
--- a/examples/quick/scenegraph/textureinthread/main.cpp
+++ b/examples/quick/scenegraph/textureinthread/main.cpp
@@ -38,8 +38,13 @@
**
****************************************************************************/
+#include <QtCore/QThread>
+
#include <QGuiApplication>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
+
#include <QtQuick/QQuickView>
#include "threadrenderer.h"
@@ -48,12 +53,39 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
+ if (!QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ThreadedOpenGL)) {
+ QQuickView view;
+ view.setSource(QUrl("qrc:///scenegraph/textureinthread/error.qml"));
+ view.show();
+ return app.exec();
+ }
+
qmlRegisterType<ThreadRenderer>("SceneGraphRendering", 1, 0, "Renderer");
+ int execReturn = 0;
+
+ {
+ QQuickView view;
+
+ // Rendering in a thread introduces a slightly more complicated cleanup
+ // so we ensure that no cleanup of graphics resources happen until the
+ // application is shutting down.
+ view.setPersistentOpenGLContext(true);
+ view.setPersistentSceneGraph(true);
+
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:///scenegraph/textureinthread/main.qml"));
+ view.show();
+
+ execReturn = app.exec();
+ }
- QQuickView view;
- view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl("qrc:///scenegraph/textureinsgnode/main.qml"));
- view.show();
+ // As the render threads make use of our QGuiApplication object
+ // to clean up gracefully, wait for them to finish before
+ // QGuiApp is taken off the heap.
+ foreach (QThread *t, ThreadRenderer::threads) {
+ t->wait();
+ delete t;
+ }
- return app.exec();
+ return execReturn;
}
diff --git a/examples/quick/scenegraph/textureinthread/textureinthread.pro b/examples/quick/scenegraph/textureinthread/textureinthread.pro
index b48c2a1863..7f5fbb76e9 100644
--- a/examples/quick/scenegraph/textureinthread/textureinthread.pro
+++ b/examples/quick/scenegraph/textureinthread/textureinthread.pro
@@ -1,5 +1,8 @@
QT += quick
+# To make threaded gl check...
+QT += core-private gui-private
+
HEADERS += threadrenderer.h
SOURCES += threadrenderer.cpp main.cpp
@@ -13,4 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/textureinthread
INSTALLS += target
OTHER_FILES += \
- main.qml
+ main.qml \
+ error.qml
diff --git a/examples/quick/scenegraph/textureinthread/textureinthread.qrc b/examples/quick/scenegraph/textureinthread/textureinthread.qrc
index 9ecf0ada1c..66eb53b736 100644
--- a/examples/quick/scenegraph/textureinthread/textureinthread.qrc
+++ b/examples/quick/scenegraph/textureinthread/textureinthread.qrc
@@ -1,5 +1,6 @@
<RCC>
- <qresource prefix="/scenegraph/textureinsgnode">
+ <qresource prefix="/scenegraph/textureinthread">
<file>main.qml</file>
+ <file>error.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
index 90b6b49880..7de1d294ba 100644
--- a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
+++ b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
@@ -46,10 +46,13 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QOffscreenSurface>
#include <QtQuick/QQuickWindow>
#include <qsgsimpletexturenode.h>
+QList<QThread *> ThreadRenderer::threads;
/*
* The render thread shares a context with the scene graph and will
@@ -60,37 +63,39 @@ class RenderThread : public QThread
{
Q_OBJECT
public:
- RenderThread(const QSize &size)
+ RenderThread(const QSize &size, QOpenGLContext *context)
: m_renderFbo(0)
, m_displayFbo(0)
, m_logoRenderer(0)
+ , m_fakeSurface(0)
, m_size(size)
{
- // Since we're using queued connections, we need affinity to the rendering thread.
- moveToThread(this);
+ ThreadRenderer::threads << this;
// Set up the QOpenGLContext to use for rendering in this thread. It is sharing
// memory space with the GL context of the scene graph. This constructor is called
// during updatePaintNode, so we are currently on the scene graph thread with the
// scene graph's OpenGL context current.
- QOpenGLContext *current = QOpenGLContext::currentContext();
m_context = new QOpenGLContext();
- m_context->setShareContext(current);
- m_context->setFormat(current->format());
- m_context->create();
+ m_context->setShareContext(context);
+ m_context->setFormat(context->format());
m_context->moveToThread(this);
- // We need a non-visible surface to make current...
- m_fakeSurface = new QWindow();
- m_fakeSurface->setGeometry(0, 0, 64, 64);
- m_fakeSurface->setSurfaceType(QWindow::OpenGLSurface);
- m_fakeSurface->setFormat(current->format());
+ // We need a non-visible surface to make current in the other thread
+ // and QWindows must be created and managed on the GUI thread.
+ m_fakeSurface = new QOffscreenSurface();
+ m_fakeSurface->setFormat(context->format());
m_fakeSurface->create();
}
+ void setSurface(QOffscreenSurface *surface) { m_fakeSurface = surface; }
+
public slots:
void renderNext()
{
+ if (!m_context->isValid())
+ m_context->create();
+
m_context->makeCurrent(m_fakeSurface);
if (!m_renderFbo) {
@@ -119,6 +124,23 @@ public slots:
emit textureReady(m_displayFbo->texture(), m_size);
}
+ void shutDown()
+ {
+ m_context->makeCurrent(m_fakeSurface);
+ delete m_renderFbo;
+ delete m_displayFbo;
+ delete m_logoRenderer;
+ m_context->doneCurrent();
+ delete m_context;
+
+ // schedule this to be deleted only after we're done cleaning up
+ m_fakeSurface->deleteLater();
+
+ // Stop event processing, move the thread to GUI and make sure it is deleted.
+ exit();
+ moveToThread(QGuiApplication::instance()->thread());
+ }
+
signals:
void textureReady(int id, const QSize &size);
@@ -128,7 +150,7 @@ private:
LogoRenderer *m_logoRenderer;
- QWindow *m_fakeSurface;
+ QOffscreenSurface *m_fakeSurface;
QOpenGLContext *m_context;
QSize m_size;
};
@@ -209,19 +231,35 @@ private:
ThreadRenderer::ThreadRenderer()
+ : m_renderThread(0)
{
setFlag(ItemHasContents, true);
+ polish();
}
+void ThreadRenderer::updatePolish()
+{
+ if (!window() || !window()->openglContext())
+ return;
+ m_renderThread = new RenderThread(QSize(512, 512), window()->openglContext());
+ m_renderThread->moveToThread(m_renderThread);
+ m_renderThread->start();
+ connect(window(), SIGNAL(sceneGraphInvalidated()), m_renderThread, SLOT(shutDown()), Qt::QueuedConnection);
+}
QSGNode *ThreadRenderer::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
+ if (!m_renderThread) {
+ polish();
+ update();
+ return 0;
+ }
+
TextureNode *node = static_cast<TextureNode *>(oldNode);
if (!node) {
node = new TextureNode(window());
- m_renderThread = new RenderThread(QSize(512, 512));
/* Set up connections to get the production of FBO textures in sync with vsync on the
* rendering thread.
@@ -242,9 +280,6 @@ QSGNode *ThreadRenderer::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
connect(window(), SIGNAL(beforeRendering()), node, SLOT(prepareNode()), Qt::DirectConnection);
connect(node, SIGNAL(textureInUse()), m_renderThread, SLOT(renderNext()), Qt::QueuedConnection);
- // Start the render thread and enter let it process events.
- m_renderThread->start();
-
// Get the production of FBO textures started..
QMetaObject::invokeMethod(m_renderThread, "renderNext", Qt::QueuedConnection);
}
diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.h b/examples/quick/scenegraph/textureinthread/threadrenderer.h
index f12e6404e5..8c68e27d92 100644
--- a/examples/quick/scenegraph/textureinthread/threadrenderer.h
+++ b/examples/quick/scenegraph/textureinthread/threadrenderer.h
@@ -52,9 +52,15 @@ class ThreadRenderer : public QQuickItem
public:
ThreadRenderer();
+ static QList<QThread *> threads;
+
+public slots:
+ void updatePolish();
+
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
+
private:
RenderThread *m_renderThread;
};
diff --git a/examples/quick/shadereffects/doc/src/shadereffects.qdoc b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
index 5d1547a1fe..3d5f42eacc 100644
--- a/examples/quick/shadereffects/doc/src/shadereffects.qdoc
+++ b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
@@ -25,27 +25,27 @@
**
****************************************************************************/
/*!
- \title QML Examples - Shader Effects
+ \title Qt Quick Examples - Shader Effects
\example shadereffects
\image qml-shadereffects-example.png
\brief This is a shader effects example
\ingroup qtquickexamples
This example demonstrates a couple of visual effects that you can perform
- with shaders in QtQuick 2.0
+ with shaders in \l {Qt Quick}.
ShaderEffects typically operate on other types, using a ShaderEffectSource
- \snippet quick/shadereffects/shadereffects.qml source
+ \snippet shadereffects/shadereffects.qml source
In the above snippet, theItem is the id of a complex QML object in the file.
ShaderEffects can use this ShaderEffectSource as a texture in their fragment shader.
- \snippet quick/shadereffects/shadereffects.qml fragment
+ \snippet shadereffects/shadereffects.qml fragment
You can use any custom property on the ShaderEffect in your shader. This makes
animated shader code very easy.
- \snippet quick/shadereffects/shadereffects.qml properties
+ \snippet shadereffects/shadereffects.qml properties
ShaderEffects can also have a custom vertext shader. Setting the mesh property on ShaderEffect
provides more vertices for you to manipulate, enabling many effects.
- \snippet quick/shadereffects/shadereffects.qml vertex
+ \snippet shadereffects/shadereffects.qml vertex
*/
diff --git a/examples/quick/window/screen/screenInfo.qml b/examples/quick/shared/TabSet.qml
index 8f60d83933..10263a70ac 100644
--- a/examples/quick/window/screen/screenInfo.qml
+++ b/examples/quick/shared/TabSet.qml
@@ -39,52 +39,63 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0 as Window
Item {
- id: root
- width: 400
- height: 200
- Item {
- id: main
- state: "orientation " + Window.Screen.orientation
+ id: tabWidget
- property bool landscapeWindow: Window.Screen.primaryOrientation == Qt.LandscapeOrientation
- property real baseWidth: landscapeWindow ? root.height : root.width
- property real baseHeight: landscapeWindow ? root.width : root.height
- property real rotationDelta: landscapeWindow ? -90 : 0
+ // Setting the default property to stack.children means any child items
+ // of the TabWidget are actually added to the 'stack' item's children.
+ // See the "Property Binding"
+ // documentation for details on default properties.
+ default property alias content: stack.children
- rotation: rotationDelta
- width: main.baseWidth
- height: main.baseHeight
- anchors.centerIn: parent
+ property int current: 0
- Text {
- text: "Screen is " + Window.Screen.width + "x" + Window.Screen.height + " and primarily orientation " + Window.Screen.primaryOrientation
- anchors.centerIn:parent
- }
+ onCurrentChanged: setZOrders()
+ Component.onCompleted: setZOrders()
+ function setZOrders() {
+ for (var i = 0; i < stack.children.length; ++i)
+ stack.children[i].z = (i == current ? 1 : 0)
+ }
- states: [
- State {
- name: "orientation " + Qt.LandscapeOrientation
- PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
- },
- State {
- name: "orientation " + Qt.InvertedPortraitOrientation
- PropertyChanges { target: main; rotation: 180 + rotationDelta; }
- },
- State {
- name: "orientation " + Qt.InvertedLandscapeOrientation
- PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
- }
- ]
+ Row {
+ id: header
- transitions: Transition {
- SequentialAnimation {
- RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
- NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
+ Repeater {
+ model: stack.children.length
+ delegate: Rectangle {
+ width: tabWidget.width / stack.children.length; height: 36
+
+ Rectangle {
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+ BorderImage {
+ anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
+ border { left: 7; right: 7 }
+ source: "images/tab.png"
+ visible: tabWidget.current == index
+ }
+ Text {
+ horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ font.bold: tabWidget.current == index
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tabWidget.current = index
+ }
}
}
}
+
+ Item {
+ id: stack
+ width: tabWidget.width
+ anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
+ }
}
diff --git a/examples/quick/shared/images/qt-logo.png b/examples/quick/shared/images/qt-logo.png
new file mode 100644
index 0000000000..7d3e97eb36
--- /dev/null
+++ b/examples/quick/shared/images/qt-logo.png
Binary files differ
diff --git a/examples/quick/shared/images/tab.png b/examples/quick/shared/images/tab.png
new file mode 100644
index 0000000000..ad8021605f
--- /dev/null
+++ b/examples/quick/shared/images/tab.png
Binary files differ
diff --git a/examples/quick/shared/qmldir b/examples/quick/shared/qmldir
index cc4eb3c793..4f7c50540d 100644
--- a/examples/quick/shared/qmldir
+++ b/examples/quick/shared/qmldir
@@ -3,3 +3,4 @@ CheckBox 2.1 CheckBox.qml
LauncherList 2.0 LauncherList.qml
SimpleLauncherDelegate 2.0 SimpleLauncherDelegate.qml
Slider 2.0 Slider.qml
+TabSet 2.1 TabSet.qml
diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h
index eab15f3e0a..c59e858d47 100644
--- a/examples/quick/shared/shared.h
+++ b/examples/quick/shared/shared.h
@@ -47,9 +47,9 @@
QQuickView view;\
view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
view.setSource(QUrl("qrc:///" #NAME ".qml")); \
+ view.setResizeMode(QQuickView::SizeRootObjectToView);\
if (QGuiApplication::platformName() == QLatin1String("qnx") || \
QGuiApplication::platformName() == QLatin1String("eglfs")) {\
- view.setResizeMode(QQuickView::SizeRootObjectToView);\
view.showFullScreen();\
} else {\
view.show();\
diff --git a/examples/quick/shared/shared.qrc b/examples/quick/shared/shared.qrc
index 0b574ac879..6aaeca5211 100644
--- a/examples/quick/shared/shared.qrc
+++ b/examples/quick/shared/shared.qrc
@@ -6,7 +6,11 @@
<file>Slider.qml</file>
<file>images/slider_handle.png</file>
<file>CheckBox.qml</file>
+ <file>TabSet.qml</file>
<file>images/back.png</file>
<file>images/next.png</file>
+ <file>images/qt-logo.png</file>
+ <file>images/checkmark.png</file>
+ <file>images/tab.png</file>
</qresource>
</RCC>
diff --git a/examples/quick/text/doc/src/text.qdoc b/examples/quick/text/doc/src/text.qdoc
index 1f173ac843..c93d2db8aa 100644
--- a/examples/quick/text/doc/src/text.qdoc
+++ b/examples/quick/text/doc/src/text.qdoc
@@ -25,7 +25,7 @@
**
****************************************************************************/
/*!
- \title QML Examples - Text
+ \title Qt Quick Examples - Text
\example text
\brief This is a collection of QML examples relating to text
\image qml-text-example.png
@@ -38,24 +38,24 @@
'Hello' shows how to change and animate the letter spacing of a Text type.
It uses a sequential animation to first animate the font.letterSpacing property
from 0 to 50 over 3 seconds and then move the text to a random position on screen:
- \snippet quick/text/fonts/hello.qml letterspacing
+ \snippet text/fonts/hello.qml letterspacing
'Fonts' shows different ways of using fonts with the Text type.
Simply by name, using the font.family property directly:
- \snippet quick/text/fonts/fonts.qml name
+ \snippet text/fonts/fonts.qml name
or using a FontLoader type:
- \snippet quick/text/fonts/fonts.qml fontloader
+ \snippet text/fonts/fonts.qml fontloader
or using a FontLoader and specifying a local font file:
- \snippet quick/text/fonts/fonts.qml fontloaderlocal
+ \snippet text/fonts/fonts.qml fontloaderlocal
or finally using a FontLoader and specifying a remote font file:
- \snippet quick/text/fonts/fonts.qml fontloaderremote
+ \snippet text/fonts/fonts.qml fontloaderremote
'Available Fonts' shows how to use the QML global Qt object and a list view
to display all the fonts available on the system.
The ListView type uses the list of fonts available as its model:
- \snippet quick/text/fonts/availableFonts.qml model
+ \snippet text/fonts/availableFonts.qml model
Inside the delegate, the font family is set with the modelData:
- \snippet quick/text/fonts/availableFonts.qml delegate
+ \snippet text/fonts/availableFonts.qml delegate
'Banner' is a simple example showing how to create a banner using a row of text
types and a NumberAnimation.
@@ -66,5 +66,5 @@
'Text Layout' shows how to create a more complex layout for a text item.
This example lays out the text in two columns using the onLineLaidOut handler
that allows you to position and resize each line:
- \snippet quick/text/styledtext-layout.qml layout
+ \snippet text/styledtext-layout.qml layout
*/
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp
index 52c2c17cfe..04545fe830 100644
--- a/examples/quick/textureprovider/etcprovider.cpp
+++ b/examples/quick/textureprovider/etcprovider.cpp
@@ -121,6 +121,10 @@ void EtcTexture::bind()
"paddedWidth: " << m_paddedSize.width() << "paddedHeight: " << m_paddedSize.height();
#endif
+#ifndef QT_NO_DEBUG
+ while (glGetError() != GL_NO_ERROR) { }
+#endif
+
QOpenGLContext *ctx = QOpenGLContext::currentContext();
Q_ASSERT(ctx != 0);
ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES,
@@ -128,6 +132,7 @@ void EtcTexture::bind()
(m_paddedSize.width() * m_paddedSize.height()) >> 1,
m_data.data() + 16);
+#ifndef QT_NO_DEBUG
// Gracefully fail in case of an error...
GLuint error = glGetError();
if (error != GL_NO_ERROR) {
@@ -137,6 +142,7 @@ void EtcTexture::bind()
m_texture_id = 0;
return;
}
+#endif
m_uploaded = true;
updateBindOptions(true);
diff --git a/examples/quick/threading/doc/src/threading.qdoc b/examples/quick/threading/doc/src/threading.qdoc
index 71fcdf820b..1cced3b9d3 100644
--- a/examples/quick/threading/doc/src/threading.qdoc
+++ b/examples/quick/threading/doc/src/threading.qdoc
@@ -33,17 +33,17 @@
Threaded ListModel contains a ListView and a ListModel. The ListModel is updated asynchronusly in another thread, and the results propagate back to the main thread.
A timer requests updates from the worker thread periodically:
- \snippet quick/threading/threadedlistmodel/timedisplay.qml 0
+ \snippet threading/threadedlistmodel/timedisplay.qml 0
Inside the worker thread, the ListModel is synchronized once the data is finished loading:
- \snippet quick/threading/threadedlistmodel/dataloader.js 0
+ \snippet threading/threadedlistmodel/dataloader.js 0
WorkerScript contains an example of using a WorkerScript to offload expensive calculations into another thread. This keeps the UI from being blocked. This example calculates numbers in Pascal's Triangle, and not in a very optimal way, so it will often take several seconds to complete the calculation. By doing this in a WorkerScript in another thread, the UI is not blocked during this time.
When the UI needs another value, a request is sent to the WorkerScript:
- \snippet quick/threading/workerscript/workerscript.qml 0
+ \snippet threading/workerscript/workerscript.qml 0
The workerscript then is free to take a really long time to calculate it:
- \snippet quick/threading/workerscript/workerscript.js 0
+ \snippet threading/workerscript/workerscript.js 0
When it's done, the result returns to the main scene via the WorkerScript type:
- \snippet quick/threading/workerscript/workerscript.qml 1
+ \snippet threading/workerscript/workerscript.qml 1
*/
diff --git a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
index 164409076c..09a5f51105 100644
--- a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
+++ b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
@@ -34,21 +34,21 @@
Multipoint Flames demonstrates distinguishing different fingers in a MultiPointTouchArea, by assigning a different colored flame to each touch point.
The MultipointTouchArea sets up multiple touch points:
- \snippet quick/touchinteraction/multipointtouch/multiflame.qml 0
+ \snippet touchinteraction/multipointtouch/multiflame.qml 0
The flames are then simply bound to the coordiates of the touch point, and whether it is currently pressed, like so:
- \snippet quick/touchinteraction/multipointtouch/multiflame.qml 1
+ \snippet touchinteraction/multipointtouch/multiflame.qml 1
Bear-Whack demonstrates using a MultiPointTouchArea to add multiple finger support to a simple game. The interaction with the game
is done through a SpriteGoal that follows the TouchPoint. The TouchPoints added to the MultiPointTouchArea are a component with all
this logic embedded into it:
- \snippet quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml 0
+ \snippet touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml 0
Flick Resize uses a PinchArea to allow Pinch-to-Resize behavior. This is easily achieved just by listening to the PinchArea signals and responding
to user input.
- \snippet quick/touchinteraction/pincharea/flickresize.qml 0
+ \snippet touchinteraction/pincharea/flickresize.qml 0
Flickable is a simple example demonstrating the Flickable type. The object inside the flickable is very big, but the flickable itself is very small:
- \snippet quick/touchinteraction/flickable/basic-flickable.qml 0
+ \snippet touchinteraction/flickable/basic-flickable.qml 0
Corkboards shows a more complex Flickable usecase, with types on the flickable that respond to mouse and keyboard interaction.
This doesn't require special code, the Qt Quick types automatically cooperate with Flickable for accepting the touch events.
diff --git a/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc b/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
index 1ebe7eb9f5..3a14dd465a 100644
--- a/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
+++ b/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
@@ -28,7 +28,7 @@
/*!
\page qmlexampletoggleswitch.html tutorial
-\title QML Example - Toggle Switch
+\title Qt Quick Examples - Toggle Switch
\brief A reusable switch component made in QML
\ingroup qtquickexamples
@@ -48,12 +48,12 @@ The objects that compose the switch are:
\endlist
\section1 Switch.qml
-\snippet quick/ui-components/slideswitch/content/Switch.qml 0
+\snippet ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet quick/ui-components/slideswitch/content/Switch.qml 1
+\snippet ui-components/slideswitch/content/Switch.qml 1
This property is the interface of the switch. By default, the switch is off and this property is \c false.
It can be used to activate/disactivate the switch or to query its current state.
@@ -76,14 +76,14 @@ Item {
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet quick/ui-components/slideswitch/content/Switch.qml 4
+\snippet ui-components/slideswitch/content/Switch.qml 4
First, we create the background image of the switch.
In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
\c toggle() function. We will see what this function does in a moment.
-\snippet quick/ui-components/slideswitch/content/Switch.qml 5
+\snippet ui-components/slideswitch/content/Switch.qml 5
Then, we place the image of the knob on top of the background.
The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
@@ -91,7 +91,7 @@ property of the \c MouseArea is for. We also want to toggle the switch if the kn
in the \c dorelease() function that is called in the \c onReleased property.
\section2 States
-\snippet quick/ui-components/slideswitch/content/Switch.qml 6
+\snippet ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -105,13 +105,13 @@ For more information on states see \l{Qt Quick States}.
We add two JavaScript functions to our switch:
-\snippet quick/ui-components/slideswitch/content/Switch.qml 2
+\snippet ui-components/slideswitch/content/Switch.qml 2
This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
states (\e on and \e off).
-\snippet quick/ui-components/slideswitch/content/Switch.qml 3
+\snippet ui-components/slideswitch/content/Switch.qml 3
This second function is called when the knob is released and we want to make sure that the knob does not end up between states
(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
@@ -119,7 +119,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{Using JavaScript Expressions in QML}.
\section2 Transition
-\snippet quick/ui-components/slideswitch/content/Switch.qml 7
+\snippet ui-components/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
In order for the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -128,5 +128,5 @@ For more information on transitions see \l{Animation and Transitions in Qt Quick
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet quick/ui-components/slideswitch/slideswitch.qml 0
+\snippet ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/examples/quick/views/doc/src/views.qdoc b/examples/quick/views/doc/src/views.qdoc
index cc8112f4dd..2d664c9bd9 100644
--- a/examples/quick/views/doc/src/views.qdoc
+++ b/examples/quick/views/doc/src/views.qdoc
@@ -32,51 +32,51 @@
\image qml-modelviews-example.png
\ingroup qtquickexamples
- This is a collection of small QML examples relating to model and view functionality. They demonstrate how to show data from a model using the QtQuick view types.
+ This is a collection of small QML examples relating to model and view functionality. They demonstrate how to show data from a model using the \l {Qt Quick} view types.
\section2 GridView and PathView demonstrate usage of these types to display views.
- \snippet quick/views/gridview/gridview-example.qml 0
+ \snippet views/gridview/gridview-example.qml 0
\section2 Dynamic List demonstrates animation of runtime additions and removals to a ListView.
The ListView.onAdd signal handler runs an animation when new items are added to the
view, and the ListView.onRemove another when they are removed.
- \snippet quick/views/listview/dynamiclist.qml 0
- \snippet quick/views/listview/dynamiclist.qml 1
+ \snippet views/listview/dynamiclist.qml 0
+ \snippet views/listview/dynamiclist.qml 1
\section2 Expanding Delegates demonstrates delegates that expand when activated.
It has a complex delegate the size and appearance of which can change, displacing
other items in the view.
- \snippet quick/views/listview/expandingdelegates.qml 0
- \snippet quick/views/listview/expandingdelegates.qml 1
- \snippet quick/views/listview/expandingdelegates.qml 2
- \snippet quick/views/listview/expandingdelegates.qml 3
+ \snippet views/listview/expandingdelegates.qml 0
+ \snippet views/listview/expandingdelegates.qml 1
+ \snippet views/listview/expandingdelegates.qml 2
+ \snippet views/listview/expandingdelegates.qml 3
\section2 Highlight demonstrates adding a custom highlight to a ListView.
- \snippet quick/views/listview/highlight.qml 0
+ \snippet views/listview/highlight.qml 0
\section2 Highlight Ranges shows the three different highlight range modes of ListView.
- \snippet quick/views/listview/highlightranges.qml 0
- \snippet quick/views/listview/highlightranges.qml 1
- \snippet quick/views/listview/highlightranges.qml 2
+ \snippet views/listview/highlightranges.qml 0
+ \snippet views/listview/highlightranges.qml 1
+ \snippet views/listview/highlightranges.qml 2
\section2 Sections demonstrates the various section headers and footers available to ListView.
- \snippet quick/views/listview/sections.qml 0
+ \snippet views/listview/sections.qml 0
\section2 Packages demonstrates using Packages to transition delegates between two views.
It has a Package which defines delegate items for each view and an item that can
be transferred between delegates.
- \snippet quick/views/package/Delegate.qml 0
+ \snippet views/package/Delegate.qml 0
A DelegateModel allows the individual views to access their specific items from
the shared package delegate.
- \snippet quick/views/package/view.qml 0
+ \snippet views/package/view.qml 0
\section2 ObjectModel uses an ObjectModel for the model instead of a ListModel.
- \snippet quick/views/visualitemmodel/visualitemmodel.qml 0
+ \snippet views/objectmodel/objectmodel.qml 0
*/
diff --git a/examples/quick/window/window/twowindows.qml b/examples/quick/window/ScreenInfo.qml
index 4a8d2f4f1b..e4abc8d69d 100644
--- a/examples/quick/window/window/twowindows.qml
+++ b/examples/quick/window/ScreenInfo.qml
@@ -38,52 +38,58 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Window 2.0
+import QtQuick 2.1
+import QtQuick.Window 2.1
-QtObject {
- property var win1: Window {
- width: 320
- height: 240
- x: 0
- y: 0
- visible: true
- color: "#ccffff"
- title: "First Window"
- Text {
- anchors.centerIn: parent
- text: "First Window"
- Text {
- id: statusText
- anchors.top: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
- MouseArea {
- anchors.fill: parent
- onClicked: win2.visible = !win2.visible
+Item {
+ id: root
+ width: 400
+ height: propertyGrid.implicitHeight + 16
+
+ function orientationToString(o) {
+ switch (o) {
+ case Qt.PrimaryOrientation:
+ return "primary";
+ case Qt.PortraitOrientation:
+ return "portrait";
+ case Qt.LandscapeOrientation:
+ return "landscape";
+ case Qt.InvertedPortraitOrientation:
+ return "inverted portrait";
+ case Qt.InvertedLandscapeOrientation:
+ return "inverted landscape";
}
+ return "unknown";
}
- property var win2: Window {
- width: 320
- height: 240
- x: 220
- y: 120
- visible: true
- color: "green"
- title: "Second Window: " + color
- Rectangle {
- anchors.fill: parent
- anchors.margins: 10
- Text {
- anchors.centerIn: parent
- text: "Second Window"
- }
- MouseArea {
- anchors.fill: parent
- onClicked: win2.color = "#ffffcc"
- }
+
+ Grid {
+ id: propertyGrid
+ columns: 2
+ spacing: 8
+ x: spacing
+ y: spacing
+
+ //! [screen]
+ Text {
+ text: "Screen \"" + Screen.name + "\":"
+ font.bold: true
}
- onVisibleChanged: statusText.text = "second window is " + (visible ? "visible" : "invisible")
+ Item { width: 1; height: 1 } // spacer
+
+ Text { text: "dimensions" }
+ Text { text: Screen.width + "x" + Screen.height }
+
+ Text { text: "logical pixel density" }
+ Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm" }
+
+ Text { text: "available virtual desktop" }
+ Text { text: Screen.desktopAvailableWidth + "x" + Screen.desktopAvailableHeight }
+
+ Text { text: "orientation" }
+ Text { text: orientationToString(Screen.orientation) + " (" + Screen.orientation + ")" }
+
+ Text { text: "primary orientation" }
+ Text { text: orientationToString(Screen.primaryOrientation) + " (" + Screen.primaryOrientation + ")" }
+ //! [screen]
}
}
diff --git a/examples/quick/window/Splash.qml b/examples/quick/window/Splash.qml
new file mode 100644
index 0000000000..c981bd2585
--- /dev/null
+++ b/examples/quick/window/Splash.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.1
+
+//! [splash-properties]
+Window {
+ id: splash
+ visible: true
+ width: splashImage.width
+ height: splashImage.height
+ color: "transparent"
+ title: "Splash Window"
+ modality: Qt.ApplicationModal
+ flags: Qt.SplashScreen
+ property int timeoutInterval: 2000
+ signal timeout
+//! [splash-properties]
+//! [screen-properties]
+ x: (Screen.width - splashImage.width) / 2
+ y: (Screen.height - splashImage.height) / 2
+//! [screen-properties]
+
+ Image {
+ id: splashImage
+ source: "../../shared/images/qt-logo.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ //! [timer]
+ Timer {
+ interval: timeoutInterval; running: true; repeat: false
+ onTriggered: {
+ visible = false
+ splash.timeout()
+ }
+ }
+ //! [timer]
+}
diff --git a/examples/quick/window/doc/images/qml-window-example.png b/examples/quick/window/doc/images/qml-window-example.png
new file mode 100644
index 0000000000..72487b4d93
--- /dev/null
+++ b/examples/quick/window/doc/images/qml-window-example.png
Binary files differ
diff --git a/examples/quick/window/doc/src/window.qdoc b/examples/quick/window/doc/src/window.qdoc
new file mode 100644
index 0000000000..07d2f115c1
--- /dev/null
+++ b/examples/quick/window/doc/src/window.qdoc
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \title Qt Quick Examples - Window and Screen
+ \example window
+ \brief This example demonstrates the Window and Screen types in QML
+ \image qml-window-example.png
+ \ingroup qtquickexamples
+
+ This example shows you how to create a Window in QML, how to control its
+ \l {QQuickWindow::visibility} {visibility}, how to present a splash screen
+ during application startup, and how to access the properties of the
+ \l Screen. It also demonstrates how to package QML into
+ \l {The Qt Resource System} {resources} and provide an
+ \l {Setting the Application Icon} {icon} to create a standalone QML desktop application.
+
+ A splash screen can be created with the \l {Qt::SplashScreen} {Qt.SplashScreen} flag,
+ and should be \l {Qt::ApplicationModal} {ApplicationModal} to prevent interaction
+ with the main window. If the splash window is also transparent, and showing a
+ partially transparent image, then it will look like a shaped window.
+ \snippet window/Splash.qml splash-properties
+
+ In this example a \l Timer will automatically dismiss the splash screen,
+ but in a real application you might want to connect to a signal from the
+ application logic to hide the splash when initialization is complete.
+ \snippet window/Splash.qml timer
+
+ The main window in this example is the control window, with some buttons
+ and checkboxes to control and provide feedback on the state of a secondary
+ window. Each checkbox has a binding to the property whose state it is
+ displaying, and also an onClicked handler to change the state. This is the
+ typical pattern to create a two-way binding while avoiding binding loops.
+ \snippet window/window.qml windowedCheckbox
+
+ The \l Screen has several properties which are generally useful to applications
+ which need to rotate some content when the screen orientation changes, to position
+ windows on the screen or to convert real units to logical pixel units. ScreenInfo.qml
+ (which is displayed inline in window.qml, or can be run by itself with qmlscene)
+ simply displays the property values, while the splash screen uses them to
+ center the window on the screen.
+ \snippet window/Splash.qml screen-properties
+
+ If a Window is nested inside an \l Item or another Window, the inner window
+ becomes "transient for" the outer one (see \l Window for more explanation).
+ But if you want to create multiple top-level windows as unrelated peers, you
+ can create them inside a non-visual \l QtObject root item, as this example does.
+*/
diff --git a/examples/quick/window/window/window.cpp b/examples/quick/window/main.cpp
index 277effc20c..7872c7183c 100644
--- a/examples/quick/window/window/window.cpp
+++ b/examples/quick/window/main.cpp
@@ -41,6 +41,7 @@
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
+#include <QtQuick/QQuickWindow>
#include <QtCore/QUrl>
#include <QDebug>
@@ -49,7 +50,8 @@ int main(int argc, char* argv[])
QGuiApplication app(argc, argv);
QQmlEngine engine;
QQmlComponent component(&engine);
- component.loadUrl(QUrl("qrc:///window/window/Window.qml"));
+ QQuickWindow::setDefaultAlphaBuffer(true);
+ component.loadUrl(QUrl("qrc:///window/window.qml"));
if ( component.isReady() )
component.create();
else
diff --git a/examples/quick/window/resources/icon.icns b/examples/quick/window/resources/icon.icns
new file mode 100644
index 0000000000..88b4b24449
--- /dev/null
+++ b/examples/quick/window/resources/icon.icns
Binary files differ
diff --git a/examples/quick/window/resources/icon.ico b/examples/quick/window/resources/icon.ico
new file mode 100644
index 0000000000..52af30a6ca
--- /dev/null
+++ b/examples/quick/window/resources/icon.ico
Binary files differ
diff --git a/examples/quick/window/resources/icon.svg b/examples/quick/window/resources/icon.svg
new file mode 100644
index 0000000000..0b6153206d
--- /dev/null
+++ b/examples/quick/window/resources/icon.svg
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.48.2 r9819"
+ version="1.0"
+ sodipodi:docname="icon.svg"
+ inkscape:export-filename="/Users/rutledge/dev/qt5-stable/qtdeclarative/examples/quick/window/window/icon80.png"
+ inkscape:export-xdpi="61.509998"
+ inkscape:export-ydpi="61.509998"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient4009">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4011" />
+ <stop
+ id="stop4019"
+ offset="0.875"
+ style="stop-color:#ffffff;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop4013" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 186.64798 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="559.62469 : 186.64798 : 1"
+ inkscape:persp3d-origin="279.81235 : 124.43199 : 1"
+ id="perspective4876" />
+ <inkscape:perspective
+ id="perspective2836"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 22 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <filter
+ inkscape:collect="always"
+ id="filter4063"
+ x="-0.195491"
+ width="1.390982"
+ y="-0.16235915"
+ height="1.3247183">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.3077485"
+ id="feGaussianBlur4065" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10"
+ guidetolerance="10"
+ objecttolerance="10000"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.9775825"
+ inkscape:cx="62.656189"
+ inkscape:cy="42.423381"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1280"
+ inkscape:window-height="744"
+ inkscape:window-x="2003"
+ inkscape:window-y="156"
+ showgrid="true"
+ borderlayer="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:snap-global="false"
+ inkscape:window-maximized="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid7194"
+ visible="true"
+ enabled="true"
+ spacingx="8px"
+ spacingy="8px" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-66.38047,-391.3222)">
+ <path
+ id="path7304"
+ d="M 95.556318,434.65407 L 165.25811,434.65407 L 165.25811,490.10429 L 95.556318,490.10429 L 95.556318,434.65407 z"
+ style="fill:#01afaf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141000000000;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ style="fill:#a7c706;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 96.869177,465.30846 c 27.677903,3.04574 41.155393,12.11589 48.000003,24 l -48.000003,0 0,-24 z"
+ id="path7300"
+ sodipodi:nodetypes="cccc"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path7302"
+ d="M 165.46767,465.22201 C 137.78977,468.26775 124.31228,477.33791 117.46767,489.22201 L 165.46767,489.22201 L 165.46767,465.22201 z"
+ style="fill:#966406;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1" />
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:1;fill-opacity:1"
+ d="M 95.532809,434.35736 L 74.567964,420.38079 L 74.567964,497.25189 L 95.532809,490.26361 L 95.532809,434.35736 z"
+ id="path7270"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#00ffff;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 74.567964,455.3222 L 95.532809,462.31048"
+ id="path7272"
+ sodipodi:nodetypes="cc" />
+ <g
+ style="fill:#80ffff;fill-opacity:1"
+ id="g7278"
+ transform="matrix(-0.8735352,0,0,0.8735352,244.36615,64.570513)">
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
+ d="M 24,32 L 0,16 L 0,104 L 24,96 L 24,32 z"
+ id="path7280"
+ transform="translate(66.38047,391.3222)" />
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
+ d="M 0,56 L 24,64"
+ id="path7282"
+ transform="translate(66.38047,391.3222)"
+ sodipodi:nodetypes="cc" />
+ </g>
+ <path
+ style="fill:#ffffff;fill-opacity:1;filter:url(#filter4063)"
+ d="m 119.74679,437.94232 c -0.0487,0.003 -0.0932,0.0315 -0.14149,0.0354 -0.1659,0.0132 -0.33372,0.008 -0.49523,0.0354 -0.96156,0.0643 -1.9037,0.14607 -2.86523,0.21224 -2.94807,0.23566 -5.19987,2.66253 -5.19987,6.01345 l 0,39.51194 3.32508,3.07747 0,-0.0354 33.2155,-5.58898 c 2.28673,-0.39587 4.06792,-3.06727 4.06792,-5.97808 l 0,-32.18967 -30.5625,-5.023 c -0.45263,-0.0748 -0.91269,-0.0942 -1.34418,-0.0708 z"
+ id="path3987"
+ inkscape:connector-curvature="0" />
+ <g
+ id="g3"
+ transform="matrix(0.20572087,0,0,0.20572087,113.4162,440.80626)">
+ <path
+ sodipodi:nodetypes="cccccccc"
+ id="path5"
+ style="fill:#006225"
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path7"
+ style="fill:#80c342"
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path11"
+ style="fill:#006225"
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path13"
+ style="fill:#006225"
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z"
+ style="fill:#ffffff"
+ id="path17"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path19"
+ style="fill:#006225"
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z"
+ style="fill:#006225"
+ id="path21"
+ inkscape:connector-curvature="0" />
+ </g>
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 96.506224,434.65407 L 166.20801,434.65407 L 166.20801,490.10429 L 96.506224,490.10429 L 96.506224,434.65407 z"
+ id="rect7265" />
+ </g>
+</svg>
diff --git a/examples/quick/window/resources/icon64.png b/examples/quick/window/resources/icon64.png
new file mode 100644
index 0000000000..0fa324401f
--- /dev/null
+++ b/examples/quick/window/resources/icon64.png
Binary files differ
diff --git a/examples/quick/window/resources/window.rc b/examples/quick/window/resources/window.rc
new file mode 100644
index 0000000000..4de84d297e
--- /dev/null
+++ b/examples/quick/window/resources/window.rc
@@ -0,0 +1,32 @@
+#include "winver.h"
+
+IDI_ICON1 ICON DISCARDABLE "icon.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGS 0x0L
+ FILEFLAGSMASK 0x3fL
+ FILEOS 0x00040004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "CompanyName", "Digia Plc and/or its subsidiary(-ies)"
+ VALUE "FileDescription", "QtQuick Window Example"
+ VALUE "FileVersion", "1.0.0.0"
+ VALUE "LegalCopyright", "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies)."
+ VALUE "InternalName", "window"
+ VALUE "OriginalFilename", "window.exe"
+ VALUE "ProductName", "QtQuick Window Example"
+ VALUE "ProductVersion", "1.0.0.0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/examples/quick/window/window.pro b/examples/quick/window/window.pro
index 93e43fcd65..be35b24325 100644
--- a/examples/quick/window/window.pro
+++ b/examples/quick/window/window.pro
@@ -1,6 +1,16 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- window
+TEMPLATE = app
+QT += quick qml
+SOURCES += main.cpp
+RESOURCES += \
+ window.qrc \
+ ../shared/shared.qrc
EXAMPLE_FILES = \
- screen
+ window.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/window
+INSTALLS += target
+
+ICON = resources/icon64.png
+macx: ICON = resources/icon.icns
+win32: RC_FILE = resources/window.rc
diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml
new file mode 100644
index 0000000000..67e2ba40ff
--- /dev/null
+++ b/examples/quick/window/window.qml
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.1
+import "../shared" as Shared
+
+QtObject {
+ property real defaultSpacing: 10
+ property SystemPalette palette: SystemPalette { }
+
+ property var controlWindow: Window {
+ width: 400
+ height: col.implicitHeight + defaultSpacing * 2
+ color: palette.window
+ title: "Control Window"
+ Column {
+ id: col
+ anchors.fill: parent
+ anchors.margins: defaultSpacing
+ spacing: defaultSpacing
+ property real cellWidth: col.width / 3 - spacing
+ Text { text: "Control the second window:" }
+ Grid {
+ id: grid
+ columns: 3
+ spacing: defaultSpacing
+ width: parent.width
+ Shared.Button {
+ id: showButton
+ width: col.cellWidth
+ text: testWindow.visible ? "Hide" : "Show"
+ onClicked: testWindow.visible = !testWindow.visible
+ }
+ //! [windowedCheckbox]
+ Shared.CheckBox {
+ text: "Windowed"
+ height: showButton.height
+ width: col.cellWidth
+ Binding on checked { value: testWindow.visibility === Window.Windowed }
+ onClicked: testWindow.visibility = Window.Windowed
+ }
+ //! [windowedCheckbox]
+ Shared.CheckBox {
+ height: showButton.height
+ width: col.cellWidth
+ text: "Full Screen"
+ Binding on checked { value: testWindow.visibility === Window.FullScreen }
+ onClicked: testWindow.visibility = Window.FullScreen
+ }
+ Shared.Button {
+ id: autoButton
+ width: col.cellWidth
+ text: "Automatic"
+ onClicked: testWindow.visibility = Window.AutomaticVisibility
+ }
+ Shared.CheckBox {
+ height: autoButton.height
+ text: "Minimized"
+ Binding on checked { value: testWindow.visibility === Window.Minimized }
+ onClicked: testWindow.visibility = Window.Minimized
+ }
+ Shared.CheckBox {
+ height: autoButton.height
+ text: "Maximized"
+ Binding on checked { value: testWindow.visibility === Window.Maximized }
+ onClicked: testWindow.visibility = Window.Maximized
+ }
+ }
+ function visibilityToString(v) {
+ switch (v) {
+ case Window.Windowed:
+ return "windowed";
+ case Window.Minimized:
+ return "minimized";
+ case Window.Maximized:
+ return "maximized";
+ case Window.FullScreen:
+ return "fullscreen";
+ case Window.AutomaticVisibility:
+ return "automatic";
+ case Window.Hidden:
+ return "hidden";
+ }
+ return "unknown";
+ }
+ Text {
+ text: "second window is " + (testWindow.visible ? "visible" : "invisible") +
+ " and has visibility " + parent.visibilityToString(testWindow.visibility)
+ }
+ Rectangle {
+ id: horizontalRule
+ color: "black"
+ width: parent.width
+ height: 1
+ }
+ ScreenInfo { }
+ }
+ }
+
+ property var testWindow: Window {
+ width: 320
+ height: 240
+ color: "#215400"
+ title: "Test Window with color " + color
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: defaultSpacing
+ Text {
+ anchors.centerIn: parent
+ text: "Second Window"
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: testWindow.color = "#e0c31e"
+ }
+ Shared.Button {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: defaultSpacing
+ text: testWindow.visibility === Window.FullScreen ? "exit fullscreen" : "go fullscreen"
+ width: 150
+ onClicked: {
+ if (testWindow.visibility === Window.FullScreen)
+ testWindow.visibility = Window.AutomaticVisibility
+ else
+ testWindow.visibility = Window.FullScreen
+ }
+ }
+ Shared.Button {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: defaultSpacing
+ text: "X"
+ width: 30
+ onClicked: testWindow.visible = false
+ }
+ }
+ }
+
+ property var splashWindow: Splash {
+ onTimeout: controlWindow.visible = true
+ }
+}
diff --git a/examples/quick/window/window.qrc b/examples/quick/window/window.qrc
new file mode 100644
index 0000000000..dc211bdaaf
--- /dev/null
+++ b/examples/quick/window/window.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/window">
+ <file>window.qml</file>
+ <file>Splash.qml</file>
+ <file>ScreenInfo.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/window/window/standalone.qml b/examples/quick/window/window/standalone.qml
deleted file mode 100644
index db73bf66eb..0000000000
--- a/examples/quick/window/window/standalone.qml
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Window 2.0
-
-Item {
- width: 320
- height: 240
- // It's not possible to set an Item's windowTitle. If you want to modify
- // window properties, you need to explicitly create a Window.
- Text {
- id: text1
- anchors.centerIn: parent
- text: "First Window\n" + (Qt.application.supportsMultipleWindows ?
- "click the button to open a second window" : "only one window is allowed")
- }
- Rectangle {
- border.color: "black"
- radius: 4
- anchors.top: text1.bottom
- anchors.horizontalCenter: text1.horizontalCenter
- width: 100
- height: 30
- TextInput {
- id: ti1
- focus: true // but the modal popup will prevent input while it is open
- anchors.centerIn: parent
- }
- }
- Rectangle {
- border.color: "black"
- color: childWindow.visible ? "goldenrod" : "beige"
- radius: height / 4
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.margins: 10
- width: text.implicitWidth + 20
- height: text.implicitHeight + 20
- visible: Qt.application.supportsMultipleWindows
- Text {
- id: text
- text: "Pop up window"
- anchors.centerIn: parent
- }
- MouseArea {
- anchors.fill: parent
- onClicked: childWindow.visible = !childWindow.visible
- }
- }
-
- Window {
- id: childWindow
- width: 320
- height: 240
- x: 220
- y: 120
- color: "beige"
- title: "Second Window"
- modality: Qt.ApplicationModal
- flags: Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
- Text {
- id: text2
- anchors.centerIn: parent
- text: "Modal Frameless Stay-on-Top Window"
- }
- Text {
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.margins: 10
- text: "X"
- MouseArea{
- anchors.fill: parent
- onClicked: childWindow.visible = false
- }
- }
- Rectangle {
- border.color: "black"
- radius: 4
- anchors.top: text2.bottom
- anchors.horizontalCenter: text2.horizontalCenter
- width: 100
- height: 30
- TextInput {
- id: ti2
- focus: true
- anchors.centerIn: parent
- }
- }
- }
-}
diff --git a/examples/quick/window/window/window.pro b/examples/quick/window/window/window.pro
deleted file mode 100644
index 3525a893fa..0000000000
--- a/examples/quick/window/window/window.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-QT += qml
-
-SOURCES += window.cpp
-RESOURCES += window.qrc
-
-EXAMPLE_FILES = \
- nogui.qml \
- standalone.qml \
- twowindows.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/window/window
-INSTALLS = target
diff --git a/examples/quick/window/window/window.qrc b/examples/quick/window/window/window.qrc
deleted file mode 100644
index c203c140fc..0000000000
--- a/examples/quick/window/window/window.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/window/window">
- <file>Window.qml</file>
- </qresource>
-</RCC>