summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-07 13:57:38 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-07 13:57:38 (GMT)
commitd8fb8ca3a378743eebb8464f7910a5e6d1870c01 (patch)
tree9c31a017163a532946f10107b8d9f4405ed1c9db /doc/src
parentb5915ef3a6d0417440ad82e9369d6679505b953e (diff)
parent076bba6c901e292b61fffb7a91020075dcd84919 (diff)
downloadQt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.zip
Qt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.tar.gz
Qt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.tar.bz2
Merge branch 'qdoc-simplified' into mimir-simplified
Conflicts: doc/src/platforms/compiler-notes.qdoc tools/qdoc3/ditaxmlgenerator.cpp tools/qdoc3/ditaxmlgenerator.h tools/qdoc3/htmlgenerator.cpp tools/qdoc3/htmlgenerator.h tools/qdoc3/node.cpp tools/qdoc3/pagegenerator.h
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/bughowto.qdoc2
-rw-r--r--doc/src/classes/phonon-api.qdoc50
-rw-r--r--doc/src/declarative/basictypes.qdoc87
-rw-r--r--doc/src/declarative/declarativeui.qdoc10
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc6
-rw-r--r--doc/src/declarative/elements.qdoc108
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc24
-rw-r--r--doc/src/declarative/extending.qdoc9
-rw-r--r--doc/src/declarative/integrating.qdoc2
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc6
-rw-r--r--doc/src/declarative/qml-intro.qdoc2
-rw-r--r--doc/src/declarative/qmlinuse.qdoc499
-rw-r--r--doc/src/declarative/qtbinding.qdoc632
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc2
-rw-r--r--doc/src/declarative/whatsnew.qdoc10
-rw-r--r--doc/src/development/designer-manual.qdoc156
-rw-r--r--doc/src/development/developing-with-qt.qdoc6
-rw-r--r--doc/src/development/qmake-manual.qdoc79
-rw-r--r--doc/src/development/qtestlib.qdoc27
-rw-r--r--doc/src/examples/webkit-bridge-imageanalyzer.qdoc5
-rw-r--r--doc/src/external-resources.qdoc7
-rw-r--r--doc/src/frameworks-technologies/dnd.qdoc2
-rw-r--r--doc/src/frameworks-technologies/model-view-programming.qdoc12
-rw-r--r--doc/src/frameworks-technologies/threads.qdoc29
-rw-r--r--doc/src/getting-started/examples.qdoc5
-rw-r--r--doc/src/getting-started/gettingstartedqml.qdoc21
-rw-r--r--doc/src/getting-started/installation.qdoc271
-rw-r--r--doc/src/index.qdoc2
-rw-r--r--doc/src/legal/opensourceedition.qdoc2
-rw-r--r--doc/src/legal/trademarks.qdoc12
-rw-r--r--doc/src/platforms/compiler-notes.qdoc266
-rw-r--r--doc/src/platforms/emb-deployment.qdoc2
-rw-r--r--doc/src/platforms/emb-directfb-EmbLinux.qdoc6
-rw-r--r--doc/src/platforms/emb-hardwareacceleration.qdocinc280
-rw-r--r--doc/src/platforms/emb-install.qdoc6
-rw-r--r--doc/src/platforms/emb-pointer.qdoc11
-rw-r--r--doc/src/platforms/emb-qvfb.qdoc4
-rw-r--r--doc/src/platforms/emb-running.qdoc2
-rw-r--r--doc/src/platforms/mac-differences.qdoc2
-rw-r--r--doc/src/platforms/platform-notes-rtos.qdoc8
-rw-r--r--doc/src/platforms/platform-notes.qdoc362
-rw-r--r--doc/src/platforms/qt-embedded-linux.qdoc2
-rw-r--r--doc/src/platforms/supported-platforms.qdoc5
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc13
-rw-r--r--doc/src/platforms/wince-customization.qdoc2
-rw-r--r--doc/src/platforms/wince-introduction.qdoc6
-rw-r--r--doc/src/platforms/winsystem.qdoc4
-rw-r--r--doc/src/qt-webpages.qdoc4
-rw-r--r--doc/src/qt4-intro.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_emb-pointer.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_fdl.qdoc10
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc13
-rw-r--r--doc/src/snippets/code/doc_src_properties.qdoc17
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc20
-rw-r--r--doc/src/snippets/code/src_qtestlib_qtestcase.cpp18
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-defaults.qml55
-rw-r--r--doc/src/snippets/declarative/comments.qml1
-rw-r--r--doc/src/snippets/declarative/flipable/flipable.qml17
-rw-r--r--doc/src/snippets/declarative/keys/keys-handler.qml2
-rw-r--r--doc/src/snippets/declarative/keys/keys-pressed.qml2
-rw-r--r--doc/src/snippets/declarative/loader/sizeitem.qml62
-rw-r--r--doc/src/snippets/declarative/loader/sizeloader.qml62
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml46
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h52
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml (renamed from doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp)28
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp (renamed from doc/src/snippets/declarative/qtbinding/custompalette/main.cpp)17
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/MyItem.qml45
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/context.pro (renamed from doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/main.cpp56
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h79
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/enums.pro (renamed from doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro)2
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/imageviewer.h68
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/main.cpp73
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/standalone.qml49
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml (renamed from doc/src/snippets/declarative/qtbinding/stopwatch/main.qml)13
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp (renamed from doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp)17
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h (renamed from doc/src/snippets/declarative/qtbinding/custompalette/main.qml)29
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml (renamed from doc/src/snippets/declarative/qtbinding/contextproperties/main.qml)15
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp63
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/MyItem.qml56
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/loading.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/main.cpp90
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h56
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/main.cpp62
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/newelements.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/standalone.qml44
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml54
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h71
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp58
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml47
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp61
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.qml5
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml50
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h64
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp (renamed from doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp)53
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml48
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml55
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp59
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h (renamed from doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h)20
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro3
-rw-r--r--doc/src/snippets/moc/myclass2.h7
-rw-r--r--doc/src/sql-programming/sql-driver.qdoc8
-rwxr-xr-xdoc/src/template/scripts/functions.js6
-rw-r--r--doc/src/template/style/narrow.css1
-rwxr-xr-xdoc/src/template/style/style.css105
112 files changed, 3984 insertions, 1132 deletions
diff --git a/doc/src/bughowto.qdoc b/doc/src/bughowto.qdoc
index a7b5569..1793fce 100644
--- a/doc/src/bughowto.qdoc
+++ b/doc/src/bughowto.qdoc
@@ -34,7 +34,7 @@
about it so that we can fix it.
Before reporting a bug, please check the \l{FAQs}, \l{Platform
- Notes}, and the \l{Qt Bug Tracker} on the Qt website to see
+ and Compiler Notes}, and the \l{Qt Bug Tracker} on the Qt website to see
if the issue is already known.
The first thing you should do is to sign up for an account for
diff --git a/doc/src/classes/phonon-api.qdoc b/doc/src/classes/phonon-api.qdoc
index a429e5a..6c9c8de 100644
--- a/doc/src/classes/phonon-api.qdoc
+++ b/doc/src/classes/phonon-api.qdoc
@@ -4114,7 +4114,7 @@
*/
/*!
- \fn Phonon::VideoWidget::snapshot()
+ \fn Phonon::VideoWidget::snapshot() const
\since 4.7
Returns a snapshot of the current frame shown in the widget.
@@ -4312,6 +4312,16 @@
*/
/*!
+ \class Phonon::VideoWidgetInterface44
+ \inmodule Phonon
+ \since 4.7
+*/
+
+/*!
+ \fn Phonon::VideoWidgetInterface44::snapshot() const
+*/
+
+/*!
\typedef Phonon::VideoWidgetInterfaceLatest
\inmodule Phonon
\since 4.7
@@ -5076,6 +5086,22 @@
*/
/*!
+ \fn int Phonon::AudioDataOutput::sampleRate() const
+
+ Returns the sample rate measured in Hertz, as reported by the backend.
+ If the backend is unavailable -1 is returned.
+*/
+
+/*!
+ \fn void Phonon::AudioDataOutput::endOfMedia(int remainingSamples)
+
+ This signal is emitted before the final dataReady() signal is emitted for
+ a media. The \a remainingSamples value sent by the signal contains the
+ number of samples that will be sent in the final dataReady() signal for
+ the media.
+*/
+
+/*!
\fn Phonon::AudioDataOutput::dataReady(const QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> > &data)
This signal is emitted whenever there is data available to read. The
@@ -5084,13 +5110,28 @@
*/
/*!
+ \fn Phonon::AudioDataOutputPrivate::AudioDataOutputPrivate()
+ \internal
+*/
+
+/*!
\fn Phonon::AudioDataOutputInterface::~AudioDataOutputInterface()
Destroys the data interface.
*/
/*!
- \fn Phonon::AudioDataOutputInterface::frontendObject()
+ \fn Phonon::AudioDataOutputInterface::frontendObject() const
+ \internal
+*/
+
+/*!
+ \fn Phonon::AudioDataOutputInterface::setFrontendObject(AudioDataOutput *)
+ \internal
+*/
+
+/*!
+ \fn Phonon::GlobalConfigPrivate::GlobalConfigPrivate()
\internal
*/
@@ -5098,3 +5139,8 @@
\fn Phonon::GlobalConfigPrivate::~GlobalConfigPrivate()
\internal
*/
+
+/*!
+ \fn Phonon::SwiftSlider::~SwiftSlider()
+ \internal
+*/
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 6abe96f..71192bf 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -166,7 +166,7 @@
\l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
\qml
- Rectangle { color: Qt.rgba(255, 0, 0, 1) }
+ Rectangle { color: Qt.rgba(0.5, 0.5, 0, 1) }
\endqml
\sa {QML Basic Types}
@@ -355,9 +355,11 @@
\brief A list of objects.
- A list of objects. While not technically a basic type, QML also
- supports lists of object types. When used from QML, the engine
- automatically appends each value to the list.
+ A list type contains a list of objects. While not technically
+ a basic type, QML supports lists of object types. When used
+ from QML, the engine automatically appends each value to the list.
+ Items in the list can be accessed by index using the usual
+ \c listName[index] syntax.
For example, the \l Item class contains a list property named
children that can be used like this:
@@ -366,14 +368,87 @@
Item {
children: [
Item { id: child1 },
- Rectangle { id: child2 },
+ Rectangle { id: child2; width: 200 },
Text { id: child3 }
]
+
+ Component.onCompleted: {
+ console.log("Width of child rectangle:", children[1].width)
+ }
}
\endqml
- \c child1, \c child2 and \c child3 will all be added to the children list
+ \c child1, \c child2 and \c child3 will be added to the children list
in the order in which they appear.
+ List \l {Adding new properties}{properties} can be created as a
+ \c variant type, or as a \c list<Type> type, where \c Type is the
+ type of the object in the list:
+
+ \qml
+ Item {
+ property variant values: [ 10, 20, 'abc', 'xyz' ]
+
+ property list<Rectangle> rects: [
+ Rectangle { width: 100; height: 100},
+ Rectangle { width: 200; height: 200}
+ ]
+ }
+ \endqml
+
+ A \c variant list can contain values of any of the \l {QML Basic Types}{basic QML types}
+ such as numbers, strings, etc. while a \c list<Type> list can only contain values
+ that match (or are derived from) the specified \c Type.
+
+ A list property can be cleared by setting it to an empty list:
+
+ \qml
+ Item {
+ children: []
+ }
+ \endqml
+
+ A list property cannot be modified in any other way. Items cannot be dynamically added to
+ or removed from the list through JavaScript operations; any \c push() operations on the
+ list only modify a \e copy of the list and not the actual list. (These current limitations
+ are due to restrictions on \l {Property Binding} where lists are involved.)
+
+ To create a modifiable list, create an array object from within a \c .js JavaScript file,
+ or implement a custom list element in C++. Here is a QML element that modifies the list in a
+ JavaScript file:
+
+ \table
+ \row
+ \o
+ \qml
+ // QML
+ import "script.js" as Script
+
+ Item {
+ Component.onCompleted: {
+ Script.addItem('abc')
+ console.log("Added:", Script.getList()[0])
+ }
+ }
+ \endqml
+
+ \o
+ \code
+ // script.js
+ var myArray = new Array()
+
+ function getList() {
+ return myArray
+ }
+
+ function addItem(item) {
+ myArray.push(item)
+ }
+ \endcode
+ \endtable
+
+ However, note that a JavaScript list should not be used as a QML \c property value,
+ as the property is not updated when the list changes.
+
\sa {QML Basic Types}
*/
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 28a8a70..01e1302 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -45,7 +45,7 @@ language for describing user interfaces and a language runtime. A collection
of C++ APIs is used to integrate these high level features with classic
Qt applications.
-\section2 QML, Elements and the QtDeclarative Module
+\section2 QML, Elements and the Qt Declarative Module
User interfaces and their behavior are described using QML, an extension to
\l{About JavaScript}{JavaScript} that lets developers and designers
@@ -60,14 +60,14 @@ QObject-based type system, adds support for automatic
\l{Property Binding}{property bindings} and provides
\l{Network Transparency}{network transparency} at the language level.
-The QtDeclarative module implements the interface between the QML language
+The Qt Declarative module implements the interface between the QML language
and the elements available to it. It also provides a C++ API that can be
used to load and interact with QML files from within Qt applications.
Qt Quick builds on \l{QML for Qt programmers}{Qt's existing strengths}.
QML can be be used to incrementally extend an existing application or
to build completely new applications. QML is fully
-\l{Extending QML in C++}{extensible from C++} through the QtDeclarative
+\l{Extending QML in C++}{extensible from C++} through the Qt Declarative
Module.
\section1 Getting Started
@@ -77,7 +77,7 @@ Module.
\o \l{Introduction to the QML language}
\o \l{QML for Qt Programmers}
\o \l{Getting Started Programming with QML}
-\o \l{Beginning Qt Quick}
+\o \l{Intro to Qt Quick}
\endlist
\list
@@ -139,7 +139,7 @@ Module.
\o \l{QML Global Object}
\o \l{QML Internationalization}
\o \l{QML Security}
-\o \l{QtDeclarative Module}
+\o \l{Qt Declarative Module}
\o \l{Debugging QML}
\o \l{QML Viewer}
\o \l{QML Performance}
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 3921d3e..daf2ae1 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -173,7 +173,11 @@ component. Each instance runs a NumberAnimation, and when the animation has fini
Alternatively, the \c application.qml could have destroyed the created object
by calling \c object.destroy().
-Notice that if a \c SelfDestroyingRect instance was created statically like this:
+Note that it is safe to call destroy() on an object within that object. Objects are not destroyed the
+instant destroy() is called, but are cleaned up sometime between the end of that script block and the next frame
+(unless you specified a non-zero delay).
+
+Note also that if a \c SelfDestroyingRect instance was created statically like this:
\qml
Item {
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index a0eb95d..eaa6a82 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -32,13 +32,115 @@
\brief A dictionary of standard QML elements.
This is a dictionary of all standard QML elements made available
- in the QtDeclarative module.
+ in the Qt Declarative module.
To see the QML elements listed by functional area, see the
\l{Groups Of Related QML Elements} page.
- \generatelist qmlclasses
-
+ \table
+ \header \o {2,1} \bold {Basic Visual Items}
+ \row \o \l {Item} \o Basic item element inherited by all visual items in QML
+ \row \o \l {Rectangle} \o Basic visual rectangle element
+ \row \o \l {Gradient} \o Defines a gradient between two or more colors
+ \row \o \l {GradientStop} \o Defines a color used in a \l {Gradient}
+ \row \o \l {Image} \o Allows the use of bitmaps to a scene
+ \row \o \l {BorderImage} (Item-specific) \o Defines an image as a border
+ \row \o \l {AnimatedImage} \o For playing animations stored as a series of frames
+ \row \o \l {Text} \o Allows the use of formatted text in a scene
+ \row \o \l {TextInput} \o Displays an editable line of text
+ \row \o \l {IntValidator} \o Validator for integer values
+ \row \o \l {DoubleValidator} \o Validator for non-integer values
+ \row \o \l {RegExpValidator} \o Validator for string regular expressions
+ \row \o \l {TextEdit} \o Displays multiple lines of editable formatted text
+
+ \header \o {2,1} \bold {Basic Interaction Items}
+ \row \o \l {MouseArea} \o Handles mouse interactions
+ \row \o \l {FocusScope} \o For keyboard focus handling
+ \row \o \l {Flickable} \o Provides a surface that can be "flicked"
+ \row \o \l {Flipable} \o Provides a surface that produces flipping effects
+ \row \o \l {GestureArea} (experimental) \o Enables simple gesture handling
+
+ \header \o {2,1} \bold {States}
+ \row \o \l {State} \o Defines sets of configurations of objects and properties
+ \row \o \l {PropertyChanges} \o Describes property changes within a state
+ \row \o \l {StateGroup} \o Contains a set of states and state transitions
+ \row \o \l {StateChangeScript} \o Allows script binding in a state
+ \row \o \l {ParentChange} (Item-specific) \o Re-parent an Item in a state change
+ \row \o \l {AnchorChanges} \o Change the anchors of an item in a state
+
+ \header \o {2,1} \bold {Animation and Transitions}
+ \row \o \l {Behavior} \o Specifies a default animation for property changes
+ \row \o \l {SequentialAnimation} \o Runs animations sequentially
+ \row \o \l {ParallelAnimation} \o Runs animations in parallel
+ \row \o \l {PropertyAnimation} \o Animates property changes
+ \row \o \l {NumberAnimation} \o Animates properties of type qreal
+ \row \o \l {Vector3dAnimation} \o Animates properties of type QVector3d
+ \row \o \l {ColorAnimation} \o Animates color changes
+ \row \o \l {RotationAnimation} \o Animates rotations
+ \row \o \l {ParentAnimation} \o Animates parent changes
+ \row \o \l {AnchorAnimation} \o Animates anchor changes
+ \row \o \l {PauseAnimation} \o Pauses an animation
+ \row \o \l {SmoothedAnimation} \o Allows a property to smoothly track a value
+ \row \o \l {SpringAnimation} \o Allows a property to track a value in a spring-like motion
+ \row \o \l {PropertyAction} \o Sets immediate property changes during animation
+ \row \o \l {ScriptAction} \o Runs scripts during an animation
+ \row \o \l {Transition} \o Animates transitions during state changes
+
+ \header \o {2,1} \bold {Working with Data}
+ \row \o \l {Binding} \o Binds any value to any property
+ \row \o \l {ListModel} \o Defines a list of data
+ \row \o \l {ListElement} \o Defines a data item in a \l {ListModel}
+ \row \o \l {VisualItemModel} \o Contains items that already defines its own visual delegate
+ \row \o \l {VisualDataModel} \o Encapsulates a model and a delegate
+ \row \o \l {Package} \o Collection that enables sharing of items within different views
+ \row \o \l {XmlListModel} \o Specifies a model using XPath expressions
+ \row \o \l {XmlRole} \o Specifies a role for an \l {XmlListModel}
+
+ \header \o {2,1} \bold {Views}
+ \row \o \l {ListView} \o Provides a list visualization of a model
+ \row \o \l {GridView} \o Provides a grid visualization of a model
+ \row \o \l {PathView} \o Visualizes a model's contents along a path
+ \row \o \l {Path} \o Defines a path used by \l {PathView}
+ \row \o \l {PathLine} \o Defines a line in \l {Path}
+ \row \o \l {PathQuad} \o Defines a quadratic Bezier curve in a \l {Path}
+ \row \o \l {PathCubic} \o Defines a cubic Bezier curve in a \l {Path}
+ \row \o \l {PathAttribute} \o Allows the setting of attributes along a \l {Path}
+ \row \o \l {PathPercent} \o Modifies the item distribution along a \l {Path}
+ \row \o \l {WebView} \o Allows the addition of web content to a canvas
+
+ \header \o {2,1} \bold {Positioners}
+ \row \o \l {Column} \o Arranges its children vertically
+ \row \o \l {Row} \o Arranges its children horizontally
+ \row \o \l {Grid} \o Positions its children in a grid
+ \row \o \l {Flow} \o Positions its children with wrapping support
+
+ \header \o {2,1} \bold {Utility}
+ \row \o \l {Connections} \o Explicitly connects signals and signal handlers
+ \row \o \l {Component} \o Encapsulate QML items as a component
+ \row \o \l {Timer} \o Provides timed triggers
+ \row \o \l {QML:QtObject} {QtObject} \o Basic element containing only the objectName property
+ \row \o \l {QML:Qt} {Qt} \o The QML global Qt object provides useful enums and functions from Qt.
+ \row \o \l {WorkerScript} \o Enables the use of threads in QML
+ \row \o \l {Loader} \o Controls the loading of items or components
+ \row \o \l {Repeater} \o Uses a model to create multiples of components
+ \row \o \l {SystemPalette} \o Provides access to the Qt palettes
+ \row \o \l {FontLoader} \o Loads fonts by name or URL
+ \row \o \l {LayoutItem} \o Allows declarative UI elements inside Qt's Graphics View layouts
+
+ \header \o {2,1} \bold {Transforms}
+ \row \o \l {Scale} \o Assigns item scaling behaviors
+ \row \o \l {Rotation} \o Assigns item rotation behaviors
+ \row \o \l {Translate} \o Assigns item translation behaviors
+
+ \header \o {2,1} \bold {Effects}
+ \row \o \l {Particles} (experimental) \o Generates and animates particles
+ \row \o \l {ParticleMotionLinear} \o Adds linear motion behavior to \l {Particles}
+ \row \o \l {ParticleMotionGravity} \o Adds gravitational motion to \l {Particles}
+ \row \o \l {ParticleMotionWander} \o Adds varied motions to \l {Particles}
+ \endtable
+
+
+
*/
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index 3b2fe3b..dff1d9c 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -29,7 +29,7 @@
\page qml-extending-tutorial-index.html
\title Tutorial: Writing QML extensions with C++
-The QtDeclarative module provides a set of APIs for extending QML through
+The Qt Declarative module provides a set of APIs for extending QML through
C++ extensions. You can write extensions to add your own QML types, extend existing
Qt types, or call C/C++ functions that are not accessible from ordinary QML code.
@@ -65,7 +65,7 @@ For example, this could be done to implement particular data models, or provide
elements with custom painting and drawing capabilities, or access system features
like network programming that are not accessible through built-in QML features.
-In this tutorial, we will show how to use the C++ classes in the QtDeclarative
+In this tutorial, we will show how to use the C++ classes in the Qt Declarative
module to extend QML. The end result will be a simple Pie Chart display implemented by
several custom QML types connected together through QML features like bindings and
signals, and made available to the QML runtime through a plugin.
@@ -260,32 +260,28 @@ custom QML types may see unexpected behavior if bindings are not implemented.
The \c PieChart type currently has a string-type property and a color-type property.
It could have many other types of properties. For example, it could have an
-enum-type property to store a display mode for each chart:
+int-type property to store an identifier for each chart:
\code
// C++
class PieChart : public QDeclarativeItem
{
- Q_ENUMS(DisplayMode)
- Q_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode)
+ Q_PROPERTY(int chartId READ chartId WRITE setChartId NOTIFY chartIdChanged)
...
public:
- enum DisplayMode {
- MultiLevel,
- Exploded,
- ThreeDimensional
- };
-
- void setDisplayMode(DisplayMode mode);
- DisplayMode displayMode() const;
+ void setChartId(int chartId);
+ int chartId() const;
...
+
+ signals:
+ void chartIdChanged();
};
// QML
PieChart {
...
- displayMode: PieChart.Exploded
+ chartId: 100
}
\endcode
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 18887c7..5c1b977 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -647,7 +647,8 @@ language.
\section1 Adding new properties
-New properties can be added to an existing type. These new properties are
+New properties can be added to an existing type using the \c property keyword.
+These new properties are
available for use within QML, and also appear as regular Qt properties on the
C++ object, accessible through the regular property access mechanisms.
@@ -679,8 +680,12 @@ like this:
property list<Item> listOfItemsProperty
\endcode
+Custom types must be registered with qmlRegisterType() to be usable as a property
+type. Also note that list properties cannot be modified like ordinary JavaScript
+arrays; see the \l {list}{list type documentation} for details.
+
QML supports two methods for adding a new property to a type: a new property
-definition, and a property alias.
+definition, and a property alias. These are shown below.
\section2 Property definitions
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index 682f792..7028585 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -47,7 +47,7 @@ qmlView->setSource(QUrl::fromLocalFile("myqml.qml"));
QWidget *widget = myExistingWidget();
QVBoxLayout *layout = new QVBoxLayout(widget);
-widget->addWidget(qmlView);
+layout->addWidget(qmlView);
\endcode
The one drawback to this approach is that QDeclarativeView is slower to initialize
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 87dafb0..1d807e3 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -37,7 +37,7 @@ interface is specified as a tree of objects with properties.
This introduction is meant for those with little or no programming
experience. JavaScript is used as a scripting language in QML, so you may want
-to learn a bit more about it (\l{JavaScript: The Definitive Guide}) before diving
+to learn a bit more about it (\l{Javascript Guide}) before diving
deeper into QML. It's also helpful to have a basic understanding of other web
technologies like HTML and CSS, but it's not required.
@@ -65,8 +65,8 @@ types always begin with a capital letter. In the above example, there are
two objects, a \l Rectangle, and an \l Image. Between the braces, we can specify
information about the object, such as its properties.
-Properties are specified as \c {property: value}. In the above example, we
-can see the Image has a property named \c source, which has been assigned the
+Properties are specified as \c {property: value}. In the above example, we
+can see the Image has a property named \c source, which has been assigned the
value \c "pics/logo.png". The property and its value are separated by a colon.
Properties can be specified one-per-line:
diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc
index f891e01..e02ce8f 100644
--- a/doc/src/declarative/qml-intro.qdoc
+++ b/doc/src/declarative/qml-intro.qdoc
@@ -29,7 +29,7 @@
/*!
\page qml-intro.html
-\title Beginning Qt Quick
+\title Intro to Qt Quick
\section1 Overview
diff --git a/doc/src/declarative/qmlinuse.qdoc b/doc/src/declarative/qmlinuse.qdoc
new file mode 100644
index 0000000..90ce02c
--- /dev/null
+++ b/doc/src/declarative/qmlinuse.qdoc
@@ -0,0 +1,499 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlinuse.html
+\title Using QML elements
+
+\raw HTML
+ <div class="item group">
+ <div class="secondaryx">
+ <div class="toc">
+ <h3>
+ <a name="toc">QML Elements</a></h3>
+ <ul>
+ <li class="level1"><a href="#basicElements">Basic QML Elements</a></li>
+ <li class="level1"><a href="#visualElements">QML Visual Elements</a></li>
+ <li class="level1"><a href="#AnimAndTrans">QML Animation and Transition Elements</a></li>
+ <li class="level1"><a href="#interactElement">Basic QML Interaction Elements</a></li>
+ <li class="level1"><a href="#eventElements">QML Event Elements</a></li>
+ <li class="level1"><a href="#Position">QML Positioning Elements</a></li>
+ <li class="level1"><a href="#stateElement">QML State Elements</a></li>
+ <li class="level1"><a href="#transformElement">QML Transform Elements</a></li>
+ <li class="level1"><a href="#utilityElement">QML Utility Elements</a></li>
+ <li class="level1"><a href="#modelView">Models and View Elements</a></li>
+ <li class="level1"><a href="#paths">Paths</a></li>
+ <li class="level1"><a href="#ParticleElement">Particle Elements</a></li>
+ <li class="level1"><a href="#bridge">Bridge Elements</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="primary">
+ <h1>
+ Groups Of Related QML Elements</h1>
+ <p>
+ QML Elements are grouped by their respective functionalities. Certain elements are
+ suited for building complex components while other elements strictly dictate appearances
+ and color.</p>
+ <div class="cols two group unclear">
+ <div class="col first">
+ <p>
+ <i>add something about elements in use in general</i></p>
+ </div>
+ <div class="col">
+ <img src="images/quick_screens.png" />
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- tech domains start -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="basicElements"> Basic QML Elements</a></h2>
+ <p>
+ Basic elements can be extended to form more complex elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-item.html">Item Element</a>
+ - The Item is the most basic of all visual items in QML. Many visual elements inherit
+ properties from the Item element.</li>
+ <li><a href="qml-component.html">Component Element</a>
+ - The Component element encapsulates a QML component definition.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="visualElements">QML Visual Elements</a></h2>
+ <p>
+ Visual elements offer various interactive and graphical functionalities. Visual
+ elements can directly set properties that dictate appearances.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-borderimage.html">BorderImage
+ Element</a> - The BorderImage element provides an image that can be used as a border.</li>
+ <li><a href="qml-gradient.html">Gradient Element</a>
+ - The Gradient item defines a gradient fill.</li>
+ <li><a href="qml-gradientstop.html">GradientStop
+ Element</a> - The GradientStop item defines the color at a position in a Gradient.</li>
+ <li><a href="qml-image.html">Image Element</a>
+ - The Image element displays an image from a source.</li>
+ <li><a href="qml-rectangle.html">Rectangle Element</a>
+ - The Rectangle item provides a filled rectangle.</li>
+ <li><a href="qml-text.html">Text Element</a>
+ - The Text item allows the addition of formatted text to a scene.</li>
+ <li><a href="qml-textedit.html">TextEdit Element</a>
+ - The TextEdit item displays multiple lines of editable formatted text.</li>
+ <li><a href="qml-textinput.html">TextInput Element</a>
+ - The TextInput item displays an editable line of text.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="AnimAndTrans">QML Animation and Transition Elements</a></h2>
+ <p>
+ Animation and transition elements control animation behaviors. Animations can run
+ in parallel or in series for different value types.
+ </p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-anchoranimation.html">AnchorAnimation Element</a> -
+ The AnchorAnimation element animates changes in anchor values.</li>
+ <li><a href="qml-animation.html">Animation Element</a> - The Animation
+ element is the base of all QML animations.</li>
+ <li><a href="qml-behavior.html">Behavior Element</a> - The Behavior element allows you to specify a default animation for a property change.</li>
+ <li><a href="qml-coloranimation.html">ColorAnimation Element</a> - The ColorAnimation element animates changes in color values.</li>
+ <li><a href="qml-numberanimation.html">NumberAnimation Element</a> - The NumberAnimation element animates changes in qreal-type values.</li>
+ <li><a href="qml-parallelanimation.html">ParallelAnimation Element</a> - The ParallelAnimation element allows animations to be run in parallel.</li>
+ <li><a href="qml-parentanimation.html">ParentAnimation Element</a> - The ParentAnimation element animates changes in parent values.</li>
+ <li><a href="qml-pauseanimation.html">PauseAnimation Element</a> - The PauseAnimation element provides a pause during an animation.</li>
+ <li><a href="qml-propertyaction.html">PropertyAction Element</a> - The PropertyAction element allows immediate property changes during animation.</li>
+ <li><a href="qml-propertyanimation.html">PropertyAnimation Element</a> - The PropertyAnimation element animates changes in property values.</li>
+ <li><a href="qml-rotationanimation.html">RotationAnimation Element</a> - The RotationAnimation element animates changes in rotational values.</li>
+ <li><a href="qml-scriptaction.html">ScriptAction Element</a> - The ScriptAction element allows scripts to be run during an animation.</li>
+ <li><a href="qml-sequentialanimation.html">SequentialAnimation Element</a> - The SequentialAnimation element allows animations to be run sequentially.</li>
+ <li><a href="qml-smoothedanimation.html">SmoothedAnimation Element</a> - The SmoothedAnimation element allows a property to smoothly track a value.</li>
+ <li><a href="qml-springanimation.html">SpringAnimation Element</a> - The SpringAnimation element allows a property to track a value in a spring-like
+ motion.</li>
+ <li><a href="qml-transition.html">Transition Element</a> - The Transition element defines animated transitions that occur on state changes.</li>
+ <li><a href="qml-vector3danimation.html">Vector3dAnimation Element</a> - The Vector3dAnimation element animates changes in QVector3d values.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="interactElement">QML Interaction Elements</h2></a>
+ <p>
+ These elements define basic interactions such as touch movements and focus management.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-flickable.html">Flickable Element</a> - The Flickable item provides a surface that can be "flicked".</li>
+ <li><a href="qml-flipable.html">Flipable Element</a> - The Flipable item provides a surface that can be flipped or reflected.</li>
+ <li><a href="qml-focuspanel.html">FocusPanel Element</a> - The FocusPanel item explicitly creates a focus panel.</li>
+ <li><a href="qml-focusscope.html">FocusScope Element</a> - The FocusScope object explicitly creates a focus scope for focus management.</li>
+ <li><a href="qml-gesturearea.html">GestureArea Element</a> - The GestureArea item enables simple gesture handling.</li>
+ <li><a href="qml-keynavigation.html">KeyNavigation Element</a> - The KeyNavigation attached property supports key navigation by arrow keys.</li>
+ <li><a href="qml-keys.html">Keys Element</a> - The Keys attached property provides key handling to Items.</li>
+ <li><a href="qml-mousearea.html">MouseArea Element</a> - The MouseArea item enables simple mouse handling.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="eventElements">QML Event Elements</a></h2>
+ <p>
+ Key and mouse events information are provided in these event elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-keyevent.html">KeyEvent Element</a> - The KeyEvent
+ object provides information about a key event.</li>
+ <li><a href="qml-mouseevent.html">MouseEvent Element</a> - The MouseEvent
+ object provides information about a mouse event.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="Position">QML Positioning Elements</a></h2>
+ <p>
+ Using positioning elements, layouts can be defined and their children accessed through
+ an index.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-column.html">Column Element</a> - The Column
+ item arranges its children vertically.</li>
+ <li><a href="qml-flow.html">Flow Element</a> - The Flow item
+ arranges its children side by side, wrapping as necessary.</li>
+ <li><a href="qml-grid.html">Grid Element</a> - The Grid item
+ positions its children in a grid.</li>
+ <li><a href="qml-row.html">Row Element</a> - The Row item
+ arranges its children horizontally.</li>
+ <li><a href="qml-repeater.html">Repeater Element</a> - The Repeater element allows you to repeat an Item-based component using a model.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+
+ <h2><a name="stateElement">QML State Elements</a></h2>
+ <p>
+ States and groups of states are formed using state elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-anchorchanges.html">AnchorChanges Element</a> - The AnchorChanges element allows you to change the anchors of an item in a state.</li>
+ <li><a href="qml-parentchange.html">ParentChange Element</a> - The ParentChange element allows you to reparent an Item in a state change.</li>
+ <li><a href="qml-propertychanges.html">PropertyChanges Element</a> - The PropertyChanges element describes new property bindings or values for a state.</li>
+ <li><a href="qml-state.html">State Element</a> - The State
+ element defines configurations of objects and properties.</li>
+ <li><a href="qml-statechangescript.html">StateChangeScript Element</a> - The StateChangeScript element allows you to run a script in a state.</li>
+ <li><a href="qml-stategroup.html">StateGroup Element</a> - The StateGroup element provides state support for non-Item elements.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="transformElement">QML Transform Elements</a></h2>
+ <p>
+ Advanced handling of transformations is controlled in transform elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-rotation.html">Rotation Element</a> - The Rotation object provides a way to rotate an Item.</li>
+ <li><a href="qml-scale.html">Scale Element</a> - The Scale element provides a way to scale an Item.</li>
+ <li><a href="qml-transform.html">Transform Element</a> - The Transform element provide a way of building advanced transformations on Items.</li>
+ <li><a href="qml-translate.html">Translate Element</a> - The Translate object provides a way to move an Item without changing its x or y properties.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="utilityElement">QML Utility Elements</a></h2>
+ <p>
+ These elements handle assorted operations such as event timing, Qt enumerations,
+ and font loading.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-binding.html">Binding Element</a> - The Binding element allows arbitrary property bindings to be created.</li>
+ <li><a href="qml-connections.html">Connections Element</a> - A Connections element describes generalized connections to signals.</li>
+ <li><a href="qml-doublevalidator.html">DoubleValidator Element</a> - Provides a validator for non-integer numbers.</li>
+ <li><a href="qml-fontloader.html">FontLoader Element</a> - The FontLoader element allows fonts to be loaded by name or URL.</li>
+ <li><a href="qml-intvalidator.html">IntValidator Element</a> - This element provides a validator for integer values.</li>
+ <li><a href="qml-layoutitem.html">LayoutItem Element</a> - The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.</li>
+ <li><a href="qml-loader.html">Loader Element</a> - The Loader item allows dynamically loading an Item-based subtree from a URL or Component.</li>
+ <li><a href="qml-package.html">Package Element</a> - Package provides a bundle for shared contexts in multiple views.</li>
+ <li><a href="qml-qt.html">Qt Element</a> - The QML global Qt object provides useful enums and functions from Qt.</li>
+ <li><a href="qml-qtobject.html">QtObject Element</a> - The QtObject element is the most basic element in QML.</li>
+ <li><a href="qml-regexpvalidator.html">RegExpValidator Element</a> - This element provides a validator for regular expressions.</li>
+ <li><a href="qml-systempalette.html">SystemPalette Element</a> - The SystemPalette element provides access to the Qt palettes.</li>
+ <li><a href="qml-timer.html">Timer Element</a> - The Timer item triggers a handler at a specified interval.</li>
+ <li><a href="qml-workerscript.html">WorkerScript Element</a> - The WorkerScript element enables the use of threads in QML.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="modelView">Models and View Elements</a></h2>
+ <p>
+ Models and views are used to organize data and control their layouts using delegates.
+ Models dictate the data formation and views control the layouts of data in the model.</p>
+ <b>View Elements:</b>
+ <ul>
+ <li><a href="qml-gridview.html">GridView Element</a> - The GridView item provides a grid view of items provided by a model.</li>
+ <li><a href="qml-listview.html">ListView Element</a> - The ListView item provides a list view of items provided by a model.</li>
+ <li><a href="qml-pathview.html">PathView Element</a> - The PathView element lays out model-provided items on a path.</li>
+ <li><a href="qml-webview.html">WebView Element</a> - The WebView item allows you to add Web content to a canvas.</li>
+ </ul>
+ <b>Model Elements:</b>
+ <ul>
+ <li><a href="qml-folderlistmodel.html">FolderListModel Element</a> - The FolderListModel provides a model of the contents of a file system folder.</li>
+ <li><a href="qml-listelement.html">ListElement Element</a> - A ListElement defines a data item in a ListModel.</li>
+ <li><a href="qml-listmodel.html">ListModel Element</a> - The ListModel element defines a free-form list data source.</li>
+ <li><a href="qml-visualdatamodel.html">VisualDataModel Element</a> - The VisualDataModel encapsulates a model and delegate.</li>
+ <li><a href="qml-visualitemmodel.html">VisualItemModel Element</a> - The VisualItemModel allows items to be provided to a view.</li>
+ <li><a href="qml-xmllistmodel.html">XmlListModel Element</a> - The XmlListModel element is used to specify a model using XPath expressions.</li>
+ <li><a href="qml-xmlrole.html">XmlRole Element</a> - The XmlRole element allows you to specify a role for an XmlListModel.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="paths">Paths</a></h2>
+ <p>
+ QML components can be arranged along paths. Path elements allow control over different
+ path types.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-path.html">Path Element</a> - A Path object defines a path for use by PathView.</li>
+ <li><a href="qml-pathattribute.html">PathAttribute Element</a> - The PathAttribute allows setting an attribute at a given position in a Path.</li>
+ <li><a href="qml-pathcubic.html">PathCubic Element</a> - The PathCubic defines a cubic Bezier curve with two control points.</li>
+ <li><a href="qml-pathelement.html">PathElement Element</a> - PathElement is the base path type.</li>
+ <li><a href="qml-pathline.html">PathLine Element</a> - The PathLine defines a straight line.</li>
+ <li><a href="qml-pathpercent.html">PathPercent Element</a> - The PathPercent manipulates the way a path is interpreted.</li>
+ <li><a href="qml-pathquad.html">PathQuad Element</a> - The PathQuad defines a quadratic Bezier curve with a control point.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="ParticleElement">Particle Elements</a></h2>
+ <p>
+ Particle effects are declared and controlled using particle elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-particlemotiongravity.html">ParticleMotionGravity Element</a> - The ParticleMotionGravity object moves particles towards a point.</li>
+ <li><a href="qml-particlemotionlinear.html">ParticleMotionLinear Element</a> - The ParticleMotionLinear object moves particles linearly.</li>
+ <li><a href="qml-particlemotionwander.html">ParticleMotionWander Element</a> - The ParticleMotionWander object moves particles in a somewhat random fashion.</li>
+ <li><a href="qml-particles.html">Particles Element</a> - The Particles object generates and moves particles.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr>
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="bridge">Bridge Elements</a></h2>
+ <p>
+ Bridge elements allow direct communication between C++ and QML entities.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-layoutitem.html">LayoutItem Element</a> - The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.</li>
+ </ul>
+ </div>
+ </div>
+
+\endraw
+
+
+
+*/
+
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index 58d53de..c3ce6d0 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -30,126 +30,389 @@
\target qtbinding
\title Using QML in C++ Applications
-\tableofcontents
+QML is designed to be easily extensible from C++. The classes in the
+Qt Declarative module allow QML components to be loaded and manipulated from C++, and through
+Qt's \l{The Meta-Object System}{meta-object system}, QML and C++ objects can easily
+communicate through Qt signals and slots. In addition, QML plugins can be written to create
+reusable QML components for distribution.
-The QML API is split into three main classes - QDeclarativeEngine, QDeclarativeComponent and QDeclarativeContext.
-QDeclarativeEngine provides the environment in which QML is run, QDeclarativeComponent encapsulates
-\l {QML Documents}, and QDeclarativeContext allows applications to expose data to QML component instances.
+You may want to mix QML and C++ for a number of reasons. For example:
-QML also includes a convenience API, QDeclarativeView, for applications that simply want to embed QML
-components into a new QGraphicsView. QDeclarativeView covers up many of the details discussed below.
-While QDeclarativeView is mainly intended for rapid prototyping it can have uses in production applications.
+\list
+\o To use functionality defined in a C++ source (for example, when using a C++ Qt-based data model, or
+calling functions in a third-party C++ library)
+\o To access functionality in the Qt Declarative module (for example, to dynamically generate
+images using QDeclarativeImageProvider)
+\o To write your own QML elements (whether for your applications, or for distribution to others)
+\endlist
+
+To use the Qt Declarative module, you must include and link to the module appropriately, as shown on
+the \l {QtDeclarative}{module index page}. The \l {Qt Declarative UI Runtime} documentation
+shows how to build a basic C++ application that uses this module.
+
+
+\section1 Core module classes
-If you are looking at retrofitting an existing Qt application with QML,
-read \l{Integrating QML with existing Qt UI code}.
-\section1 Basic Usage
+The Qt Declarative module provides a set of C++ APIs for extending your QML applications from C++ and
+embedding QML into C++ applications. There are several core classes in the Qt Declarative module
+that provide the essential capabilities for doing this. These are:
-Every application requires at least one QDeclarativeEngine. A QDeclarativeEngine allows the configuration of
-global settings that apply to all the QML component instances - such as the QNetworkAccessManager
-that is used for network communications, and the path used for persistent storage.
-Multiple QDeclarativeEngine's are only needed if the application requires these settings to differ
-between QML component instances.
+\list
+\o QDeclarativeEngine: A QML engine provides the environment for executing QML code. Every
+application requires at least one engine instance.
+\o QDeclarativeComponent: A component encapsulates a \l{QML Documents}{QML document}.
+\o QDeclarativeContext: A context allows an application to expose data to the QML components
+created by an engine.
+\endlist
-\l {QML Documents} are loaded using the QDeclarativeComponent class. Each QDeclarativeComponent instance
-represents a single QML document. A QDeclarativeComponent can be passed a document URL, or raw text
-representing the content of the document. The document URL can be a local filesystem URL, or
-any network URL supported by QNetworkAccessManager.
+A QDeclarativeEngine allows the configuration of global settings that apply to all of its QML
+component instances: for example, the QNetworkAccessManager to be used for network communications,
+and the file path to be used for persistent storage.
-QML component instances can then be created by calling the QDeclarativeComponent::create() method. Here's
-an example of loading a QML document, and creating an object from it.
+QDeclarativeComponent is used to load QML documents. Each QDeclarativeComponent instance represents
+a single document. A component can be created from the URL or file path of a QML document, or the raw
+QML code of the document. Component instances are instatiated through the
+QDeclarativeComponent::create() method, like this:
\code
- QDeclarativeEngine *engine = new QDeclarativeEngine(parent);
- QDeclarativeComponent component(engine, QUrl::fromLocalFile("main.qml"));
- QObject *myObject = component.create();
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
+QObject *rectangleInstance = component.create();
+
+// ...
+delete rectangleInstance;
\endcode
-\section1 Exposing Data
+QML documents can also be loaded using QDeclarativeView. This class provides a convenient
+QWidget-based view for embedding QML components into QGraphicsView-based applications. (For other
+methods of integrating QML into QWidget-based applications, see \l {Integrating QML with existing Qt
+UI code}.)
+
+
+\section1 Approaches to using QML with C++
+
+There are a number of ways to extend your QML application through C++. For example, you could:
+
+\list
+\o Load a QML component and manipulate it (or its children) from C++
+\o Embed a C++ object and its properties directly into a QML component (for example, to make a
+particular C++ object callable from QML, or to replace a dummy list model data with a real data set)
+\o Define new QML elements (through QObject-based C++ classes) and create them directly from your
+QML code
+\endlist
+
+These methods are shown below. Naturally these approaches are not exclusive; you can mix any of
+these methods throughout your application as appropriate.
+
+
+\section2 Loading QML components from C++
+
+A QML document can be loaded with QDeclarativeComponent or QDeclarativeView. QDeclarativeComponent
+loads a QML component as a C++ object; QDeclarativeView also does this,
+but additionally loads the QML component directly into a QGraphicsView. It is convenient for loading
+a displayable QML component into a QWidget-based application.
+
+For example, suppose there is a \c MyItem.qml file that looks like this:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+
+This QML document can be loaded with QDeclarativeComponent or QDeclarativeView with the following
+C++ code. Using a QDeclarativeComponent requires calling QDeclarativeComponent::create() to create
+a new instance of the component, while a QDeclarativeView automatically creates an instance of the
+component, which is accessible via QDeclarativeView::rootObject():
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-a
+\dots 0
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-b
+\o
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeView
+\endtable
+
+This \c object is the instance of the \c MyItem.qml component that has been created. You can now
+modify the item's properties using QObject::setProperty() or QDeclarativeProperty:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp properties
+
+Alternatively, you can cast the object to its actual type and call functions with compile-time
+safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the
+QDeclarativeItem class:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp cast
+
+You can also connect to any signals or call functions defined in the component using
+QMetaObject::invokeMethod() and QObject::connect(). See \l {Exchanging data between QML and C++}
+below for further details.
+
+\section3 Locating child objects
+
+QML components are essentially object trees with children that have siblings and their own children.
+Child objects of QML components can be located using the QObject::objectName property with
+QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml child
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+
+The child could be located like this:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp findChild
+
+If \c objectName is used inside a delegate of a ListView, \l Repeater or some other
+element that creates multiple instances of its delegates, there will be multiple children with
+the same \c objectName. In this case, QObject::findChildren() can be used to find all children
+with a matching \c objectName.
+
+\warning While it is possible to use C++ to access and manipulate QML objects deep into the
+object tree, we recommend that you do not take this approach outside of application
+testing and prototyping. One strength of QML and C++ integration is the ability to implement the
+QML user interface separately from the C++ logic and dataset backend, and this strategy breaks if the
+C++ side reaches deep into the QML components to manipulate them directly. This would make it difficult
+to, for example, swap a QML view component for another view, if the new component was missing a
+required \c objectName. It is better for the C++ implementation to know as little as possible about
+the QML user interface implementation and the composition of the QML object tree.
+
+
+\section2 Embedding C++ objects into QML components
+
+When loading a QML scene into a C++ application, it can be useful to directly embed C++ data into
+the QML object. QDeclarativeContext enables this by exposing data to the context of a QML
+component, allowing data to be injected from C++ into QML.
+
+For example, here is a QML item that refers to a \c currentDateTime value that does not exist in
+the current scope:
+
+\snippet doc/src/snippets/declarative/qtbinding/context/MyItem.qml 0
+
+This \c currentDateTime value can be set directly by the C++ application that loads the QML
+component, using QDeclarativeContext::setContextProperty():
+
+\snippet doc/src/snippets/declarative/qtbinding/context/main.cpp 0
+
+Context properties can hold either QVariant or QObject* values. This means custom C++ objects can
+also be injected using this approach, and these objects can be modified and read directly in QML.
+Here, we modify the above example to embed a QObject instance instead of a QDateTime value, and the QML code
+invokes a method on the object instance:
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml 0
+\endtable
+
+(Note that date/time values returned from C++ to QML can be formatted through
+\l{QML:Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
+
+If the QML item needs to receive signals from the context property, it can connect to them using the
+\l Connections element. For example, if \c ApplicationData has a signal named \c
+dataChanged(), this signal can be connected to using an \c onDataChanged handler within
+a \l Connections object:
+
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml 0
+
+Context properties can be useful for using C++ based data models in a QML view. See the
+\l {declarative/modelviews/stringlistmodel}{String ListModel},
+\l {declarative/modelviews/objectlistmodel}{Object ListModel} and
+\l {declarative/modelviews/abstractitemmodel}{AbstractItemModel} models for
+respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel
+in QML views.
+
+Also see the QDeclarativeContext documentation for more information.
+
+
+\section2 Defining new QML elements
+
+While new QML elements can be \l {Defining new Components}{defined in QML}, they can also be
+defined by C++ classes; in fact, many of the core \l {QML Elements} are implemented through
+C++ classes. When you create a QML object using one of these elements, you are simply creating an
+instance of a QObject-based C++ class and setting its properties.
+
+For example, here is an \c ImageViewer class with an \c image URL property:
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h 0
+
+Aside from the fact that it inherits QDeclarativeItem, this is an ordinary class that could
+exist outside of QML. However, once it is registered with the QML engine using qmlRegisterType():
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/main.cpp register
+
+Then, any QML code loaded by your C++ application or \l{QDeclarativeExtensionPlugin}{plugin} can create and manipulate
+\c ImageViewer objects:
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/standalone.qml 0
+
+Note that custom C++ types do not have to inherit from QDeclarativeItem; this is only necessary if it is
+a displayable item. If the item is not displayable, it can simply inherit from QObject.
+
+For more information on defining new QML elements, see the \l {Tutorial: Writing QML extensions with C++}
+{Writing QML extensions with C++} tutorial and the \l {Extending QML in C++} reference
+documentation.
+
+
+
+\section1 Exchanging data between QML and C++
+
+QML and C++ objects can communicate with one another through signals, slots and property
+modifications. For a C++ object, any data that is exposed to Qt's \l{The Meta-Object System}{Meta-Object System}
+- that is, properties, signals, slots and Q_INVOKABLE methods - become available to QML. On
+the QML side, all QML object data is automatically made available to the meta-object system and can
+be accessed from C++.
+
+
+\section2 Calling functions
-QML components are instantiated in a QDeclarativeContext. A context allows the application to expose data
-to the QML component instance. A single QDeclarativeContext can be used to instantiate all the objects
-used by an application, or several QDeclarativeContext can be created for more fine grained control over
-the data exposed to each instance. If a context is not passed to the QDeclarativeComponent::create()
-method, the QDeclarativeEngine's \l {QDeclarativeEngine::rootContext()}{root context} is used. Data exposed through
-the root context is available to all object instances.
+QML functions can be called from C++ and vice-versa.
-\section1 Simple Data
+All QML functions are exposed to the meta-object system and can be called using
+QMetaObject::invokeMethod(). Here is a C++ application that uses this to call a QML function:
-To expose data to a QML component instance, applications set \l {QDeclarativeContext::setContextProperty()}
-{context properties} which are then accessible by name from QML \l {Property Binding}s and JavaScript.
-The following example shows how to expose a background color to a QML file through QDeclarativeView:
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml 0
+\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp 0
+\endtable
+
+Notice the Q_RETURN_ARG() and Q_ARG() arguments for QMetaObject::invokeMethod() must be specified as
+QVariant types, as this is the generic data type used for QML functions and return values.
+
+To call a C++ function from QML, the function must be either a Qt slot, or a function marked with
+the Q_INVOKABLE macro, to be available to QML. In the following example, the QML code invokes
+methods on the \c myObject object, which has been set using QDeclarativeContext::setContextProperty():
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp 0
+\endtable
+
+Note that QML does not support overloaded functions. If a C++ has more than one function with the
+same name, there is no guarantee which overloaded function will be called from QML.
+
+
+\section2 Receiving signals
+
+All QML signals are automatically available to C++, and can be connected to using QObject::connect()
+like any ordinary Qt C++ signal.
+
+Here is a QML component with a signal named \c qmlSignal. This signal is connected to a C++ object's
+slot using QObject::connect():
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp 0
+\endtable
+
+To connect to Qt C++ signals from within QML, use a signal handler with the \c on<SignalName> syntax.
+If the C++ object is directly creatable from within QML (see \l {Defining new QML elements} above)
+then the signal handler can be defined within the object declaration. In the following example, the
+QML code creates a \c ImageViewer object, and the \c imageChanged and \c loadingError signals of the
+C++ object are connected to through \c onImagedChanged and \c onLoadingError signal handlers in QML:
\table
\row
\o
-\c {// main.cpp}
-\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 0
+
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h start
+\dots 4
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h end
\o
-\c {// main.qml}
-\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml 0
+\endtable
+
+(Note that if a signal has been declared as the NOTIFY signal for a property, QML allows it to be
+received with an \c on<Property>Changed handler even if the signal's name does not follow the \c
+<Property>Changed naming convention. In the above example, if the "imageChanged" signal was named
+"imageModified" instead, the \c onImageChanged signal handler would still be called.)
+
+If, however, the object with the signal is not created from within the QML code, and the QML item only has a
+reference to the created object - for example, if the object was set using
+QDeclarativeContext::setContextProperty() - then the \l Connections element can be used
+instead to create the signal handler:
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp connections
+\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml 0
\endtable
-Or, if you want \c main.cpp to create the component without showing it in a QDeclarativeView, you could create an instance of QDeclarativeContext using QDeclarativeEngine::rootContext() instead:
-\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 1
+\section2 Modifying properties
-Context properties work just like normal properties in QML bindings - if the \c backgroundColor
-context property in this example was changed to red, the component object instances would
-all be automatically updated. Note that it is the responsibility of the creator to delete any
-QDeclarativeContext it constructs. If the \c windowContext is no longer needed when
-the \c window component instantiation is destroyed, the \c windowContext must be destroyed
-explicitly. The simplest way to ensure this is to set \c window as \c windowContext's parent.
+Any properties declared in a QML object are automatically accessible from C++. Given a QML item
+like this:
-QDeclarativeContexts form a tree - each QDeclarativeContext except for the root context has a parent. Child
-QDeclarativeContexts effectively inherit the context properties present in their parents. This gives
-applications more freedom in partitioning the data exposed to different QML object instances.
-If a QDeclarativeContext sets a context property that is also set in one of its parents, the new context
-property shadows that in the parent. In The following example, the \c background context property
-in \c {Context 1} shadows the \c background context property in the root context.
+\snippet doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml 0
-\image qml-context-tree.png
+The value of the \c someNumber property can be set and read using QDeclarativeProperty, or
+QObject::setProperty() and QObject::property():
-\section2 Structured Data
+\snippet doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp 0
-Context properties can also be used to expose structured and writable data to QML objects. In
-addition to all the types already supported by QVariant, QObject derived types can be assigned to
-context properties. QObject context properties allow the data exposed to be more structured, and
-allow QML to set values.
+You should always use QObject::setProperty(), QDeclarativeProperty or QMetaProperty::write() to
+change a QML property value, to ensure the QML engine is made aware of the property change. For example,
+say you have a custom element \c PushButton with a \c buttonText property that internally reflects
+the value of a \c m_buttonText member variable. Modifying the member variable directly like this is
+not a good idea:
-The following example creates a \c CustomPalette object, and sets it as the \c palette context
-property.
+\badcode
+// BAD!
+QDeclarativeComponent component(engine, "MyButton.qml");
+PushButton *button = qobject_cast<PushButton*>(component.create());
+button->m_buttonText = "Click me";
+\endcode
-\snippet doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h 0
+Since the value is changed directly, this bypasses Qt's \l{The Meta-Object System}{meta-object system}
+and the QML engine is not made aware of the property change. This means property bindings to
+\c buttonText would not be updated, and any \c onButtonTextChanged handlers would not be called.
-\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.cpp 0
-The QML that follows references the palette object, and its properties, to set the appropriate
-background and text colors. When the window is clicked, the palette's text color is changed, and
-the window text will update accordingly.
+\target properties-cpp
-\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.qml 0
+Any \l {The Property System}{Qt properties} - that is, those declared with the Q_PROPERTY()
+macro - are accessible from QML. Here is a modified version of the \l {Embedding C++ objects into
+QML components}{earlier example} on this page; here, the \c ApplicationData class has a \c backgroundColor
+property. This property can be written to and read from QML:
-To detect when a C++ property value - in this case the \c CustomPalette's \c text property -
-changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal
-that is emitted whenever the property changes value. Implementers should take care to only emit the
-signal if the value \e changes to prevent loops from occurring. Accessing a property from a
-binding that does not have a NOTIFY signal will cause QML to issue a warning at runtime.
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h 0
+\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml 0
+\endtable
-\section2 Dynamic Structured Data
+Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal for the
+\c backgroundColor property. If a Qt property does not have an associated NOTIFY signal,
+the property cannot be used for \l {Property Binding} in QML, as the QML engine would not be
+notified when the value changes. If you are using custom types in QML, make sure their
+properties have NOTIFY signals so that they can be used in property bindings.
-If an application is too dynamic to structure data as compile-time QObject types, dynamically
-structured data can be constructed at runtime using the QDeclarativePropertyMap class.
+See \l {Tutorial: Writing QML extensions with C++} for further details and examples
+on using Qt properties with QML.
-\section1 Calling C++ methods from QML
+\section1 Supported data types
-It is possible to call methods of QObject derived types by either exposing the
-methods as public slots, or by marking the methods Q_INVOKABLE.
+Any C++ data that is used from QML - whether as custom properties, or parameters for signals or
+functions - must be of a type that is recognizable by QML.
-The C++ methods can also have parameters and return values. QML has support for
-the following types:
+By default, QML recognizes the following data types:
\list
\o bool
@@ -163,102 +426,169 @@ the following types:
\o QSize, QSizeF
\o QRect, QRectF
\o QVariant
+\o QObject*
+\o Enumerations declared with Q_ENUMS()
\endlist
-This example toggles the "Stopwatch" object on/off when the MouseArea is clicked:
+To allow a custom C++ type to be created or used in QML, the C++ class must be registered as a QML
+type using qmlRegisterType(), as shown in the \l {Defining new QML elements} section above.
-\table
-\row
-\o
-\c {// main.cpp}
-\snippet doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h 0
-\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp 0
-\o
-\c {// main.qml}
-\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.qml 0
+\section2 Using enumerations of a custom type
-\endtable
+To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
+register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
-Note that in this particular example a better way to achieve the same result
-is to have a "running" property in \c main.qml. This leads to much nicer QML code:
+\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h start
+\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h end
+
+Providing the \c ImageViewer class has been registered using qmlRegisterType(), its \c Status enum can
+now be used from QML:
+
+\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 0
+
+The C++ type must be registered with QML to use its enums. If your C++ type is not instantiable, it
+can be registered using qmlRegisterUncreatableType(). To be accessible from QML, the names of enum values
+must begin with a capital letter.
+
+See the \l {Tutorial: Writing QML extensions with C++}{Writing QML extensions with C++} tutorial and
+the \l {Extending QML in C++} reference documentation for more information.
+
+
+\section2 Automatic type conversion
+
+As a convenience, some basic types can be specified in QML using format strings to make it easier to
+pass simple values from QML to C++.
\table
+\header
+\o Type
+\o String format
+\o Example
\row
-\o
-\code
-// main.qml
-import QtQuick 1.0
-
-Rectangle {
- MouseArea {
- anchors.fill: parent
- onClicked: stopwatch.running = !stopwatch.running
- }
-}
-\endcode
+\o QColor
+\o Color name, "#RRGGBB", "#RRGGBBAA"
+\o "red", "#ff0000", "#ff000000"
+\row
+\o QDate
+\o "YYYY-MM-DD"
+\o "2010-05-31"
+\row
+\o QPoint
+\o "x,y"
+\o "10,20"
+\row
+\o QRect
+\o "x,y,WidthxHeight"
+\o "50,50,100x100"
+\row
+\o QSize
+\o "WidthxHeight"
+\o "100x200"
+\row
+\o QTime
+\o "hh:mm:ss"
+\o "14:22:55"
+\row
+\o QUrl
+\o URL string
+\o "http://www.example.com"
+\row
+\o QVector3D
+\o "x,y,z"
+\o "0,1,0"
+\row
+\o Enumeration value
+\o Enum value name
+\o "AlignRight"
\endtable
-Of course, it is also possible to call \l {Adding new methods}{functions declared in QML from C++}.
+(More details on these string formats and types can be found in the
+\l {QML Basic Types}{basic type documentation}.)
+
+These string formats can be used to set QML \c property values and pass arguments to C++
+functions. This is demonstrated by various examples on this page; in the above
+\l{#properties-cpp}{Qt properties example}, the \c ApplicationData class has a \c backgroundColor
+property of a QColor type, which is set from the QML code with the string "red" rather rather
+than an actual QColor object.
+
+If it is preferred to pass an explicitly-typed value rather than a string, the global
+\l{QmlGlobalQtObject}{Qt object} provides convenience functions for creating some of the object
+types listed above. For example, \l{QML:Qt::rgba()}{Qt.rgba()} creates a QColor value from four
+RGBA values. The QColor returned from this function could be used instead of a string to set
+a QColor-type property or to call a C++ function that requires a QColor parameter.
+
+
+\section1 Writing QML plugins
+
+The Qt Declarative module includes the QDeclarativeExtensionPlugin class, which is an abstract
+class for writing QML plugins. This allows QML extension types to be dynamically loaded into
+QML applications.
+
+See the QDeclarativeExtensionPlugin documentation and \l {How to Create Qt Plugins} for more
+details.
+
+
+\section1 Managing resource files with the Qt resource system
+The \l {The Qt Resource System}{Qt resource system} allows resource files to be stored as
+binary files in an application executable. This can be useful when building a mixed
+QML/C++ application as it enables QML files (as well as other resources such as images
+and sound files) to be referred to through the resource system URI scheme rather than
+relative or absolute paths to filesystem resources. Note, however, that if you use the resource
+system, the application executable must be re-compiled whenever a QML source file is changed
+in order to update the resources in the package.
-\section1 Network Components
+To use the resource system in a mixed QML/C++ application:
-If the URL passed to QDeclarativeComponent is a network resource, or if the QML document references a
-network resource, the QDeclarativeComponent has to fetch the network data before it is able to create
-objects. In this case, the QDeclarativeComponent will have a \l {QDeclarativeComponent::Loading}{Loading}
-\l {QDeclarativeComponent::status()}{status}. An application will have to wait until the component
-is \l {QDeclarativeComponent::Ready}{Ready} before calling \l {QDeclarativeComponent::create()}.
+\list
+\o Create a \c .qrc \l {The Qt Resource System}{resource collection file} that lists resource
+ files in XML format
+\o From C++, load the main QML file as a resource using the \c :/ prefix or as a URL with the
+ \c qrc scheme
+\endlist
+
+Once this is done, all files specified by relative paths in QML will be loaded from
+the resource system instead. Use of the resource system is completely transparent to
+the QML layer; this means all QML code should refer to resource files using relative
+paths and should \e not use the \c qrc scheme. This scheme should only be used from
+C++ code for referring to resource files.
-The following example shows how to load a QML file from a network resource. After creating
-the QDeclarativeComponent, it tests whether the component is loading. If it is, it connects to the
-QDeclarativeComponent::statusChanged() signal and otherwise calls the \c {continueLoading()} method
-directly. This test is necessary, even for URLs that are known to be remote, just in case
-the component has been cached and is ready immediately.
+Here is a application packaged using the \l {The Qt Resource System}{Qt resource system}.
+The directory structure looks like this:
\code
-MyApplication::MyApplication()
-{
- // ...
- component = new QDeclarativeComponent(engine, QUrl("http://www.example.com/main.qml"));
- if (component->isLoading())
- QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
- this, SLOT(continueLoading()));
- else
- continueLoading();
-}
-
-void MyApplication::continueLoading()
-{
- if (component->isError()) {
- qWarning() << component->errors();
- } else {
- QObject *myObject = component->create();
- }
-}
+project
+ |- example.qrc
+ |- main.qml
+ |- images
+ |- background.png
+ |- main.cpp
+ |- project.pro
\endcode
-\section1 Qt Resources
+The \c main.qml and \c background.png files will be packaged as resource files. This is
+done in the \c example.qrc resource collection file:
-QML content can be loaded from \l {The Qt Resource System} using the \e qrc: URL scheme.
-For example:
+\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
-\c [project/example.qrc]
-\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
+Since \c background.png is a resource file, \c main.qml can refer to it using the relative
+path specified in \c example.qrc:
+
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
-\c [project/project.pro]
-\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
+To allow QML to locate resource files correctly, the \c main.cpp loads the main QML
+file, \c main.qml, as a resource file using the \c qrc scheme:
-\c [project/main.cpp]
\snippet doc/src/snippets/declarative/qtbinding/resources/main.cpp 0
-\c [project/main.qml]
-\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
+Finally \c project.pro uses the RESOURCES variable to indicate that \c example.qrc should
+be used to build the application resources:
+
+\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
+
+See \l {The Qt Resource System} for more information.
-Note that the resource system cannot be accessed from QML directly. If the main QML file is
-loaded as a resource, all files specified as relative paths in QML will also be loaded from
-the resource system. Using the resource system is completely transparent to the QML layer.
-This also means that if the main QML file is not loaded as a resource then files in the resource
-system cannot be accessed from QML.
*/
+
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 7ecdc53..f2b2032 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -27,7 +27,7 @@
/*!
\module QtDeclarative
- \title QtDeclarative Module
+ \title Qt Declarative Module
\ingroup modules
\brief The Qt Declarative module provides a declarative framework
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index f8d1d0e..df0e999 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/doc/src/development/designer-manual.qdoc b/doc/src/development/designer-manual.qdoc
index b30a700..df82fba 100644
--- a/doc/src/development/designer-manual.qdoc
+++ b/doc/src/development/designer-manual.qdoc
@@ -1769,37 +1769,54 @@ pixmap property in the property editor.
\title Using a Designer UI File in Your Application
- With Qt's integrated build tools, \l{qmake Manual}{qmake} and \l uic, the
- code for user interface components created with \QD is automatically
- generated when the rest of your application is built. Forms can be included
- and used directly from your application. Alternatively, you can use them to
- extend subclasses of standard widgets. These forms can be processed at
- compile time or at run time, depending on the approach used.
+ Qt Designer UI files represent the widget tree of the form in XML format. The
+ forms can be processed:
+ \list
+ \o \l{Compile Time Form Processing}{At compile time}, which means that forms
+ are converted to C++ code that can be compiled.
+ \o \l{Run Time Form Processing}{At runtime}, which means that forms are processed
+ by the QUiLoader class that dynamically constructs the widget tree while
+ parsing the XML file.
+ \endlist
\tableofcontents
\section1 Compile Time Form Processing
+ You create user interface components with \QD and use Qt's integrated build tools,
+ \l{qmake Manual}{qmake} and \l{User Interface Compiler (uic)}{uic}, to generate code
+ for them when the application is built. The generated code contains the form's user
+ interface object. It is a C++ struct that contains:
+
+ \list
+ \o Pointers to the form's widgets, layouts, layout items,
+ button groups, and actions.
+ \o A member function called \c setupUi() to build the widget tree
+ on the parent widget.
+ \o A member function called \c retranslateUi() that handles the
+ translation of the string properties of the form. For more information,
+ see \l{Reacting to Language Changes}.
+ \endlist
+
+ The generated code can be included in your application and used directly from
+ it. Alternatively, you can use it to extend subclasses of standard widgets.
+
A compile time processed form can be used in your application with one of
the following approaches:
\list
- \o The Direct Approach: you construct a widget to use as a placeholder
+ \o \l{The Direct Approach}: you construct a widget to use as a placeholder
for the component, and set up the user interface inside it.
- \o The Single Inheritance Approach: you subclass the form's base class
+ \o \l{The Single Inheritance Approach}: you subclass the form's base class
(QWidget or QDialog, for example), and include a private instance
of the form's user interface object.
- \o The MultipleInheritance Approach: you subclass both the form's base
+ \o \l{The Multiple Inheritance Approach}: you subclass both the form's base
class and the form's user interface object. This allows the widgets
defined in the form to be used directly from within the scope of
the subclass.
\endlist
-
- \section2 The Direct Approach
-
- To demonstrate how to use user interface (UI) files straight from
- \QD, we create a simple Calculator Form application. This is based on the
+ To demonstrate, we create a simple Calculator Form application. It is based on the
original \l{Calculator Form Example}{Calculator Form} example.
The application consists of one source file, \c main.cpp and a UI
@@ -1817,15 +1834,18 @@ pixmap property in the property editor.
The special feature of this file is the \c FORMS declaration that tells
\c qmake which files to process with \c uic. In this case, the
\c calculatorform.ui file is used to create a \c ui_calculatorform.h file
- that can be used by any file listed in the \c SOURCES declaration. To
- ensure that \c qmake generates the \c ui_calculatorform.h file, we need to
- include it in a file listed in \c SOURCES. Since we only have \c main.cpp,
- we include it there:
+ that can be used by any file listed in the \c SOURCES declaration.
- \snippet doc/src/snippets/uitools/calculatorform/main.cpp 0
+ \note You can use Qt Creator to create the Calculator Form project. It
+ automatically generates the main.cpp, UI, and .pro files, which you can
+ then modify.
+
+ \section2 The Direct Approach
- This include is an additional check to ensure that we do not generate code
- for UI files that are not used.
+ To use the direct approach, we include the \c ui_calculatorform.h file
+ directly in \c main.cpp:
+
+ \snippet doc/src/snippets/uitools/calculatorform/main.cpp 0
The \c main function creates the calculator widget by constructing a
standard QWidget that we use to host the user interface described by the
@@ -1837,23 +1857,33 @@ pixmap property in the property editor.
from the \c ui_calculatorform.h file that sets up all the dialog's widgets
and the connections between its signals and slots.
- This approach provides a quick and easy way to use simple, self-contained
- components in your applications, but many componens created with \QD will
+ The direct approach provides a quick and easy way to use simple, self-contained
+ components in your applications. However, componens created with \QD often
require close integration with the rest of the application code. For
instance, the \c CalculatorForm code provided above will compile and run,
but the QSpinBox objects will not interact with the QLabel as we need a
custom slot to carry out the add operation and display the result in the
- QLabel. To achieve this, we need to subclass a standard Qt widget (known as
- the single inheritance approach).
-
+ QLabel. To achieve this, we need to use the single inheritance approach.
\section2 The Single Inheritance Approach
+ To use the single inheritance approach, we subclass a standard Qt widget and
+ include a private instance of the form's user interface object. This can take
+ the form of:
+
+ \list
+ \o A member variable
+ \o A pointer member variable
+ \endlist
+
+ \section3 Using a Member Variable
+
In this approach, we subclass a Qt widget and set up the user interface
from within the constructor. Components used in this way expose the widgets
and layouts used in the form to the Qt widget subclass, and provide a
standard system for making signal and slot connections between the user
interface and other objects in your application.
+ The generated \c{Ui::CalculatorForm} structure is a member of the class.
This approach is used in the \l{Calculator Form Example}{Calculator Form}
example.
@@ -1893,6 +1923,52 @@ pixmap property in the property editor.
them. This approach can be used to create individual tabs from existing
forms, for example.
+ \section3 Using a Pointer Member Variable
+
+ Alternatively, the \c{Ui::CalculatorForm} structure can be made a pointer
+ member of the class. The header then looks as follows:
+
+ \code
+
+ namespace Ui {
+ class CalculatorForm;
+ }
+
+ class CalculatorForm : public QWidget
+ ...
+ virtual ~CalculatorForm();
+ ...
+ private:
+ Ui::CalculatorForm *ui;
+ ...
+
+ \endcode
+
+ The corresponding source file looks as follows:
+
+ \code
+ #include "ui_calculatorform.h"
+
+ CalculatorForm::CalculatorForm(QWidget *parent) :
+ QWidget(parent), ui(new Ui::CalculatorForm)
+ {
+ ui->setupUi(this);
+ }
+
+ CalculatorForm::~CalculatorForm()
+ {
+ delete ui;
+ }
+ \endcode
+
+ The advantage of this approach is that the user interface object can be
+ forward-declared, which means that we do not have to include the generated
+ \c ui_calculatorform.h file in the header. The form can then be changed without
+ recompiling the dependent source files. This is particularly important if the
+ class is subject to binary compatibility restrictions.
+
+ We generally recommend this approach for libraries and large applications.
+ For more information, see \l{Creating Shared Libraries}.
\section2 The Multiple Inheritance Approach
@@ -1906,13 +1982,14 @@ pixmap property in the property editor.
{Multiple Inheritance} example.
We need to include the header file that \c uic generates from the
- \c calculatorform.ui file:
+ \c calculatorform.ui file, as follows:
\snippet examples/uitools/multipleinheritance/calculatorform.h 0
The class is defined in a similar way to the one used in the
\l{The Single Inheritance Approach}{single inheritance approach}, except that
- this time we inherit from \e{both} QWidget and \c{Ui::CalculatorForm}:
+ this time we inherit from \e{both} QWidget and \c{Ui::CalculatorForm},
+ as follows:
\snippet examples/uitools/multipleinheritance/calculatorform.h 1
@@ -1931,11 +2008,26 @@ pixmap property in the property editor.
same say as a widget created in code by hand. We no longer require the
\c{ui} prefix to access them.
- Subclassing using multiple inheritance gives us more direct access to the
- contents of the form, is slightly cleaner than the single inheritance
- approach, but does not conveniently support composition of multiple user
- interfaces.
+ \section2 Reacting to Language Changes
+
+ Qt notifies applications if the user interface language changes by sending an
+ event of the type QEvent::LanguageChange. To call the member function
+ \c retranslateUi() of the user interface object, we reimplement
+ \c QWidget::changeEvent() in the form class, as follows:
+ \code
+ void CalculatorForm::changeEvent(QEvent *e)
+ {
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+ }
+ \endcode
\section1 Run Time Form Processing
diff --git a/doc/src/development/developing-with-qt.qdoc b/doc/src/development/developing-with-qt.qdoc
index 3972b59..6793abd 100644
--- a/doc/src/development/developing-with-qt.qdoc
+++ b/doc/src/development/developing-with-qt.qdoc
@@ -81,8 +81,8 @@
\o \l {Compiler Notes}
\o \l {Developing Qt Applications for Mac OS X}
\o \l {Known Issues}
- \o \l {Platform Notes}
- \o \l {Platform Notes - Symbian}
+ \o \l {Platform and Compiler Notes}
+ \o \l {Platform and Compiler Notes - Symbian}
\o \l {ActiveX in Qt}
\o \l {Qt for Embedded Linux Classes}
\o \l {Qt for Embedded Platforms}
@@ -112,4 +112,4 @@
\endtable
-*/ \ No newline at end of file
+*/
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index d65967d..c0ed940 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1294,6 +1294,14 @@
test sections in generated bld.inf instead of their regular sections.
Note that this only affects automatically generated bld.inf content;
the content added via \c BLD_INF_RULES variable is not affected.
+ \row \o localize_deployment \o Makes \c lupdate tool add fields for
+ application captions and package file names into generated \c{.ts}
+ files. Qmake generates properly localized \c{.loc} and \c{.pkg} files
+ based on available translations. Translation file name bodies must
+ end with underscore and the language code for deployment localization
+ to work. E.g. \c{myapp_en.ts}.
+ \bold{Note:} All languages supported by Qt are not supported by Symbian,
+ so some \c{.ts} files may be ignored by qmake.
\endtable
These options have an effect on Linux/Unix platforms:
@@ -1394,12 +1402,16 @@
On the Symbian platform, generic PKG file content can also be specified with this
variable. You can use either \c pkg_prerules or \c pkg_postrules to
pass raw data to PKG file. The strings in \c pkg_prerules are added before
- package-body and \c pkg_postrules after. The strings defined in
- \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they
- should be in a format understood by Symbian package generation tools.
+ package-body and \c pkg_postrules after. \c pkg_prerules is used for
+ defining vendor information, dependencies, custom package headers, and the
+ like, while \c pkg_postrules is used for custom file deployment and
+ embedded sis directives.
+ The strings defined in \c pkg_postrules or \c pkg_prerules are not parsed
+ by qmake, so they should be in a format understood by Symbian package
+ generation tools.
Please consult the Symbian platform documentation for correct syntax.
- For example, to deploy DLL and add a new dependency:
+ For example, to deploy DLL and add a new dependency:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
@@ -1415,13 +1427,28 @@
\o localized and unique vendor, for example \BR
%{"Vendor-EN", ..., "Vendor-FR"}
:"Unique vendor name"
- \endlist
+ \endlist
- If you decide to override any of these statements, you need to pay
+ If you decide to override any of these statements, you need to pay
attention that also other statements stay valid. For example if you
override languages statement, you must override also package-header
statement and all other statements which are language specific.
+ On the Symbian platform, three separate PKG files are generated:
+
+ \list
+ \o <app>_template.pkg - For application SIS file. Rules suffix: \c{.main}
+ \o <app>_installer.pkg - For smart installer SIS file. Rules suffix: \c{.installer}
+ \o <app>_stub.pkg - For ROM stubs. Rules suffix: \c{.stub}
+ \endlist
+
+ \c pkg_prerules and \c pkg_postrules given without rules suffix will
+ intelligently apply to each of these files, but rules can also be
+ targeted to only one of above files by appending listed rules suffix
+ to the variable name:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 153
+
On the Symbian platform, the \c default_deployment item specifies
default platform and package dependencies. Those dependencies can be
selectively disabled if alternative dependencies need to be defined
@@ -1439,6 +1466,46 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141
+ On the Symbian platform, a default deployment is generated for all
+ application projects. You can modify the autogenerated default
+ deployment via following \c DEPLOYMENT variable values:
+
+ \list
+ \o default_bin_deployment - Application executable
+ \o default_resource_deployment - Application resources, including icon
+ \o default_reg_deployment - Application registration file
+ \endlist
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 154
+
+ This will entirely remove the default application deployment.
+
+ On the Symbian platform, you can specify file specific install options
+ with \c{.flags} modifier. Please consult the Symbian platform documentation
+ for supported options.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 155
+
+ This will show a message box that gives user an option to cancel the
+ installation and then automatically runs the application after
+ installation is complete.
+
+ \note Automatically running the applications after install may require signing
+ the package with better than self-signed certificate, depending on the phone model.
+ Additionally, some tools such as Runonphone may not work properly with sis
+ packages that automatically run the application upon install.
+
+ On the Symbian platform, the default package name and the default name that
+ appears in application menu is derived from the \c TARGET variable.
+ Often the default is not optimal for displaying to end user. To set a better
+ display name for these purposes, use \c{DEPLOYMENT.display_name} variable:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 156
+
On the Symbian platform, you can use \c{DEPLOYMENT.installer_header}
variable to generate smart installer wrapper for your application.
If you specify just UID of the installer package as the value, then
diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc
index cc5afd2..e53957f 100644
--- a/doc/src/development/qtestlib.qdoc
+++ b/doc/src/development/qtestlib.qdoc
@@ -32,7 +32,7 @@
\ingroup frameworks-technologies
\ingroup qt-basic-concepts
-
+
\keyword qtestlib
The QTestLib framework, provided by Nokia, is a tool for unit
@@ -40,10 +40,6 @@
all the functionality commonly found in unit testing frameworks as
well as extensions for testing graphical user interfaces.
- Table of contents:
-
- \tableofcontents
-
\section1 QTestLib Features
QTestLib is designed to ease the writing of unit tests for Qt
@@ -88,6 +84,10 @@
\o Custom types can easily be added to the test data and test output.
\endtable
+ \note For higher-level GUI and application testing needs, please
+ see the \l{Partner Directory} for Qt testing products provided by
+ Nokia partners.
+
\section1 QTestLib API
@@ -213,17 +213,17 @@
\endlist
\section2 Creating a Benchmark
-
+
To create a benchmark, follow the instructions for creating a test and then add a
QBENCHMARK macro to the test function that you want to benchmark.
-
+
\snippet doc/src/snippets/code/doc_src_qtestlib.qdoc 12
-
+
The code inside the QBENCHMARK macro will be measured, and possibly also repeated
several times in order to get an accurate measurement. This depends on the selected
measurement back-end. Several back-ends are available. They can be selected on the
command line:
-
+
\target testlib-benchmarking-measurement
\table
@@ -243,7 +243,7 @@
\o -eventcounter
\o All platforms
\endtable
-
+
In short, walltime is always available but requires many repetitions to
get a useful result.
Tick counters are usually available and can provide
@@ -255,7 +255,7 @@
Event counting is available on all platforms and it provides the number of events
that were received by the event loop before they are sent to their corresponding
targets (this might include non-Qt events).
-
+
\note Depending on the device configuration, Tick counters on the
Windows CE platform may not be as fine-grained, compared to other platforms.
Devices that do not support high-resolution timers default to
@@ -320,7 +320,7 @@
host computer and the device. Thus header files and libraries are needed to compile
cetest and QtRemote successfully.
- Prior to \l{Installing Qt on Windows CE}{installation} of Qt, you need to set your
+ Prior to \l{Installing Qt for Windows CE}{installation} of Qt, you need to set your
\c INCLUDE and \c LIB environment variables properly.
A default installation of Windows Mobile 5 for Pocket PC can be obtained by:
@@ -334,7 +334,7 @@
The CPU tick counters used for benchmarking is licensed under the following
license: (from src/testlib/3rdparty/cycle.h)
-
+
\legalese
Copyright (c) 2003, 2006 Matteo Frigo\br
Copyright (c) 2003, 2006 Massachusetts Institute of Technology
@@ -365,6 +365,7 @@
\brief A short introduction to testing with QTestLib.
\contentspage QTestLib Manual
\nextpage {Chapter 1: Writing a Unit Test}{Chapter 1}
+ \ingroup best-practices
\title QTestLib Tutorial
diff --git a/doc/src/examples/webkit-bridge-imageanalyzer.qdoc b/doc/src/examples/webkit-bridge-imageanalyzer.qdoc
index b8c42c6..cee2659 100644
--- a/doc/src/examples/webkit-bridge-imageanalyzer.qdoc
+++ b/doc/src/examples/webkit-bridge-imageanalyzer.qdoc
@@ -24,9 +24,10 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
/*!
\example webkit/imageanalyzer
- \startpage {index.html} {Qt Reference Documentation}
+ \startpage {index.html}{Qt Reference Documentation}
\title The Webkit Bridge Tutorial - Hybrid Client Application
In this example, we will show how to write a hybrid application using
@@ -84,7 +85,7 @@ page's mainFrame with \c addToJavaScriptWindowObject().
\snippet examples/webkit/imageanalyzer/resources/index.html sample images
- Clicking an image adds it to an images list.
+Clicking an image adds it to an images list.
\snippet examples/webkit/imageanalyzer/resources/index.html addImage
diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc
index 3041046..8eeaeb1 100644
--- a/doc/src/external-resources.qdoc
+++ b/doc/src/external-resources.qdoc
@@ -436,7 +436,12 @@
/*!
\externalpage https://developer.mozilla.org/en/JavaScript
- \title JavaScript
+ \title JavaScript Resources
+*/
+
+/*!
+ \externalpage https://developer.mozilla.org/en/JavaScript/Guide
+ \title JavaScript Guide
*/
/*!
diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc
index 56b461e..356bf9b 100644
--- a/doc/src/frameworks-technologies/dnd.qdoc
+++ b/doc/src/frameworks-technologies/dnd.qdoc
@@ -44,7 +44,7 @@
outlines the approach used to enable it in custom widgets. Drag
and drop operations are also supported by Qt's item views and by
the graphics view framework. More information is available in
- \l{Using drag & drop with item views} and \l{Graphics View
+ \l{Using drag and drop with item views} and \l{Graphics View
Framework}.
\section1 Drag and Drop Classes
diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc
index 6de567c..cc98432 100644
--- a/doc/src/frameworks-technologies/model-view-programming.qdoc
+++ b/doc/src/frameworks-technologies/model-view-programming.qdoc
@@ -32,7 +32,7 @@
/*!
\page model-view-programming.html
- \ingroup qt-basic-concepts
+ \ingroup qt-basic-concepts
\title Model/View Programming
\brief A guide to Qt's extensible model/view architecture.
@@ -1635,7 +1635,7 @@
contain the text given in the search string. This pattern can also be
used in the list and table widgets.
- \section1 Using drag & drop with item views
+ \section1 Using Drag and Drop with Item Views
Qt's drag and drop infrastructure is fully supported by the model/view framework.
Items in lists, tables, and trees can be dragged within the views, and data can be
@@ -1715,7 +1715,7 @@
of QAbstractItemModel::removeRows(), either directly or by inheriting the
implementation from its base class.
- \section3 Enabling drag & drop for items
+ \section3 Enabling drag and drop for items
Models indicate to views which items can be dragged, and which will accept drops,
by reimplementing the QAbstractItemModel::flags() function to provide suitable
@@ -2154,7 +2154,7 @@
models to supply some unique identifier to this function to ensure that
the model index can be re-associated with its corresponding item later on.
- \section2 Drag & drop support and MIME type handling
+ \section2 Drag and drop support and MIME type handling
The model/view classes support drag and drop operations, providing default behavior
that is sufficient for many applications. However, it is also possible to customize
@@ -2283,7 +2283,7 @@
\endlist
For more information about drag and drop with item views, refer to
- \l{Using drag & drop with item views}.
+ \l{Using drag and drop with item views}.
\section3 Convenience views
@@ -2294,7 +2294,7 @@
the existing contents with the data being transferred, the underlying model
will set the data of the target items rather than insert new rows and columns
into the model. For more information on drag and drop in convenience views,
- you can see \l{Using drag & drop with item views}.
+ you can see \l{Using drag and drop with item views}.
\section2 Performance optimization for large amounts of data
diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc
index 3ef617c..2a0cc1a 100644
--- a/doc/src/frameworks-technologies/threads.qdoc
+++ b/doc/src/frameworks-technologies/threads.qdoc
@@ -213,10 +213,10 @@
/*!
\page threads-reentrancy.html
\title Reentrancy and Thread-Safety
-
+
\keyword reentrant
\keyword thread-safe
-
+
\previouspage Synchronizing Threads
\contentspage Thread Support in Qt
\nextpage Threads and QObjects
@@ -243,6 +243,15 @@
from multiple threads, even if all the threads use the \e{same}
instance of the class.
+ \note Qt classes are only documented as \e{thread-safe} if they
+ are intended to be used by multiple threads. If a function is not
+ marked as thread-safe or reentrant, it should not be used from
+ different threads. If a class is not marked as thread-safe or
+ reentrant then a specific instance of that class should not be
+ accessed from different threads.
+
+ \section1 Reentrancy
+
C++ classes are often reentrant, simply because they only access
their own member data. Any thread can call a member function on an
instance of a reentrant class, as long as no other thread can call
@@ -268,6 +277,8 @@
end up overwriting each other, and the variable is incremented
only once!
+ \section1 Thread-Safety
+
Clearly, the access must be serialized: Thread A must perform
steps 1, 2, 3 without interruption (atomically) before thread B
can perform the same steps; or vice versa. An easy way to make
@@ -284,6 +295,8 @@
declared with the \c mutable qualifier because we need to lock
and unlock the mutex in \c value(), which is a const function.
+ \section1 Notes on Qt Classes
+
Many Qt classes are \e{reentrant}, but they are not made
\e{thread-safe}, because making them thread-safe would incur the
extra overhead of repeatedly locking and unlocking a QMutex. For
@@ -297,9 +310,6 @@
the thread-related classes (e.g. QMutex) and fundamental functions
(e.g. QCoreApplication::postEvent()).
- \note Qt Classes are only documented as \e{thread-safe} if they
- are intended to be used by multiple threads.
-
\note Terminology in the multithreading domain isn't entirely
standardized. POSIX uses definitions of reentrant and thread-safe
that are somewhat different for its C APIs. When using other
@@ -459,11 +469,10 @@
\list
- \o \l{Qt::AutoConnection}{Auto Connection} (default) The behavior
- is the same as the Direct Connection, if the emitter and
- receiver are in the same thread. The behavior is the same as
- the Queued Connection, if the emitter and receiver are in
- different threads.
+ \o \l{Qt::AutoConnection}{Auto Connection} (default) If the signal is
+ emitted in the thread which the receiving object has affinity then
+ the behavior is the same as the Direct Connection. Otherwise,
+ the behavior is the same as the Queued Connection."
\o \l{Qt::DirectConnection}{Direct Connection} The slot is invoked
immediately, when the signal is emitted. The slot is executed
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index 398eee8..851e161 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -36,7 +36,7 @@
You can run the examples from the \l{Examples and Demos Launcher}
application (except see \l{QML Examples and Demos} {QML Examples}
- for special instructions for running thos examples).
+ for special instructions for running those examples).
The examples are listed below by functional area. Each example
listed in a particular functional area is meant to illustrate how
@@ -53,7 +53,8 @@
deliberately show off Qt's features. You might want to look at
these as well.
- These examples are provided under the terms of the \l{BSD License}.
+ These examples are provided under the terms of the
+ \l{New and Modified BSD Licenses}{Modified BSD License}.
\section1 Examples by Functional Area
diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc
index 065628a..b767587 100644
--- a/doc/src/getting-started/gettingstartedqml.qdoc
+++ b/doc/src/getting-started/gettingstartedqml.qdoc
@@ -42,7 +42,7 @@
installation instructions and requirements for different platforms.
Qt Quick includes a declarative language called
- \l{Introduction to the QML language}{QML}, the \l{QtDeclarative Module}, and
+ \l{Introduction to the QML language}{QML}, the \l{Qt Declarative Module}, and
\l{QML Viewer}.
\section1 QML to Build User Interfaces
@@ -58,7 +58,12 @@
\image qml-texteditor5_editmenu.png
- To run the QML example code, merely provide the included \l{QML Viewer}{qmlviewer}
+ The final source code is in the \c{examples/tutorials/gettingStarted/gsQml}
+ directory. You may need to compile the C++ plugin in the
+ \c{examples/tutorials/gettingStarted/gsQml/} first. This will put the
+ C++ plugin in a directory where the QML files may find it.
+
+ To launch the text editor, merely provide the included \l{QML Viewer}{qmlviewer}
tool with the QML file as the argument. The C++ portion of this tutorial assumes
that the reader possesses basic knowledge of Qt's compilation procedures.
@@ -81,7 +86,7 @@
In QML, the basic visual item is the \l {Rectangle}{Rectangle} element. The
\c Rectangle element has properties to control the element's appearance and location.
- \snippet examples/tutorials/gettingStarted/gsQml/core/Button.qml document
+ \snippet examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml document
First, the \c { import QtQuick 1.0 } allows the qmlviewer tool to import the QML elements
we will later use. This line must exist for every QML file. Notice that the version
@@ -1005,4 +1010,14 @@
The application can function as a simple text editor, able to accept text
and save the text into a file. The text editor can also load from a file and
perform text manipulation.
+
+ \section1 Running the Text Editor
+
+ We need to compile the file dialog C++ plugin before the text editor can run.
+ To compile, enter the \c gsQml directory, then run \c qmake and compile
+ using \c make or \c nmake, depending on your platform. To run, launch
+ qmlviewer and open the \c texteditor.qml file.
+
+ The source code is in the \c{examples/tutorials/gettingStarted/gsQml}
+ directory.
*/
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index fdb88f5..7196ab4 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -40,7 +40,7 @@ for your platform from the following list.
*/
/*! \page install-x11.html
-\title Installing Qt on X11 Platforms
+\title Installing Qt for X11 Platforms
\ingroup installation
\brief How to install Qt on platforms with X11.
\previouspage Installation
@@ -151,7 +151,7 @@ for your platform from the following list.
/*!
\page install-win.html
-\title Installing Qt on Windows
+\title Installing Qt for Windows
\ingroup installation
\brief How to install Qt on Windows.
\previouspage Installation
@@ -269,7 +269,7 @@ for your platform from the following list.
*/
/*! \page install-mac.html
-\title Installing Qt on Mac OS X
+\title Installing Qt for Mac OS X
\ingroup installation
\brief How to install Qt on Mac OS X.
\previouspage Installation
@@ -563,7 +563,7 @@ in the \l{Qt for the Symbian platform Requirements} document.
This document describes how to install and configure Qt for
the Symbian platform from scratch. If you are using pre-built binaries, follow
-the instructions given in the \l{Installing Qt on the Symbian platform from a
+the instructions given in the \l{Installing Qt for the Symbian platform from a
Binary Package} document.
\section1 Step 1: Set Up the Development Environment
@@ -697,187 +697,224 @@ the Symbian platform from scratch, using Linux as the build host.
Qt for Symbian binaries can be downloaded directly so development of
applications using Qt for Symbian can start right away.
-\section1 Step 1: Setup the development environment
+\section1 Step 1: Setup the Development Environment
+
+Qt for the Symbian platform has some requirements on the development
+platform. The Symbian SDK for Linux as well as a cross compiler for the ARM
+processor used on Symbian devices should be present on the development
+machine.
+
+See \l{http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
+
- Qt for the Symbian platform has some requirements on the development
- platform. The Symbian SDK for Linux as well as a cross compiler for the ARM
- processor used on Symbian devices should be present on the development
- machine.
-
- See \l{http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
\section1 Step 2: Unpack the Archive
- Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source package into the
- directory you want Qt installed, e.g. \c{/home/user/qt/%VERSION%}.
+Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source package into the
+directory you want Qt installed, e.g. \c{/home/user/qt/%VERSION%}.
+
\section1 Step 3: Set the Environment Variables
- In order to build and use Qt, the \c PATH environment variable needs
- to be extended to fine Qt tools and also to find the Symbian platform tools:
+In order to build and use Qt, the \c PATH environment variable needs
+to be extended to fine Qt tools and also to find the Symbian platform tools:
- First you need to set the \c EPOCROOT environment variable to point to the
- location of your S60 SDK:
+First you need to set the \c EPOCROOT environment variable to point to the
+location of your S60 SDK:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 36
- Then you can update the PATH variable;
+Then you can update the PATH variable;
+
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 37
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 37
\section1 Step 4: Configure Qt
- To configure Qt for the Symbian platform, do:
+To configure Qt for the Symbian platform, do:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 38
- to build the libraries using RVCT or
+
+to build the libraries using RVCT or
\snippet doc/src/snippets/code/doc_src_installation.qdoc 39
- to build the libraries using GCCE.
+
+to build the libraries using GCCE.
+
\section1 Step 5: Build Qt
- To build Qt for the device, type:
+To build Qt for the device, type:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 40
- Congratulations, Qt is now ready to use.
+Congratulations, Qt is now ready to use.
-\section1 Step 6: Building Qt packages for the Device
- To run any application or demo on a real device, you need to install it
- on the device. To do this you first have to create a a package for the
- device, containing the libraries:
+\section1 Step 6: Building Qt Packages for the Device
- \bold{Building a Qt package without a certificate}
+To run any application or demo on a real device, you need to install it
+on the device. To do this you first have to create a a package for the
+device, containing the libraries:
- If you have no certificate, build a self signed Qt:
+\bold{Building a Qt package without a certificate}
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 41
+If you have no certificate, build a self signed Qt:
- The Qt libraries are built with "All -Tcb" capability, so that
- they can support all types of applications. However, these
- capabilities are automatically lowered if you make a self-signed
- package.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 41
- \bold{Building a Qt package with a Symbian developer certificate}
+The Qt libraries are built with "All -Tcb" capability, so that
+they can support all types of applications. However, these
+capabilities are automatically lowered if you make a self-signed
+package.
- If you have a symbian-signed developer certificate, specify the
- capabilities you can sign for, for example:
+\bold{Building a Qt package with a Symbian developer certificate}
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 42
-
- \section2 Installing Qt packages to the device.
+If you have a Symbian-signed developer certificate, specify the
+capabilities you can sign for, for example:
- It is possible to install packages to a phone in Linux by putting
- the package on the phone memory card and then installing manually
- from the phone menu. However, this is tedious and will not work
- on phones without a memory card, so the method recommended by Qt is
- to use the App TRK tool.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 42
- \section3 Obtaining the App TRK package.
+\section2 Installing Qt Packages to the Device.
- Download the package from the following location.
+It is possible to install packages to a phone in Linux by putting
+the package on the phone memory card and then installing manually
+from the phone menu. However, this is tedious and will not work
+on phones without a memory card, so the method recommended by Qt is
+to use the App TRK tool.
- \list
- \o \l{http://tools.ext.nokia.com/trk/}{Application TRK}.
- Choose the correct installation package based on the
- S60 version of your device
- (\c{S60_<S60-version>_app_trk_<TRK-version>.sisx}).
- \endlist
+\section3 Obtaining the App TRK package.
- This package currently has to be installed by putting the
- package on the memory card and installing from the phone
- menu, or using a Windows PC for doing the install. However,
- the installation only has to be done once.
+Download the package from the following location.
- \section3 Configuring App TRK on the phone.
+\list
+\o \l{http://tools.ext.nokia.com/trk/}{Application TRK}.
+ Choose the correct installation package based on the
+ S60 version of your device
+ (\c{S60_<S60-version>_app_trk_<TRK-version>.sisx}).
+\endlist
- When App TRK is installed, connect the phone to the PC using
- the USB cable. Select "PCSuite" as connection type. Then run
- App TRK on the phone, and make sure that the connection type is
- USB. This can be changed under
- the \c Settings menu entry. If necessary, choose \c Connect
- from the menu.
+This package currently has to be installed by putting the
+package on the memory card and installing from the phone
+menu, or using a Windows PC for doing the install. However,
+the installation only has to be done once.
- \section3 Configuring the USB serial driver on the Linux system.
+\section3 Configuring App TRK on the Phone
- On Linux, phone should appear as the \c /dev/ttyUSB1 device,
- however if you are running an old kernel, you may need to
- force the USB module to be loaded correctly before the device
- will appear:
+When App TRK is installed, connect the phone to the PC using
+the USB cable. Select "PCSuite" as connection type. Then run
+App TRK on the phone, and make sure that the connection type is
+USB. This can be changed under the \c Settings menu entry.
+If necessary, choose \c Connect from the menu.
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 43
+\section3 Configuring the USB Serial Driver on the Linux System
- Note the identifier on the line where your Symbian device
- appears. Then execute the following, using the first and
- second part of the identifier in place of \c XXX,
- respectively.
+On Linux, phone should appear as the \c /dev/ttyUSB1 device,
+however if you are running an old kernel, you may need to
+force the USB module to be loaded correctly before the device
+will appear:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 44
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 43
- The \c rmmod step may fail if the module is not already
- loaded, but that is harmless.
+Note the identifier on the line where your Symbian device
+appears. Then execute the following, using the first and
+second part of the identifier in place of \c XXX,
+respectively.
- \section3 Building the \c runonphone tool.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 44
- Note that building the \c runonphone tool requires a separate
- installation of Qt for Linux. If there is a version of Qt
- installed by your distribution's package mechanism, that that
- should do fine. Some distributions separate the libraries from
- the development setup which includes qmake. Make sure you have
- both installed.
+The \c rmmod step may fail if the module is not already
+loaded, but that is harmless.
- First make sure that the \c qmake you use is taken from the
- Linux installation of Qt. The easiest way to make sure of this
- is to open a new shell and run the following command:
+\section3 Building the runonphone Tool.
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 45
+Note that building the \c runonphone tool requires a separate
+installation of Qt for Linux. If there is a version of Qt
+installed by your distribution's package mechanism, that that
+should do fine. Some distributions separate the libraries from
+the development setup which includes \c qmake. Make sure you
+have both installed.
- \c qmake will tell you where it is installed.
+You will also need the \l{libusb} libraries and header files
+installed. Usually, installing a development package such as
+\c{libusb-dev} will ensure that you have all the necessary
+dependencies installed.
- Copy the \c{%QTDIR%/tools/runonphone} folder to a place outside
- of the Qt tree. Then go to the folder in a shell and build it:
+First, make sure that the \c qmake you use is taken from the
+Linux installation of Qt. The easiest way to make sure of this
+is to open a new shell and run the following command:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 46
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 45
- Copy the resulting executable to a folder which is in your
- \c PATH environment variable.
+\c qmake will tell you where it is installed.
- \section3 Installing the built package onto the phone.
+Copy the \c{%QTDIR%/tools/runonphone} folder to a place outside
+of the Qt tree. Then go to the folder in a shell and build it:
- Return to the root of the Qt tree configured for Symbian. Then
- install the Qt libraries by running the following:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 46
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 47
+Copy the resulting executable to a folder which is in your
+\c PATH environment variable.
- \note If the installation fails, please make sure that there is
- no previously installed version of Qt on the phone.
+\section3 Installing the Built Package onto the Phone
- Qt requires some dependent packages to be installed on the device,
- they are shipped in the Symbian SDK and can be installed using the
- runonphone tool as well.
- The packages can be found in the EPOCROOT at the following locations;
+\note Before starting, please make sure that there is no previously
+installed version of Qt on the phone.
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 50
+Return to the root of the Qt tree configured for Symbian. Then
+install the Qt libraries by running the following:
-\section1 Running Qt demos
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 47
- We've included a subset of the Qt demos in this package for you
- to try out. An excellent starting point is the "fluidlauncher"
- demo.
+You may need to supply the path of the serial device file using
+the \c{-p} option:
- Install and run the demo by using the following commands:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc runonphone with device file path
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 48
+If the installation fails, please make sure that there is
+no previously installed version of Qt on the phone.
- The same command can be used for other applications:
+Qt requires some dependent packages to be installed on the device,
+they are shipped in the Symbian SDK and can be installed using the
+runonphone tool as well.
+The packages can be found in the EPOCROOT at the following locations;
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 49
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 50
- For more information about building and running Qt programs on the
- Symbian platform, see \l{The Symbian platform - Introduction to Qt}.
+It is also possible to install packages onto the device using the
+\c runonphone build rule that \c qmake automatically generates for
+each Qt project. Options can be supplied to the \c runonphone tool
+that is invoked begind the scenes:
- We hope you will enjoy using Qt.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc make runonphone with options
+
+If you are running \c runonphone or invoking the \c runonphone
+build rule often, it is possible to set the \c QT_RUN_ON_PHONE_OPTIONS
+environment variable with the options you normally use:
+
+\snippet doc/src/snippets/code/doc_src_installation.qdoc make runonphone with preset environment variable
+
+This makes installation of packages onto a device easier and less
+error-prone.
+
+
+\section1 Running Qt Demos
+
+We've included a subset of the Qt demos in this package for you
+to try out. An excellent starting point is the "fluidlauncher"
+demo.
+
+Install and run the demo by using the following commands:
+
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 48
+
+The same command can be used for other applications:
+
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 49
+
+For more information about building and running Qt programs on the
+Symbian platform, see \l{The Symbian platform - Introduction to Qt}.
+
+We hope you will enjoy using Qt.
*/
/*!
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index e42dfca..57fc18a 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -45,7 +45,7 @@
<li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="all-examples.html">Examples</a></li>
- <li><a href="qt4-7-intro.html">Whats new in Qt 4.7</a></li>
+ <li><a href="qt4-7-intro.html">What's new in Qt 4.7</a></li>
</ul>
</div>
</div>
diff --git a/doc/src/legal/opensourceedition.qdoc b/doc/src/legal/opensourceedition.qdoc
index e3a3e27..602e6d3 100644
--- a/doc/src/legal/opensourceedition.qdoc
+++ b/doc/src/legal/opensourceedition.qdoc
@@ -46,7 +46,7 @@
that are compatible with these free software licenses.
Additionally, the \l{Qt Examples}{examples} included with Qt are provided under
- the terms of the \l{BSD License}.
+ the terms of the \l{New and Modified BSD Licenses}{Modified BSD License}.
The support of open source with the Open Source Versions of Qt has enabled large
successful software projects like KDE to thrive, with thousands of developers
diff --git a/doc/src/legal/trademarks.qdoc b/doc/src/legal/trademarks.qdoc
index 42cb7a9..3bf783f 100644
--- a/doc/src/legal/trademarks.qdoc
+++ b/doc/src/legal/trademarks.qdoc
@@ -33,20 +33,20 @@
\brief Information about trademarks owned by Nokia and other organisations.
Nokia, the Nokia logo, Qt, and the Qt logo are trademarks of Nokia
-  Corporation and/or its subsidiaries in Finland and other countries.
+ Corporation and/or its subsidiaries in Finland and other countries.
\list
\o Intel, Intel Inside (logos), MMX and Pentium are \reg trademarks of
Intel Corporation in the United States, other countries, or both.
- \o Java and all Java-based trademarks are trademarks of Sun Microsystems,
- Inc. in the United States, other countries, or both.
+ \o Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ Other names may be trademarks of their respective owners.
\o Linux is a \reg trademark of Linus Torvalds in the United States, other
countries or both.
\o Mac, Mac OS and Macintosh are \reg trademarks of Apple Computer, Inc.,
registered in the U.S. and other countries.
- \o Microsoft, Windows, Windows NT, XP, Visual Studio and the Windows logo
- are \reg trademarks of Microsoft Corporation in the United States, other
- countries, or both.
+ \o Microsoft, Windows, Windows NT, XP, Windows Vista, Visual Studio and the
+ Windows logo are \reg trademarks of Microsoft Corporation in the United
+ States, other countries, or both.
\o Motif is a registered trademark of The Open Group in the United States,
other countries, or both.
\o OpenGL is a \reg trademark of Silicon Graphics, Inc. in the United States
diff --git a/doc/src/platforms/compiler-notes.qdoc b/doc/src/platforms/compiler-notes.qdoc
index 316b635..fb534df 100644
--- a/doc/src/platforms/compiler-notes.qdoc
+++ b/doc/src/platforms/compiler-notes.qdoc
@@ -31,270 +31,14 @@
\title Compiler Notes
\brief Information about the C++ compilers and tools used to build Qt.
- This page contains information about the C++ compilers and tools used
- to build Qt on various platforms.
+ This page used to contain information about the C++ compilers and tools
+ used to build Qt on various platforms. This information is now maintained
+ in the \l{Platform and Compiler Notes} for each platform.
- \tableofcontents
-
- Please refer to the \l{Platform Notes} for information on the platforms
- Qt is currently known to run on, and see the \l{Supported Platforms}
- page for information about the status of each platform.
+ Please refer to the \l{Supported Platforms} page for information about the
+ status of each platform.
If you have anything to add to this list or any of the platform or
compiler-specific pages, please submit it via the \l{Bug Report Form}
or through the \l{Public Qt Repository}.
-
- \section1 Supported Features
-
- Not all compilers used to build Qt are able to compile all modules. The following table
- shows the compiler support for five modules that are not uniformly available for all
- platforms and compilers.
-
- \table
- \header \o Compiler \o{5,1} Features
- \header \o \o Concurrent \o XmlPatterns \o WebKit(*) \o CLucene \o Phonon
- \row \o g++ 3.3 \o \o \bold{X} \o \o \bold{X} \o \bold{X}
- \row \o g++ 3.4 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
- \row \o SunCC 5.5 \o \o \o \o \bold{X} \o \bold{X}
- \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X}
- \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
- \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X}
- \row \o Intel CC 10 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
- \row \o MSVC 2003 \o \bold{X} \o \bold{X} \o \o \bold{X} \o \bold{X}
- \row \o MSVC 2005 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
- \endtable
-
- * WebKit is only supported as a dynamically built library. Static linkage is not supported.
-
- \target GCC
- \section1 GCC
-
- \section2 GCC on Windows (MinGW)
-
- We have tested Qt with this compiler on Windows XP.
- The minimal version of MinGW supported is:
-
- \list
- \o GCC 3.4.2
- \o MinGW runtime 3.7
- \o win32api 3.2
- \o binutils 2.15.91
- \o mingw32-make 3.80.0-3
- \endlist
-
- \note For users of the MinGW binary package: This package is now
- based on MinGW 4.4. The installer no longer offers to download
- MinGW for you, but rather offers to use a version of MinGW that
- you already have installed on your machine. You just tell the
- installer which directory MinGW is installed in. If you don't
- already have MinGW 4.4 installed, you can download a .zip archive
- from our \l{ftp://ftp.trolltech.com/misc/MinGW-gcc440_1.zip} {ftp
- site}. This archive provides fixes to MinGW and support for
- missing API, See the _patches directory in the archive for
- details.
-
- \note A MinGW installation is only needed to build against the
- binary pacakge, not to run the pre-compiled binaries that are in
- the package.
-
- \section2 GCC 4.0.0
-
- The released package of the compiler has some bugs that lead to
- miscompilations. We recommend using GCC 4.0.1 or later, or to use
- a recent CVS snapshot of the GCC 4.0 branch. The version of GCC
- 4.0.0 that is shipped with Mac OS X 10.4 "Tiger" is known to work
- with Qt for Mac OS X.
-
- \section2 HP-UX
-
- The hpux-g++ platform is tested with GCC 3.4.4.
-
- \section2 Solaris
-
- Please use GCC 3.4.2 or later.
- Please not that WebKit is not supported for Solaris, regardless of which compiler is used.
-
- \section2 Mac OS X
-
- Please use the latest GCC 3.3 from Apple or a later version of GCC 3.
- The gcc 3.3 that is provided with Xcode 1.5 is known to generate bad code.
- Use the November 2004 GCC 3.3 updater \l{http://connect.apple.com}{available from Apple}.
-
- \section2 GCC 3.4.6 (Debian 3.4.6-5) on AMD64 (x86_64)
-
- This compiler is known to miscompile some parts of Qt when doing a
- release build. There are several workarounds:
-
- \list 1
- \o Use a debug build instead.
- \o For each miscompilation encountered, recompile the file, removing the -O2 option.
- \o Add -fno-gcse to the QMAKE_CXXFLAGS_RELEASE.
- \endlist
-
- \section1 HP ANSI C++ (aCC)
-
- The hpux-acc-32 and hpux-acc-64 platforms are tested with aCC A.03.57. The
- hpuxi-acc-32 and hpuxi-acc-64 platforms are tested with aCC A.06.10.
-
- \section1 Intel C++ Compiler
-
- Qt supports the Intel C++ compiler on both Windows and Linux.
- However, there are a few issues on Linux (see the following
- section).
-
- \section2 Intel C++ Compiler for Linux
-
- Nokia currently tests the following compilers:
-
- \list
-
- \o Intel(R) C++ Compiler for applications running on IA-32,
- Version 10.1 Build 20080602 Package ID: l_cc_p_10.1.017
-
- \o Intel(R) C++ Compiler for applications running on Intel(R) 64,
- Version 10.1 Build 20080602 Package ID: l_cc_p_10.1.017
-
- \endlist
-
- We do not currently test the IA-64 (Itanium) compiler.
-
- \section2 Known Issues with Intel C++ Compiler for Linux
-
- \list
-
- \o Precompiled header support does not work in version 10.0.025
- and older. For these compilers, you should configure Qt with
- -no-pch. Precompiled header support works properly in version
- 10.0.026 and later.
- \o Version 10.0.026 for Intel 64 is known to miscompile qmake when
- building in release mode. For now, configure Qt with
- -debug. Version 10.1.008 and later can compile qmake in release
- mode.
- \o Versions 10.1.008 to 10.1.015 for both IA-32 and Intel 64 are
- known crash with "(0): internal error: 0_47021" when compiling
- QtXmlPatterns, QtWebKit, and Designer in release mode. Version
- 10.1.017 compiles these modules correctly in release mode.
- \endlist
-
- \section2 Intel C++ Compiler (Windows, Altix)
-
- Qt 4 has been tested successfully with:
-
- \list
- \o Windows - Intel(R) C++ Compiler for 32-bit applications,
- Version 9.1.040.
- \o Altix - Intel(R) C++ Itanium(R) Compiler for Itanium(R)-based
- applications Version 8.1 Build 20050406 Package ID: l_cc_pc_8.1.030
- \endlist
-
- We currently only test the Intel compiler on 32-bit Windows versions.
-
- \section1 MIPSpro (IRIX)
-
- \bold{IRIX is an unsupported platform. See the \l{Supported Platforms} page
- and Qt's Software's online \l{Platform Support Policy} page for details.}
-
- Qt 4.4.x requires MIPSpro version 7.4.2m.
-
- Note that MIPSpro version 7.4.4m is currently not supported, since it has
- introduced a number of problems that have not yet been resolved.
- We recommend using 7.4.2m for Qt development. However, please note the
- unsupported status of this platform.
-
- \target Sun Studio
- \section1 Forte Developer / Sun Studio (Solaris)
-
- \section2 Sun Studio
-
- Qt is tested using Sun Studio 12 (Sun CC 5.9). Go to
- \l{Sun Studio Patches} page on Sun's Web site to download
- the latest patches for your Sun compiler.
-
- Please note that Qt 4.6 is stricter in its STL requirements and
- that the default STL implementation used by Sun CC does not pass
- those requirements. This does not affect binary compatibility and
- you can continue to use STL in your own code, but Qt's
- STL-compatibility functions will be disabled.
-
- Sun CC ships with a secondary STL implementation (called stlport4)
- which is standards-compliant and can be used by Qt. You can enable
- it by passing the -library=stlport4 option to the compiler. Note
- that this does not affect Qt's binary compatibility, but it may
- affect that of other libraries and programs that use STL.
-
- \section2 Sun WorkShop 5.0
-
- Sun WorkShop 5.0 is not supported with Qt 4.
-
- \section1 Visual Studio (Windows)
-
- We do most of our Windows development on Windows XP, using Microsoft
- Visual Studio .NET 2005 and Visual Studio 2008 (both the 32- and 64-bit
- versions).
-
- Qt works with the Standard Edition, the Professional Edition and Team
- System Edition of Visual Studio 2005.
-
- In order to use Qt with the Visual Studio 2005/2008 Express Edition you need
- to download and install the platform SDK. Due to limitations in the
- Express Edition it is not possible for us to install the Qt Visual
- Studio Integration. You will need to use our command line tools to
- build Qt applications with this edition.
-
- The Visual C++ Linker doesn't understand filenames with spaces (as in
- \c{C:\Program files\Qt\}) so you will have to move it to another place,
- or explicitly set the path yourself; for example:
-
- \snippet doc/src/snippets/code/doc_src_compiler-notes.qdoc 0
-
- If you are experiencing strange problems with using special flags that
- modify the alignment of structure and union members (such as \c{/Zp2})
- then you will need to recompile Qt with the flags set for the
- application as well.
-
- If you're using Visual Studio .NET (2002) Standard Edition, you should be
- using the Qt binary package provided, and not the source package.
- As the Standard Edition does not optimize compiled code, your compiled
- version of Qt would perform suboptimally with respect to speed.
-
- With Visual Studio 2005 Service Pack 1 a bug was introduced which
- causes Qt not to compile, this has been fixed with a hotfix available
- from Microsoft. See this
- \l{http://qt.nokia.com/developer/faqs/faq.2006-12-18.3281869860}{Knowledge Base entry}
- for more information.
-
- There currently is a problem when compiling Qt with Visual Studio 2010 for 64-bit.
- Its optimizer causes trouble and generates code that crashes for the release builds.
- To avoid the crashes, You need to apply the hotfix in the following article
- http://support.microsoft.com/kb/2280741.
-
- \section1 IBM xlC (AIX)
-
- The makeC++SharedLib utility must be in your PATH and be up to date to
- build shared libraries. From IBM's
- \l{http://www.redbooks.ibm.com/abstracts/sg245674.html}{C and C++ Application Development on AIX}
- Redbook:
-
- \list
- \o "The second step is to use the makeC++SharedLib command to create the
- shared object. The command has many optional arguments, but in its
- simplest form, can be used as follows:"
- \snippet doc/src/snippets/code/doc_src_compiler-notes.qdoc 1
- \o "The full path name to the command is not required; however, to avoid
- this, you will have to add the directory in which it is located to
- your PATH environment variable. The command is located in the
- /usr/vacpp/bin directory with the VisualAge C++ Professional for AIX,
- Version 5 compiler."
- \endlist
-
- \section2 VisualAge C++ for AIX, Version 6.0
-
- Make sure you have the
- \l{http://www-1.ibm.com/support/search.wss?rs=32&amp;tc=SSEP5D&amp;dc=D400}{latest upgrades}
- installed.
-
- \section2 GCCE (Symbian)
-
- GCCE cannot be used to compile Qt libaries for the Symbian platform, but GCCE is supported
- when compiling Qt applications for Symbian platform.
*/
diff --git a/doc/src/platforms/emb-deployment.qdoc b/doc/src/platforms/emb-deployment.qdoc
index 6b22ba4..9a36097 100644
--- a/doc/src/platforms/emb-deployment.qdoc
+++ b/doc/src/platforms/emb-deployment.qdoc
@@ -58,7 +58,7 @@
directory relative to the path set using the \c -prefix parameter
when running the \c configure script; ensure that this is a
sensible path in the target device environment. See the
- \l {Installing Qt on Embedded Linux#Step 3: Building the
+ \l {Installing Qt for Embedded Linux#Step 3: Building the
Library}{installation} documentation for more details.
\section1 Environment Variables
diff --git a/doc/src/platforms/emb-directfb-EmbLinux.qdoc b/doc/src/platforms/emb-directfb-EmbLinux.qdoc
index dbe6c14..bcc06dc 100644
--- a/doc/src/platforms/emb-directfb-EmbLinux.qdoc
+++ b/doc/src/platforms/emb-directfb-EmbLinux.qdoc
@@ -39,11 +39,11 @@ and generally chip vendors start out with the official version and
implement their own plugins to optimize the operations their hardware
supports.
-We recommend using Qt 4.6 with DirectFB. DirectFB support was introduced
-already into Qt for Embedded Linux as a labs project for Qt 4.3 and folded
+We recommend using Qt 4.6 or later with DirectFB. Support for DirectFB was
+introduced into Qt for Embedded Linux as a labs project for Qt 4.3 and folded
into Qt as a screen driver for Qt 4.4, but not supported fully. In Qt 4.5,
major changes were made to make it work with the optimized raster paint
-engine. And in Qt 4.6 these have been further improved.
+engine. These changes were further improved in Qt 4.6.
\tableofcontents
diff --git a/doc/src/platforms/emb-hardwareacceleration.qdocinc b/doc/src/platforms/emb-hardwareacceleration.qdocinc
index fb00e09..83ecef5 100644
--- a/doc/src/platforms/emb-hardwareacceleration.qdocinc
+++ b/doc/src/platforms/emb-hardwareacceleration.qdocinc
@@ -1,140 +1,140 @@
- \section1 Hardware Acceleration
-
- When designing applications for embedded devices there is often a
- compromise between graphics effects and performance. On most
- devices, you cannot have both simply because the hardware needed
- for such operations just is not there. With a growing number of
- devices that use hardware dedicated to graphics operations there is
- less need to compromise.
-
- In addition to enabling dynamic graphics effects, there are two
- other benefits to using graphics acceleration. One is that graphics
- acceleration hardware is more power efficient than using the CPU.
- The reason for this is that the CPU might require a clock speed
- that is up to 20 times higher than the GPU, achieving the same
- results. E.g. a typical hardware accelerated mobile graphics unit
- can rasterize one or two bilinear texture fetches in one cycle,
- while a software implementation takes easily more than 20 cycles.
- Typical \e {System-on-a-chip} (SoC) graphics hardware generally have
- a much lower clock speed and memory bandwidth, and different level
- of acceleration than desktop GPUs. One example is that many GPUs
- leave out transformation and lighting from the graphics pipeline
- and only implements rasterization.
-
- Another reason to use a GPU is to offload the main CPU, either for
- power saving or to perform other operations in parallel. Often
- drawing speed with a GPU is not that much faster than a CPU but
- the clear benefit of using the GPU is to free up the CPU to perform
- other tasks which can be used to create a more responsive use
- experience.
-
- The key to writing good applications for devices is therefore to
- limit the wow factor down to what the target hardware can handle,
- and to take advantage of any graphics dedicated hardware. Qt
- provides several ways to both render advanced effects on the screen
- and speed up your application using hardware accelerated graphics.
-
- \tableofcontents
-
- \section2 Qt for Embedded Graphics pipeline
-
- Qt uses QPainter for all graphics operations. By using the same API
- regardless of platform, the code can be reused on different devices.
- QPainter use different paint engines implemented in the QPaintEngine API to
- do the actual painting.
-
- The QPaintEngine API provides paint engines for each window system and
- painting framework supported by Qt. In regards to Qt for Embedded, this
- also includes implementations for OpenGL ES versions 1.1 and 2.0, as well
- as OpenVG and DirectFB(Embedded Linux only).
-
- By using one of these paint engines, you will be able to improve the
- graphics performance of your Qt application. However, if the graphics
- operations used are not supported, this might as well be a trap, slowing
- down your application significantly. This all depends on what kind of
- graphics operations that are supported by the target devices hardware
- configuration.
-
- \image platformHWAcc.png
-
- The paint engine will direct all graphics operations supported by the
- devices hardware to the GPU, and from there they are sent to the
- framebuffer. Unsupported graphics operations falls back to the
- QRasterPaintEngine and are handled by the CPU before sent to the
- framebuffer. In the end, the operating system sends the paint updates off
- to the screen/display. The fallback operation is quite expensive in regards
- to memory consumption, and should be avoided.
-
- \section2 Hardware configuration requirements
-
- Before implementing any application using hardware acceleration, it is wise
- to get an overview of what kind of hardware accelerated graphics operations
- that are available for the target device.
-
- \note On devices with no hardware acceleration, Qt will use
- QRasterPaintEngine, which handles the acceleration using software. On
- devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows
- CE), Qt will use the
- respective paint engines to accelerate painting. However, hardware
- configurations that only support a limited set of hardware acceleration
- features, might slow the application graphics down rather than speeding it
- up when using unsupported operations that must fall back to the raster
- engine.
-
- \section3 Different architectures
-
- Based on the architecture used in a device we can make a recommendation on
- which hardware acceleration techniques to use. There are mainly two
- different architectures on embedded devices. These are devices with a
- Unified Memory Architecture (UMA), and devices with dedicated graphics
- memory. Generally, high-end devices will have dedicated graphics memory.
- Low-end devices will just use system memory, sometimes reserving a memory
- region and sometimes not.
-
- In addition to this, we can categorize the devices into five types based on
- the different graphics operations supported by their hardware.
-
- \list 1
- \o No support for graphics acceleration.
- \o Support for blitter and alpha blending.
- \o Support for path based 2D vector graphics.
- \o Support for fixed function 3D graphics.
- \o Support for programmable 3D graphics.
- \endlist
-
- Based on these characteristics the table below recommends which paint
- engines to use with the different types of hardware configurations.
-
- \section3 Recommended use of hardware acceleration based on hardware
-
- \table
- \header
- \o Type
- \o UMA
- \o Non-UMA
- \row
- \o \bold {None}
- \o Qt Raster Engine
- \o Qt Raster Engine
- \row
- \o \bold {Blitter}
- \o DirectFB
- \o DirectFB
- \row
- \o \bold {2D Vector}
- \o OpenVG
- \o OpenVG
- \row
- \o \bold {Fixed 3D}
- \o OpenGL (ES) 1.x
- \o OpenGL (ES) 1.x
- \row
- \o \bold {Programmable 3D}
- \o OpenGL (ES) 2.x
- \o OpenGL (ES) 2.x
- \endtable
-
- \note Since the DirectFB API is quite primitive, the raster paint engine
- handles most of the operations.
-
- \note Blitter and Alpha blending is currently not supported on Windows CE.
+\section1 Hardware Acceleration
+
+When designing applications for embedded devices there is often a
+compromise between graphics effects and performance. On most
+devices, you cannot have both simply because the hardware needed
+for such operations just is not there. With a growing number of
+devices that use hardware dedicated to graphics operations there is
+less need to compromise.
+
+In addition to enabling dynamic graphics effects, there are two
+other benefits to using graphics acceleration. One is that graphics
+acceleration hardware is more power efficient than using the CPU.
+The reason for this is that the CPU might require a clock speed
+that is up to 20 times higher than the GPU, achieving the same
+results. E.g. a typical hardware accelerated mobile graphics unit
+can rasterize one or two bilinear texture fetches in one cycle,
+while a software implementation takes easily more than 20 cycles.
+Typical \e {System-on-a-chip} (SoC) graphics hardware generally have
+a much lower clock speed and memory bandwidth, and different level
+of acceleration than desktop GPUs. One example is that many GPUs
+leave out transformation and lighting from the graphics pipeline
+and only implements rasterization.
+
+Another reason to use a GPU is to offload the main CPU, either for
+power saving or to perform other operations in parallel. Often
+drawing speed with a GPU is not that much faster than a CPU but
+the clear benefit of using the GPU is to free up the CPU to perform
+other tasks which can be used to create a more responsive use
+experience.
+
+The key to writing good applications for devices is therefore to
+limit the wow factor down to what the target hardware can handle,
+and to take advantage of any graphics dedicated hardware. Qt
+provides several ways to both render advanced effects on the screen
+and speed up your application using hardware accelerated graphics.
+
+\tableofcontents
+
+\section2 Qt for Embedded Graphics pipeline
+
+Qt uses QPainter for all graphics operations. By using the same API
+regardless of platform, the code can be reused on different devices.
+QPainter use different paint engines implemented in the QPaintEngine API to
+do the actual painting.
+
+The QPaintEngine API provides paint engines for each window system and
+painting framework supported by Qt. In regards to Qt for Embedded, this
+also includes implementations for OpenGL ES versions 1.1 and 2.0, as well
+as OpenVG and DirectFB(Embedded Linux only).
+
+By using one of these paint engines, you will be able to improve the
+graphics performance of your Qt application. However, if the graphics
+operations used are not supported, this might as well be a trap, slowing
+down your application significantly. This all depends on what kind of
+graphics operations that are supported by the target devices hardware
+configuration.
+
+\image platformHWAcc.png
+
+The paint engine will direct all graphics operations supported by the
+devices hardware to the GPU, and from there they are sent to the
+framebuffer. Unsupported graphics operations falls back to the
+QRasterPaintEngine and are handled by the CPU before sent to the
+framebuffer. In the end, the operating system sends the paint updates off
+to the screen/display. The fallback operation is quite expensive in regards
+to memory consumption, and should be avoided.
+
+\section2 Hardware configuration requirements
+
+Before implementing any application using hardware acceleration, it is wise
+to get an overview of what kind of hardware accelerated graphics operations
+that are available for the target device.
+
+\note On devices with no hardware acceleration, Qt will use
+QRasterPaintEngine, which handles the acceleration using software. On
+devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows
+CE), Qt will use the
+respective paint engines to accelerate painting. However, hardware
+configurations that only support a limited set of hardware acceleration
+features, might slow the application graphics down rather than speeding it
+up when using unsupported operations that must fall back to the raster
+engine.
+
+\section3 Different architectures
+
+Based on the architecture used in a device we can make a recommendation on
+which hardware acceleration techniques to use. There are mainly two
+different architectures on embedded devices. These are devices with a
+Unified Memory Architecture (UMA), and devices with dedicated graphics
+memory. Generally, high-end devices will have dedicated graphics memory.
+Low-end devices will just use system memory, sometimes reserving a memory
+region and sometimes not.
+
+In addition to this, we can categorize the devices into five types based on
+the different graphics operations supported by their hardware.
+
+\list 1
+ \o No support for graphics acceleration.
+ \o Support for blitter and alpha blending.
+ \o Support for path based 2D vector graphics.
+ \o Support for fixed function 3D graphics.
+ \o Support for programmable 3D graphics.
+\endlist
+
+Based on these characteristics the table below recommends which paint
+engines to use with the different types of hardware configurations.
+
+\section3 Recommended use of hardware acceleration based on hardware
+
+\table
+ \header
+ \o Type
+ \o UMA
+ \o Non-UMA
+ \row
+ \o \bold {None}
+ \o Qt Raster Engine
+ \o Qt Raster Engine
+ \row
+ \o \bold {Blitter}
+ \o DirectFB
+ \o DirectFB
+ \row
+ \o \bold {2D Vector}
+ \o OpenVG
+ \o OpenVG
+ \row
+ \o \bold {Fixed 3D}
+ \o OpenGL (ES) 1.x
+ \o OpenGL (ES) 1.x
+ \row
+ \o \bold {Programmable 3D}
+ \o OpenGL (ES) 2.x
+ \o OpenGL (ES) 2.x
+\endtable
+
+\note Since the DirectFB API is quite primitive, the raster paint engine
+handles most of the operations.
+
+\note Blitter and Alpha blending is currently not supported on Windows CE.
diff --git a/doc/src/platforms/emb-install.qdoc b/doc/src/platforms/emb-install.qdoc
index 11392b4..b5b408a 100644
--- a/doc/src/platforms/emb-install.qdoc
+++ b/doc/src/platforms/emb-install.qdoc
@@ -28,10 +28,10 @@
/*!
\page qt-embedded-install.html
- \title Installing Qt on Embedded Linux
+ \title Installing Qt for Embedded Linux
\ingroup qt-embedded-linux
\ingroup installation
- \brief How to install Qt on Embedded Linux.
+ \brief How to install Qt for Embedded Linux.
This document describes how to install \l{Qt for Embedded Linux} in your
development environment:
@@ -152,7 +152,7 @@
\endlist
Note that the virtual framebuffer requires a Qt for X11
- installation. See \l {Installing Qt on X11 Platforms} for details.
+ installation. See \l {Installing Qt for X11 Platforms} for details.
The Linux framebuffer, on the other hand, is enabled by default on
all modern Linux distributions. For information on older versions,
diff --git a/doc/src/platforms/emb-pointer.qdoc b/doc/src/platforms/emb-pointer.qdoc
index 22935b4..506e9e0 100644
--- a/doc/src/platforms/emb-pointer.qdoc
+++ b/doc/src/platforms/emb-pointer.qdoc
@@ -105,7 +105,7 @@
{touch panels} in which case the driver must be specified
explicitly to determine which device to use.
- To manually specify which driver to use, set the QWS_MOUSE_PROTO
+ To manually specify which driver to use, set the \c QWS_MOUSE_PROTO
environment variable. For example (if the current shell is bash,
ksh, zsh or sh):
@@ -156,7 +156,7 @@
\snippet doc/src/snippets/code/doc_src_emb-pointer.qdoc 8
To make \l{Qt for Embedded Linux} explicitly choose the tslib mouse
- handler, set the QWS_MOUSE_PROTO environment variable as explained
+ handler, set the \c QWS_MOUSE_PROTO environment variable as explained
above.
\endtable
@@ -186,8 +186,11 @@
device file. Some drivers also require write access to the device file.
For instance, if you have specified the mouse driver with
\snippet doc/src/snippets/code/doc_src_emb-pointer.qdoc 11
- then examine the permissions of the device file by entering the following
- command in a console:
+ then examine the permissions of the device file by entering the
+ following command in a console:
+ \snippet doc/src/snippets/code/doc_src_emb-pointer.qdoc show permissions
+ Change the permissions of the device file, if necessary, in the following
+ way:
\snippet doc/src/snippets/code/doc_src_emb-pointer.qdoc 12
If the device file is actually a symbolic link to another file, you must
diff --git a/doc/src/platforms/emb-qvfb.qdoc b/doc/src/platforms/emb-qvfb.qdoc
index 78bdd73..9993b3e 100644
--- a/doc/src/platforms/emb-qvfb.qdoc
+++ b/doc/src/platforms/emb-qvfb.qdoc
@@ -40,8 +40,8 @@
QVFb is an X11 application supplied with Qt for X11 that provides
a virtual framebuffer for Qt for Embedded Linux to use. To use it,
- you need to \l{Installing Qt on X11 Platforms}{configure and
- install Qt on X11 platforms} appropriately. Further requirements
+ you need to \l{Installing Qt for X11 Platforms}{configure and
+ install Qt for X11 platforms} appropriately. Further requirements
can be found in the \l{Qt for Embedded Linux Requirements}
document.
diff --git a/doc/src/platforms/emb-running.qdoc b/doc/src/platforms/emb-running.qdoc
index 269f4f3..12222a6 100644
--- a/doc/src/platforms/emb-running.qdoc
+++ b/doc/src/platforms/emb-running.qdoc
@@ -63,7 +63,7 @@
\row
\o
Provided that the environment variables are adjusted properly
- during the \l {Installing Qt on Embedded Linux}{installation process}, you
+ during the \l {Installing Qt for Embedded Linux}{installation process}, you
should see the \l {Text Edit} demo appear.
It might be that the hardware drivers must be specified explicitly
diff --git a/doc/src/platforms/mac-differences.qdoc b/doc/src/platforms/mac-differences.qdoc
index dfcecca..8436043 100644
--- a/doc/src/platforms/mac-differences.qdoc
+++ b/doc/src/platforms/mac-differences.qdoc
@@ -32,7 +32,7 @@
\ingroup platform-specific
This file outlines known issues and possible workarounds when
- using Qt on Mac OS X. Contact Qt's technical support team if you find
+ using Qt for Mac OS X. Contact Qt's technical support team if you find
additional issues which are not covered here. (See also the
document \l{qtmac-as-native.html} {Qt is Mac OS X Native}.)
diff --git a/doc/src/platforms/platform-notes-rtos.qdoc b/doc/src/platforms/platform-notes-rtos.qdoc
index 4a34ece..8c30701 100644
--- a/doc/src/platforms/platform-notes-rtos.qdoc
+++ b/doc/src/platforms/platform-notes-rtos.qdoc
@@ -27,8 +27,8 @@
/*!
\page platform-notes-vxworks.html
- \title Platform Notes - VxWorks
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - VxWorks
+ \contentspage Platform and Compiler Notes
\target VxWorks
\note VxWorks is a community supported platform. See the
@@ -143,8 +143,8 @@
/*!
\page platform-notes-qnx.html
- \title Platform Notes - QNX
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - QNX
+ \contentspage Platform and Compiler Notes
\target QNX
\note QNX is a community supported platform. See the
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc
index dff1b5b..177d3f6 100644
--- a/doc/src/platforms/platform-notes.qdoc
+++ b/doc/src/platforms/platform-notes.qdoc
@@ -39,35 +39,91 @@
/*!
\page platform-notes.html
\ingroup platform-specific
- \title Platform Notes
+ \title Platform and Compiler Notes
\brief Information about the platforms on which Qt can be used.
This page contains information about the platforms Qt is currently known
to run on, with links to platform-specific notes, including any known bugs
or incompatibilities.
+ Information about the combinations of platforms and compilers
+ supported by Qt can be found on the \l{Supported Platforms} page.
+
\list
- \o \l{Platform Notes - X11}
- \tableofcontents{1 Platform Notes - X11}
- \o \l{Platform Notes - Windows}
- \tableofcontents{1 Platform Notes - Windows}
- \o \l{Platform Notes - Mac OS X}
- \tableofcontents{1 Platform Notes - Mac OS X}
- \o \l{Platform Notes - Symbian}
- \tableofcontents{1 Platform Notes - Symbian}
- \o \l{Platform Notes - Embedded Linux}
- \tableofcontents{1 Platform Notes - Embedded Linux}
- \o \l{Platform Notes - Windows CE}
- \tableofcontents{1 Platform Notes - Windows CE}
- \o \l{Platform Notes - QNX}
- \tableofcontents{1 Platform Notes - QNX}
- \o \l{Platform Notes - VxWorks}
- \tableofcontents{1 Platform Notes - VxWorks}
+ \o \l{Platform and Compiler Notes - X11}
+ \tableofcontents{1 Platform and Compiler Notes - X11}
+ \o \l{Platform and Compiler Notes - Windows}
+ \tableofcontents{1 Platform and Compiler Notes - Windows}
+ \o \l{Platform and Compiler Notes - Mac OS X}
+ \tableofcontents{1 Platform and Compiler Notes - Mac OS X}
+ \o \l{Platform and Compiler Notes - Symbian}
+ \tableofcontents{1 Platform and Compiler Notes - Symbian}
+ \o \l{Platform and Compiler Notes - Embedded Linux}
+ \tableofcontents{1 Platform and Compiler Notes - Embedded Linux}
+ \o \l{Platform and Compiler Notes - Windows CE}
+ \tableofcontents{1 Platform and Compiler Notes - Windows CE}
+ \o \l{Platform and Compiler Notes - QNX}
+ \tableofcontents{1 Platform and Compiler Notes - QNX}
+ \o \l{Platform and Compiler Notes - VxWorks}
+ \tableofcontents{1 Platform and Compiler Notes - VxWorks}
\endlist
- See also the \l{Compiler Notes} for information about compiler-specific
- build issues. Information about the combinations of platforms and compilers
- supported by Qt can be found on the \l{Supported Platforms} page.
+ \section1 General Compiler Notes
+
+ \section2 Supported Features
+
+ Not all compilers used to build Qt are able to compile all modules. The following table
+ shows the compiler support for five modules that are not uniformly available for all
+ platforms and compilers.
+
+ \table
+ \header \o Compiler \o{5,1} Features
+ \header \o \o Concurrent \o XmlPatterns \o WebKit(*) \o CLucene \o Phonon
+ \row \o g++ 3.3 \o \o \bold{X} \o \o \bold{X} \o \bold{X}
+ \row \o g++ 3.4 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
+ \row
+ \row \o SunCC 5.5 \o \o \o \o \bold{X} \o \bold{X}
+ \row
+ \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X}
+ \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
+ \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X}
+ \row \o Intel CC 10 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
+ \row
+ \row \o MSVC 2003 \o \bold{X} \o \bold{X} \o \o \bold{X} \o \bold{X}
+ \row \o MSVC 2005 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X}
+ \endtable
+
+ * WebKit is only supported as a dynamically built library. Static linkage is not supported.
+
+ \section2 GCC 3.4.6 (Debian 3.4.6-5) on AMD64 (x86_64)
+
+ This compiler is known to miscompile some parts of Qt when doing a
+ release build. There are several workarounds:
+
+ \list 1
+ \o Use a debug build instead.
+ \o For each miscompilation encountered, recompile the file, removing the \c{-O2} option.
+ \o Add \c{-fno-gcse} to the
+ \l{qmake Variable Reference#QMAKE_CXXFLAGS_RELEASE}{QMAKE_CXXFLAGS_RELEASE} qmake
+ variable.
+ \endlist
+
+ \section2 GCC 4.0.0
+
+ The released package of the compiler has some bugs that lead to
+ miscompilations. We recommend using GCC 4.0.1 or later, or to use
+ a recent CVS snapshot of the GCC 4.0 branch. The version of GCC
+ 4.0.0 that is shipped with Mac OS X 10.4 "Tiger" is known to work
+ with Qt for Mac OS X.
+
+ \section2 Intel C++ Compiler
+
+ Qt supports the Intel C++ compiler on both Windows and Linux.
+ However, there are a few issues on Linux; see
+ \l{Platform and Compiler Notes - X11#Intel C++ Compiler for Linux}{Intel C++ Compiler for Linux}
+ for details.
+
+ \section1 Feedback and Corrections
If you have anything to add to this list or any of the platform or
compiler-specific pages, please submit it via the \l{Bug Report Form}
@@ -76,8 +132,8 @@
/*!
\page platform-notes-x11.html
- \title Platform Notes - X11
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - X11
+ \contentspage Platform and Compiler Notes
This page contains information about the X11 platforms Qt is currently
known to run on, with links to platform-specific notes. More information
@@ -89,8 +145,7 @@
\target AIX
\section1 AIX - 5.2
- Qt has been tested on AIX 5.2, using the
- \l{Compiler Notes#IBM xlC (AIX)}{xlC} compiler.
+ Qt has been tested on AIX 5.2, using the xlC compiler.
\table
\header \o Compiler \o Notes
@@ -113,13 +168,38 @@
either \c{-no-stl} or \c{-no-largefile}.
\endtable
+ \section2 IBM xlC
+
+ The makeC++SharedLib utility must be in your PATH and be up to date to
+ build shared libraries. From IBM's
+ \l{http://www.redbooks.ibm.com/abstracts/sg245674.html}{C and C++ Application Development on AIX}
+ Redbook:
+
+ \list
+ \o "The second step is to use the makeC++SharedLib command to create the
+ shared object. The command has many optional arguments, but in its
+ simplest form, can be used as follows:"
+ \snippet doc/src/snippets/code/doc_src_compiler-notes.qdoc 1
+ \o "The full path name to the command is not required; however, to avoid
+ this, you will have to add the directory in which it is located to
+ your PATH environment variable. The command is located in the
+ /usr/vacpp/bin directory with the VisualAge C++ Professional for AIX,
+ Version 5 compiler."
+ \endlist
+
+ \section2 VisualAge C++ for AIX, Version 6.0
+
+ Make sure you have the
+ \l{http://www-1.ibm.com/support/search.wss?rs=32&amp;tc=SSEP5D&amp;dc=D400}{latest upgrades}
+ installed.
+
\target FreeBSD
\section1 FreeBSD - 6.0-RELEASE
\note FreeBSD is a community supported platform. See the
\l{Supported Platforms} page for more information.
- The system compiler on FreeBSD 4.x is gcc 2.95.4, which is not
+ The system compiler on FreeBSD 4.x is GCC 2.95.4, which is not
officially supported by Qt 4. We develop using and recommend
ports/lang/gcc34. You will need to run configure with the
\c{-platform freebsd-g++34} arguments. Optionally, you may use
@@ -132,7 +212,6 @@
Note that we do not actively test FreeBSD 4.x and 5.x. Our developers
migrated to 6.x after the Qt 4 launch. FreeBSD-CURRENT is not supported.
- \target HP-UX
\section1 HP-UX
Qt supports HP-UX on both PA-RISC and the Itanium (IA64) architectures.
@@ -140,17 +219,26 @@
\section2 PA-RISC - B.11.11 or later
You can configure Qt for aCC in 32 and 64 bit mode (hpux-acc-64 or
- hpux-acc-32), or gcc in 32 bit mode (hpux-g++). The default platform is
+ hpux-acc-32), or GCC in 32 bit mode (hpux-g++). The default platform is
hpux-acc-32. The minimum required version for aCC (HP ANSI C++) on PA-RISC
- is A.03.57. The supported gcc compiler is gcc 3.4.3.
+ is A.03.57. The supported GCC compiler is GCC 3.4.3.
\section2 Itanium - B.11.23 or later
You can configure Qt for aCC in 32 and 64 bit mode (hpuxi-acc-64 or
- hpuxi-acc-32). gcc is currently unsupported. The default platform is
+ hpuxi-acc-32). GCC is currently unsupported. The default platform is
hpuxi-acc-64. The minimum required version for aCC (HP ANSI C++) on
Itanium is A.06.12.
+ \section2 HP ANSI C++ (aCC)
+
+ The hpux-acc-32 and hpux-acc-64 platforms are tested with aCC A.03.57. The
+ hpuxi-acc-32 and hpuxi-acc-64 platforms are tested with aCC A.06.10.
+
+ \section2 GCC
+
+ The hpux-g++ platform is tested with GCC 3.4.4.
+
\section2 OpenGL Support
Qt's \l{QtOpenGL}{OpenGL} module requires GLX 1.3 or later to be installed.
@@ -161,20 +249,29 @@
\target IRIX
\section1 IRIX - 6.5.x
- \bold{IRIX is an unsupported platform - please see Qt's online
- \l{Platform Support Policy} for details.}
+ \bold{IRIX is an unsupported platform. See the \l{Supported Platforms} page
+ and Qt's Software's online \l{Platform Support Policy} page for details.}
Unpackaging and IRIX tar:
Because of long filenames some files will be cut off incorrectly with IRIX
tar. Please use GNU tar to unpack Qt packages.
+ \section2 MIPSpro
+
+ Qt 4.4.x requires MIPSpro version 7.4.2m.
+
+ Note that MIPSpro version 7.4.4m is currently not supported, since it has
+ introduced a number of problems that have not yet been resolved.
+ We recommend using 7.4.2m for Qt development. However, please note the
+ unsupported status of this platform.
+
\section1 Linux
There are no known problems with using Qt on production versions of
Linux/x86, Linux/ppc, Linux/amd64 and Linux/ia64 (including Altix(R)).
- For the gcc/g++ compiler, please also see the relevant
- \l{Compiler Notes#GCC}{compiler page}.
+ For the GCC compiler, please also see the relevant
+ \l{Platform and Compiler Notes#General Compiler Notes}{General Compiler Notes}.
\section2 Installation problems
@@ -198,6 +295,40 @@
"Failed Dependency". Use the \c{--nodeps} option to \c rpm to workaround
this problem.
+ \section2 Intel C++ Compiler for Linux
+
+ Nokia currently tests the following compilers:
+
+ \list
+
+ \o Intel(R) C++ Compiler for applications running on IA-32,
+ Version 10.1 Build 20080602 Package ID: l_cc_p_10.1.017
+
+ \o Intel(R) C++ Compiler for applications running on Intel(R) 64,
+ Version 10.1 Build 20080602 Package ID: l_cc_p_10.1.017
+
+ \endlist
+
+ We do not currently test the IA-64 (Itanium) compiler.
+
+ \section2 Known Issues with Intel C++ Compiler for Linux
+
+ \list
+
+ \o Precompiled header support does not work in version 10.0.025
+ and older. For these compilers, you should configure Qt with
+ -no-pch. Precompiled header support works properly in version
+ 10.0.026 and later.
+ \o Version 10.0.026 for Intel 64 is known to miscompile qmake when
+ building in release mode. For now, configure Qt with
+ -debug. Version 10.1.008 and later can compile qmake in release
+ mode.
+ \o Versions 10.1.008 to 10.1.015 for both IA-32 and Intel 64 are
+ known crash with "(0): internal error: 0_47021" when compiling
+ QtXmlPatterns, QtWebKit, and Designer in release mode. Version
+ 10.1.017 compiles these modules correctly in release mode.
+ \endlist
+
\target Solaris
\section1 Solaris - 9 or later
@@ -207,25 +338,50 @@
to truncate long filenames. We recommend using star instead
(http://star.berlios.de).
- \section2 CC on Solaris
+ Please note that WebKit is not supported for Solaris, regardless of
+ which compiler is used.
+
+ \section2 CC
+
+ See the notes for \l{Forte Developer / Sun Studio}.
- Be sure to check our \l{Compiler Notes#Sun Studio}{Forte Developer / Sun Studio}
- notes.
+ \section2 GCC
- \section2 GCC on Solaris
+ Please use GCC 3.4.2 or later.
- Be sure to check the installation notes for \l{GCC on Solaris}.
Do not use GCC with Sun's assembler/linker, this will result in link-time
errors in shared libraries. Use GNU binutils instead.
GCC 3.2.* is known to miscompile Qt due to an optimizer bug that will
- cause the resulting binaries to hang. Please use GCC 3.4.2 or later.
+ cause the resulting binaries to hang.
+
+ \section2 Forte Developer / Sun Studio
+
+ Qt is tested using Sun Studio 12 (Sun CC 5.9). Go to
+ \l{Sun Studio Patches} page on Sun's Web site to download
+ the latest patches for your Sun compiler.
+
+ Please note that Qt 4.6 is stricter in its STL requirements and
+ that the default STL implementation used by Sun CC does not pass
+ those requirements. This does not affect binary compatibility and
+ you can continue to use STL in your own code, but Qt's
+ STL-compatibility functions will be disabled.
+
+ Sun CC ships with a secondary STL implementation (called stlport4)
+ which is standards-compliant and can be used by Qt. You can enable
+ it by passing the -library=stlport4 option to the compiler. Note
+ that this does not affect Qt's binary compatibility, but it may
+ affect that of other libraries and programs that use STL.
+
+ \section2 Sun WorkShop 5.0
+
+ Sun WorkShop 5.0 is not supported with Qt 4.
*/
/*!
\page platform-notes-windows.html
- \title Platform Notes - Windows
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - Windows
+ \contentspage Platform and Compiler Notes
This page contains information about the Windows platforms Qt is currently
known to run on, with links to platform-specific notes. More information
@@ -255,12 +411,87 @@
and other applications that require screen grabbing while direct
rendering is enabled. Other GL-applications may not work as expected,
unless direct rendering is disabled.
+
+ \section2 GCC (MinGW)
+
+ We have tested Qt with this compiler on Windows XP.
+ The minimal version of MinGW supported is GCC 4.4.
+
+ \note For users of the MinGW binary package: This package is now
+ based on MinGW 4.4. The installer no longer offers to download
+ MinGW for you, but rather offers to use a version of MinGW that
+ you already have installed on your machine. You just tell the
+ installer which directory MinGW is installed in. If you don't
+ already have MinGW 4.4 installed, you can download a .zip archive
+ from our \l{ftp://ftp.trolltech.com/misc/MinGW-gcc440_1.zip}{FTP
+ site}. This archive provides fixes to MinGW and support for
+ missing API, See the _patches directory in the archive for
+ details.
+
+ \note A MinGW installation is only needed to build against the
+ binary pacakge, not to run the pre-compiled binaries that are in
+ the package.
+
+ \section2 Intel C++ Compiler (Windows, Altix)
+
+ Qt 4 has been tested successfully with:
+
+ \list
+ \o Windows - Intel(R) C++ Compiler for 32-bit applications,
+ Version 9.1.040.
+ \o Altix - Intel(R) C++ Itanium(R) Compiler for Itanium(R)-based
+ applications Version 8.1 Build 20050406 Package ID: l_cc_pc_8.1.030
+ \endlist
+
+ We currently only test the Intel compiler on 32-bit Windows versions.
+
+ \section2 Visual Studio (Windows)
+
+ We do most of our Windows development on Windows XP, using Microsoft
+ Visual Studio .NET 2005 and Visual Studio 2008 (both the 32- and 64-bit
+ versions).
+
+ Qt works with the Standard Edition, the Professional Edition and Team
+ System Edition of Visual Studio 2005.
+
+ In order to use Qt with the Visual Studio 2005/2008 Express Edition you need
+ to download and install the platform SDK. Due to limitations in the
+ Express Edition it is not possible for us to install the Qt Visual
+ Studio Integration. You will need to use our command line tools to
+ build Qt applications with this edition.
+
+ The Visual C++ Linker doesn't understand filenames with spaces (as in
+ \c{C:\Program files\Qt\}) so you will have to move it to another place,
+ or explicitly set the path yourself; for example:
+
+ \snippet doc/src/snippets/code/doc_src_compiler-notes.qdoc 0
+
+ If you are experiencing strange problems with using special flags that
+ modify the alignment of structure and union members (such as \c{/Zp2})
+ then you will need to recompile Qt with the flags set for the
+ application as well.
+
+ If you're using Visual Studio .NET (2002) Standard Edition, you should be
+ using the Qt binary package provided, and not the source package.
+ As the Standard Edition does not optimize compiled code, your compiled
+ version of Qt would perform suboptimally with respect to speed.
+
+ With Visual Studio 2005 Service Pack 1 a bug was introduced which
+ causes Qt not to compile, this has been fixed with a hotfix available
+ from Microsoft. See this
+ \l{http://qt.nokia.com/developer/faqs/faq.2006-12-18.3281869860}{Knowledge Base entry}
+ for more information.
+
+ There currently is a problem when compiling Qt with Visual Studio 2010 for 64-bit.
+ Its optimizer causes trouble and generates code that crashes for the release builds.
+ To avoid the crashes, You need to apply the hotfix in the following article
+ http://support.microsoft.com/kb/2280741.
*/
/*!
\page platform-notes-mac.html
- \title Platform Notes - Mac OS X
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - Mac OS X
+ \contentspage Platform and Compiler Notes
This page contains information about the Mac OS X versions Qt is currently
known to run on, with links to platform-specific notes. More information
@@ -287,11 +518,15 @@
\section2 Required GCC version
- Apple's gcc 4 that is shipped with the Xcode Tools for both Mac OS X 10.4
- and 10.5 will compile Qt. There is preliminary support for gcc 4.2 which
+ Apple's GCC 4 that is shipped with the Xcode Tools for both Mac OS X 10.4
+ and 10.5 will compile Qt. There is preliminary support for GCC 4.2 which
is included with Xcode Tools 3.1+ (configurable with
\c{-platform macx-g++42}).
+ Please use the latest GCC 3.3 from Apple or a later version of GCC 3.
+ The GCC 3.3 that is provided with Xcode 1.5 is known to generate bad code.
+ Use the November 2004 GCC 3.3 updater \l{http://connect.apple.com}{available from Apple}.
+
\section2 Binary Package
The binary package requires that you have your .qt-license file in your
@@ -300,7 +535,7 @@
this file in the email they receive.
The binary package was built on Mac OS X 10.4 with Xcode Tools 2.1
- (gcc 4.0.0) for Qt 4.1.0, Xcode Tools 2.2 (gcc 4.0.1) for Qt 4.1.1-4.1.4
+ (GCC 4.0.0) for Qt 4.1.0, Xcode Tools 2.2 (GCC 4.0.1) for Qt 4.1.1-4.1.4
and Xcode Tools 2.3 for 4.2.0. It will only link executables built
against 10.4 (or a 10.4 SDK). You should be able to run applications
linked against these frameworks on Mac OS X 10.3.9 and Mac OS X 10.4+.
@@ -374,8 +609,8 @@
/*!
\page platform-notes-windows-ce.html
- \title Platform Notes - Windows CE
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - Windows CE
+ \contentspage Platform and Compiler Notes
This page contains information about the Windows CE and Windows Mobile
platforms Qt is currently known to run on, with links to platform-specific
@@ -385,8 +620,8 @@
/*!
\page platform-notes-symbian.html
- \title Platform Notes - Symbian
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - Symbian
+ \contentspage Platform and Compiler Notes
\ingroup platform-specific
\brief Information about the state of support for the Symbian platform.
@@ -468,6 +703,13 @@
for Phonon.
\endtable
+ \section1 Compiler Notes
+
+ \section2 GCCE (Symbian)
+
+ GCCE cannot be used to compile Qt libaries for the Symbian platform, but GCCE is supported
+ when compiling Qt applications for the Symbian platform.
+
\section1 Known Issues
Known issues can be found by visiting the
@@ -495,15 +737,23 @@
\o \c PowerMgmt if QProcess::kill(...) or QProcess::terminate(...) is called.
\row \o QtCore
\o \c AllFiles when \l{http://developer.symbian.org/wiki/index.php/Capabilities_%28Symbian_Signed%29/AllFiles_Capability}{accessing specific areas.}
+ \row \o QtDeclarative
+ \o \c NetworkServices is automatically added for this module.
+ \row \o QtNetwork
+ \o \c NetworkServices is automatically added for this module.
\row \o QtNetwork
- \o \c NetworkServices is basically always required for this module.
+ \o \c ReadUserData is required to include all the phone's SSL certificates in the system's default CA certificate list
+ (for example those added by the user or stored in the SIM card),
+ without this capability only the CA certs built into the phone are used.
\row \o QtMultiMedia
\o \c UserEnvironment if QAudioInput is used.
+ \row \o QtWebkit
+ \o \c NetworkServices is automatically added for this module.
\endtable
- Note that some modules rely on other modules. If your application uses
- QtXmlPatterns, QtWebkit or QtScript it may still require \c NetworkServices
- as these modules rely on QtNetwork to go online.
+ \note Some modules rely on other modules. E.g. QtWebkit and QtDeclarative
+ depend on QtNetwork and therefore any application that
+ depends on these modules is also likely to need \c NetworkServices capability.
For more information see the documentation of the individual Qt classes. If
a class does not mention Symbian capabilities, it requires none.
@@ -580,8 +830,8 @@
/*!
\page platform-notes-embedded-linux.html
- \title Platform Notes - Embedded Linux
- \contentspage Platform Notes
+ \title Platform and Compiler Notes - Embedded Linux
+ \contentspage Platform and Compiler Notes
This page contains information about the Embedded Linux platforms Qt is
currently known to run on, with links to platform-specific notes. More
diff --git a/doc/src/platforms/qt-embedded-linux.qdoc b/doc/src/platforms/qt-embedded-linux.qdoc
index 553c4b1..cd20917 100644
--- a/doc/src/platforms/qt-embedded-linux.qdoc
+++ b/doc/src/platforms/qt-embedded-linux.qdoc
@@ -67,7 +67,7 @@
\o
\list
\o \l {Qt for Embedded Linux Architecture}{Architecture Overview}
- \o \l {Installing Qt on Embedded Linux}{Installation}
+ \o \l {Installing Qt for Embedded Linux}{Installation}
\o \l {Running Qt for Embedded Linux Applications}{Running Applications}
\o \l {Qt for Embedded Linux Examples}{Examples}
\endlist
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index 5218690..3a7d590 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -44,9 +44,8 @@
\tableofcontents
- Information about the specific platforms Qt runs on can be found on the
- \l{Platform Notes} page. Information about the compilers used on each platform
- can be found on the \l{Compiler Notes} page.
+ Information about the specific platforms Qt runs on, and the compilers used
+ on each platform, can be found on the \l{Platform and Compiler Notes} page.
\section1 Tier 1 Platforms
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index 8932747..9da94c4 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -29,7 +29,7 @@
\group qtsymbian
\title Qt for the Symbian platform
\ingroup qt-embedded
- \brief Documents related to Qt on the Symbian platform
+ \brief Documents related to Qt for the Symbian platform
Qt for Symbian is a C++ framework for GUI and application development
for embedded devices running Symbian. Qt for Symbian provides all
@@ -42,14 +42,14 @@
\o
\list
\o \l {Qt for the Symbian platform Requirements}
- \o \l {Installing Qt on the Symbian platform from a Binary Package}
- \o \l {Installing Qt on the Symbian platform}
+ \o \l {Installing Qt for the Symbian platform from a Binary Package}
+ \o \l {Installing Qt for the Symbian platform}
\o \l {The Symbian platform - Introduction to Qt}{Introduction to using Qt}
\endlist
\o
\list
\o \l {Exception Safety with Symbian}
- \o \l {Platform Notes - Symbian} {Qt for the Symbian platform - state of support}
+ \o \l {Platform and Compiler Notes - Symbian} {Qt for the Symbian platform - state of support}
\o \l {qmake Platform Notes#Symbian platform} {Qt for Symbian extensions for qmake}
\o \l {Symbian Platform Security Requirements} {Symbian Platform Security Requirements}
\endlist
@@ -93,10 +93,10 @@
\section1 Installing Qt and Running Demos
- Follow the instructions found in \l{Installing Qt on the Symbian platform from a Binary Package}
+ Follow the instructions found in \l{Installing Qt for the Symbian platform from a Binary Package}
to learn how to install Qt using a binary package and how to build and run Qt demos.
- Follow the instructions found in \l{Installing Qt on the Symbian platform} to learn how to install Qt using
+ Follow the instructions found in \l{Installing Qt for the Symbian platform} to learn how to install Qt using
using source package and how to build and run the Qt demos.
\section1 Building Your Own Applications
@@ -222,6 +222,7 @@
\row \o -s \o Generates stub sis for ROM.
\row \o -n <name> \o Specifies the final sis name.
\row \o -g \o Treat gcce platform as armv5.
+ \row \o -d \o Skip automatic patching of the package when default certificate is used.
\endtable
Execute the \c{createpackage.pl} script without any
diff --git a/doc/src/platforms/wince-customization.qdoc b/doc/src/platforms/wince-customization.qdoc
index a674350..b3b9170 100644
--- a/doc/src/platforms/wince-customization.qdoc
+++ b/doc/src/platforms/wince-customization.qdoc
@@ -33,7 +33,7 @@
When working with a custom SDK for Windows CE, Qt provides an easy way
to add support for it to your development environment. The following is
- a tutorial that covers how to create a specification for Qt on Windows
+ a tutorial that covers how to create a specification for Qt for Windows
CE platforms.
\tableofcontents
diff --git a/doc/src/platforms/wince-introduction.qdoc b/doc/src/platforms/wince-introduction.qdoc
index cd66242..2e9da59 100644
--- a/doc/src/platforms/wince-introduction.qdoc
+++ b/doc/src/platforms/wince-introduction.qdoc
@@ -29,7 +29,7 @@
\group qtce
\title Qt for Windows CE
\ingroup qt-embedded
- \brief Documents related to Qt on Windows CE
+ \brief Documents related to Qt for Windows CE
Qt for Windows CE is a C++ framework for GUI and application development
for embedded devices running Windows CE. It runs on a variety of processors,
@@ -41,7 +41,7 @@
\o
\list
\o \l {Qt for Windows CE Requirements}
- \o \l {Installing Qt on Windows CE}
+ \o \l {Installing Qt for Windows CE}
\o \l {Windows CE - Introduction to using Qt}{Introduction to using Qt}
\endlist
\o
@@ -81,7 +81,7 @@
\section1 Installing Qt
- Follow the instructions found in \l{Installing Qt on Windows CE}.
+ Follow the instructions found in \l{Installing Qt for Windows CE}.
\section1 Building your own applications
diff --git a/doc/src/platforms/winsystem.qdoc b/doc/src/platforms/winsystem.qdoc
index 2919bb7..64e35c5 100644
--- a/doc/src/platforms/winsystem.qdoc
+++ b/doc/src/platforms/winsystem.qdoc
@@ -44,8 +44,8 @@
\tableofcontents
For information about which platforms are supported by Qt, see the
- \l{Platform Notes}. For information on distributing Qt applications, see
- \l{Deploying Qt Applications}.
+ \l{Platform and Compiler Notes}. For information on distributing Qt
+ applications, see \l{Deploying Qt Applications}.
\target x11
\section1 Qt for X11
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index 9947d7b..05817df 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -46,8 +46,8 @@
*/
/*!
- \externalpage http://qt.nokia.com/products/add-on-products/add-on-products/
- \title Third-Party Tools
+ \externalpage http://qt.nokia.com/services-partners/partners/partner-directory
+ \title Partner Directory
*/
/*!
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 7d55f82..62decbb 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -157,7 +157,7 @@
\l{QtUiTools}{dynamic user interface building}.
\o New \l{Proxy Models}{proxy models} to enable view-specific sorting and
filtering of data displayed using item views.
- \o Support for \l{Installing Qt on Mac OS X}{universal binaries} on Mac OS X.
+ \o Support for \l{Installing Qt for Mac OS X}{universal binaries} on Mac OS X.
\o Additional features for developers using \l{QtOpenGL}{OpenGL}, such as
support for pixel and sample buffers.
\o A flexible \l{QSyntaxHighlighter}{syntax highlighting class} based on the
@@ -466,7 +466,7 @@
collaborate tightly and create animated and fluid user experiences,
using existing knowledge in script language and design.
- \i QtDeclarative is a C++ library that provides the underlying engine,
+ \i Qt Declarative is a C++ library that provides the underlying engine,
which translates the declarative description of the UI in QML into
items on a QGraphicsScene. The library also provides APIs to bind
custom C++ types and elements to QML, and to connect the QML UI with
diff --git a/doc/src/snippets/code/doc_src_emb-pointer.qdoc b/doc/src/snippets/code/doc_src_emb-pointer.qdoc
index d333c90..b051a98 100644
--- a/doc/src/snippets/code/doc_src_emb-pointer.qdoc
+++ b/doc/src/snippets/code/doc_src_emb-pointer.qdoc
@@ -104,6 +104,10 @@ QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
//! [11]
+//! [show permissions]
+ls -l /dev/input/mouse0
+//! [show permissions]
+
//! [12]
chmod a+rw /dev/input/mouse0
//! [12]
diff --git a/doc/src/snippets/code/doc_src_fdl.qdoc b/doc/src/snippets/code/doc_src_fdl.qdoc
index 3c15dfe..b55e663 100644
--- a/doc/src/snippets/code/doc_src_fdl.qdoc
+++ b/doc/src/snippets/code/doc_src_fdl.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 0593567..2e59db9 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -301,11 +301,24 @@ make
runonphone -s lib/Qt.sis
//! [47]
+//! [runonphone with device file path]
+runonphone -s lib/Qt.sis -p /dev/ttyUSB1
+//! [runonphone with device file path]
+
//! [48]
cd demos/embedded/fluidlauncher
runonphone -s fluidlauncher.sis fluidlauncher.exe
//! [48]
+//! [make runonphone with options]
+make runonphone "QT_RUN_ON_PHONE_OPTIONS=-p /dev/ttyUSB1"
+//! [make runonphone with options]
+
+//! [make runonphone with preset environment variable]
+export QT_RUN_ON_PHONE_OPTIONS="-p /dev/ttyUSB1"
+make runonphone
+//! [make runonphone with preset environment variable]
+
//! [49]
cd myapp
qmake
diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc
index 7704160..a4ed409 100644
--- a/doc/src/snippets/code/doc_src_properties.qdoc
+++ b/doc/src/snippets/code/doc_src_properties.qdoc
@@ -91,7 +91,7 @@ for (int i=0; i<count; ++i) {
class MyClass : public QObject
{
Q_OBJECT
- Q_PROPERTY(Priority priority READ priority WRITE setPriority)
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
Q_ENUMS(Priority)
public:
@@ -100,8 +100,19 @@ public:
enum Priority { High, Low, VeryHigh, VeryLow };
- void setPriority(Priority priority);
- Priority priority() const;
+ void setPriority(Priority priority)
+ {
+ m_priority = priority;
+ emit priorityChanged(priority);
+ }
+ Priority priority() const
+ { return m_priority; }
+
+signals:
+ void priorityChanged(Priority);
+
+private:
+ Priority m_priority;
};
//! [5]
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index 8c35c3f..4f74e9c 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -1009,3 +1009,23 @@ my_exports = \
"bar.h /epoc32/include/mylib/bar.h"
BLD_INF_RULES.prj_exports += my_exports
//! [152]
+
+//! [153]
+my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE"
+DEPLOYMENT += my_note
+//! [153]
+
+//! [154]
+DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment
+//! [154]
+
+//! [155]
+default_bin_deployment.flags += FILERUN RUNINSTALL
+dep_note.sources = install_note.txt
+dep_note.flags = FILETEXT TEXTEXIT
+DEPLOYMENT += dep_note
+//! [155]
+
+//! [156]
+DEPLOYMENT.display_name = My Qt App
+//! [156]
diff --git a/doc/src/snippets/code/src_qtestlib_qtestcase.cpp b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
index c9bda61..adb0c34 100644
--- a/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
@@ -48,7 +48,7 @@ QVERIFY(1 + 1 == 2);
//! [1]
-QVERIFY2(1 + 1 == 2, "A breach in basic arithmetic occured.");
+QVERIFY2(1 + 1 == 2, "A breach in basic arithmetic occurred.");
//! [1]
@@ -230,5 +230,21 @@ widget.show();
QTest::qWaitForWindowShown(&widget);
//! [24]
+//! [25]
+QWidget widget;
+
+QTest::touchEvent(&widget)
+ .press(0, QPoint(10, 10));
+QTest::touchEvent(&widget)
+ .stationary(0)
+ .press(1, QPoint(40, 10));
+QTest::touchEvent(&widget)
+ .move(0, QPoint(12, 12))
+ .move(1, QPoint(45, 5));
+QTest::touchEvent(&widget)
+ .release(0)
+ .release(1);
+//! [25]
+
}
diff --git a/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml b/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml
new file mode 100644
index 0000000..1888f4e
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 180; height: 180
+
+//! [tiled border image]
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ source: "pics/borderframe.png"
+}
+//! [tiled border image]
+}
diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
index a8e47ad..97659a5 100644
--- a/doc/src/snippets/declarative/comments.qml
+++ b/doc/src/snippets/declarative/comments.qml
@@ -38,7 +38,6 @@
**
****************************************************************************/
-//![0]
import QtQuick 1.0
//![0]
diff --git a/doc/src/snippets/declarative/flipable/flipable.qml b/doc/src/snippets/declarative/flipable/flipable.qml
index cd5da4b..8d48bd9 100644
--- a/doc/src/snippets/declarative/flipable/flipable.qml
+++ b/doc/src/snippets/declarative/flipable/flipable.qml
@@ -46,26 +46,27 @@ Flipable {
width: 240
height: 240
- property int angle: 0
property bool flipped: false
- front: Image { source: "front.png" }
- back: Image { source: "back.png" }
+ front: Image { source: "front.png"; anchors.centerIn: parent }
+ back: Image { source: "back.png"; anchors.centerIn: parent }
transform: Rotation {
- origin.x: flipable.width/2; origin.y: flipable.height/2
- axis.x: 0; axis.y: 1; axis.z: 0 // rotate around y-axis
- angle: flipable.angle
+ id: rotation
+ origin.x: flipable.width/2
+ origin.y: flipable.height/2
+ axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
+ angle: 0 // the default angle
}
states: State {
name: "back"
- PropertyChanges { target: flipable; angle: 180 }
+ PropertyChanges { target: rotation; angle: 180 }
when: flipable.flipped
}
transitions: Transition {
- NumberAnimation { properties: "angle"; duration: 1000 }
+ NumberAnimation { target: rotation; property: "angle"; duration: 4000 }
}
MouseArea {
diff --git a/doc/src/snippets/declarative/keys/keys-handler.qml b/doc/src/snippets/declarative/keys/keys-handler.qml
index 9e3a3b4..be0eedb 100644
--- a/doc/src/snippets/declarative/keys/keys-handler.qml
+++ b/doc/src/snippets/declarative/keys/keys-handler.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.0
Item {
width: 400; height: 400
diff --git a/doc/src/snippets/declarative/keys/keys-pressed.qml b/doc/src/snippets/declarative/keys/keys-pressed.qml
index 523c95b..90a4e37 100644
--- a/doc/src/snippets/declarative/keys/keys-pressed.qml
+++ b/doc/src/snippets/declarative/keys/keys-pressed.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.0
Item {
width: 400; height: 400
diff --git a/doc/src/snippets/declarative/loader/sizeitem.qml b/doc/src/snippets/declarative/loader/sizeitem.qml
new file mode 100644
index 0000000..6ace8d6
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/sizeitem.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 200
+
+ Loader {
+ // position the Loader in the center of the parent
+ anchors.centerIn: parent
+ sourceComponent: rect
+ }
+
+ Component {
+ id: rect
+ Rectangle {
+ width: 50
+ height: 50
+ color: "red"
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/sizeloader.qml b/doc/src/snippets/declarative/loader/sizeloader.qml
new file mode 100644
index 0000000..eac7d57
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/sizeloader.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 200
+
+ Loader {
+ // Explicitly set the size of the Loader to the parent item's size
+ anchors.fill: parent
+ sourceComponent: rect
+ }
+
+ Component {
+ id: rect
+ Rectangle {
+ width: 50
+ height: 50
+ color: "red"
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml b/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml
new file mode 100644
index 0000000..607651a
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Text { text: applicationData.getCurrentDateTime() }
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h b/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h
new file mode 100644
index 0000000..930e381
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QObject>
+#include <QDateTime>
+
+//![0]
+class ApplicationData : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE QDateTime getCurrentDateTime() const {
+ return QDateTime::currentDateTime();
+ }
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp b/doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml
index 124422f..749bea3 100644
--- a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml
@@ -37,26 +37,16 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 1.0
-#include "stopwatch.h"
+//![0]
+Text {
+ text: applicationData.getCurrentDateTime()
-Stopwatch::Stopwatch()
- : m_running(false)
-{
-}
-
-bool Stopwatch::isRunning() const
-{
- return m_running;
-}
-
-void Stopwatch::start()
-{
- m_running = true;
-}
-
-void Stopwatch::stop()
-{
- m_running = false;
+ Connections {
+ target: applicationData
+ onDataChanged: console.log("The application data changed!")
+ }
}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro b/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro
new file mode 100644
index 0000000..188a9fb
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += applicationdata.h
diff --git a/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp b/doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp
index 7481b75..b92215b 100644
--- a/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp
@@ -37,22 +37,21 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
-#include <QApplication>
-#include <QDeclarativeView>
-#include <QDeclarativeContext>
-
-#include "custompalette.h"
+#include "applicationdata.h"
//![0]
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QDeclarativeView view;
- view.rootContext()->setContextProperty("palette", new CustomPalette);
- view.setSource(QUrl::fromLocalFile("main.qml"));
+ ApplicationData data;
+ view.rootContext()->setContextProperty("applicationData", &data);
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
view.show();
return app.exec();
diff --git a/doc/src/snippets/declarative/qtbinding/context/MyItem.qml b/doc/src/snippets/declarative/qtbinding/context/MyItem.qml
new file mode 100644
index 0000000..faa42dc
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context/MyItem.qml
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Text { text: currentDateTime }
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro b/doc/src/snippets/declarative/qtbinding/context/context.pro
index 68eeaf2..68eeaf2 100644
--- a/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro
+++ b/doc/src/snippets/declarative/qtbinding/context/context.pro
diff --git a/doc/src/snippets/declarative/qtbinding/context/main.cpp b/doc/src/snippets/declarative/qtbinding/context/main.cpp
new file mode 100644
index 0000000..bbe9956
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+QDeclarativeView view;
+view.rootContext()->setContextProperty("currentDateTime", QDateTime::currentDateTime());
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+//![0]
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
deleted file mode 100644
index 7e84bd4..0000000
--- a/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation 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 Nokia Corporation 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 <QObject>
-#include <QColor>
-
-//![0]
-class CustomPalette : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QColor background READ background WRITE setBackground NOTIFY backgroundChanged)
- Q_PROPERTY(QColor text READ text WRITE setText NOTIFY textChanged)
-
-public:
- CustomPalette() : m_background(Qt::white), m_text(Qt::black) {}
-
- QColor background() const { return m_background; }
- void setBackground(const QColor &c) {
- if (c != m_background) {
- m_background = c;
- emit backgroundChanged();
- }
- }
-
- QColor text() const { return m_text; }
- void setText(const QColor &c) {
- if (c != m_text) {
- m_text = c;
- emit textChanged();
- }
- }
-
-signals:
- void textChanged();
- void backgroundChanged();
-
-private:
- QColor m_background;
- QColor m_text;
-};
-
-//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro b/doc/src/snippets/declarative/qtbinding/enums/enums.pro
index e6af0d0..82bc123 100644
--- a/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro
+++ b/doc/src/snippets/declarative/qtbinding/enums/enums.pro
@@ -1,3 +1,3 @@
QT += declarative
-HEADERS += custompalette.h
SOURCES += main.cpp
+HEADERS += imageviewer.h
diff --git a/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h b/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h
new file mode 100644
index 0000000..8aaddee
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+//![start]
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_ENUMS(Status)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+public:
+ enum Status {
+ Ready,
+ Loading,
+ Error
+ };
+
+ Status status() const;
+//![start]
+
+ ImageViewer(QDeclarativeItem *parent = 0);
+
+public slots:
+ void emitSignals();
+
+//![end]
+signals:
+ void statusChanged();
+};
+//![end]
diff --git a/doc/src/snippets/declarative/qtbinding/enums/main.cpp b/doc/src/snippets/declarative/qtbinding/enums/main.cpp
new file mode 100644
index 0000000..9243f4b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+#include "imageviewer.h"
+
+ImageViewer::ImageViewer(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ QTimer::singleShot(0, this, SLOT(emitSignals()));
+}
+
+ImageViewer::Status ImageViewer::status() const
+{
+ return Ready;
+}
+
+void ImageViewer::emitSignals()
+{
+ emit statusChanged();
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("standalone.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/enums/standalone.qml b/doc/src/snippets/declarative/qtbinding/enums/standalone.qml
new file mode 100644
index 0000000..ad6c14c
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/standalone.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 MyLibrary 1.0
+
+//![0]
+ImageViewer {
+ onStatusChanged: {
+ if (status == ImageViewer.Ready)
+ console.log("Image viewer is ready!")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml b/doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml
index f894f71..8d8cd56 100644
--- a/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml
@@ -37,21 +37,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
//![0]
+// MyItem.qml
import QtQuick 1.0
-Rectangle {
- width: 300
- height: 300
+Item {
+ width: 100; height: 100
MouseArea {
anchors.fill: parent
onClicked: {
- if (stopwatch.isRunning())
- stopwatch.stop()
- else
- stopwatch.start();
+ myObject.cppMethod("Hello from QML")
+ myObject.cppSlot(12345)
}
}
}
diff --git a/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro b/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro
new file mode 100644
index 0000000..01066c1
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += myclass.h
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp b/doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp
index 12481da..91d6aec 100644
--- a/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp
@@ -37,23 +37,20 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
-#include "stopwatch.h"
-
-#include <QDeclarativeView>
-#include <QDeclarativeContext>
-#include <QApplication>
+#include "myclass.h"
//![0]
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QDeclarativeView view;
- view.rootContext()->setContextProperty("stopwatch",
- new Stopwatch);
+ MyClass myClass;
+ view.rootContext()->setContextProperty("myObject", &myClass);
- view.setSource(QUrl::fromLocalFile("main.qml"));
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
view.show();
return app.exec();
diff --git a/doc/src/snippets/declarative/qtbinding/custompalette/main.qml b/doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h
index a20d9e0..76c628e 100644
--- a/doc/src/snippets/declarative/qtbinding/custompalette/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h
@@ -37,26 +37,21 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QObject>
+#include <QDebug>
//![0]
-import QtQuick 1.0
-
-Rectangle {
- width: 240
- height: 320
- color: palette.background
-
- Text {
- anchors.centerIn: parent
- color: palette.text
- text: "Click me to change color!"
+class MyClass : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE void cppMethod(const QString &msg) {
+ qDebug() << "Called the C++ method with" << msg;
}
- MouseArea {
- anchors.fill: parent
- onClicked: {
- palette.text = "blue";
- }
+public slots:
+ void cppSlot(int number) {
+ qDebug() << "Called the C++ slot with" << number;
}
-}
+};
//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml b/doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml
index 425346d..6161d6e 100644
--- a/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml
@@ -37,19 +37,14 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
//![0]
+// MyItem.qml
import QtQuick 1.0
-Rectangle {
- width: 300
- height: 300
-
- color: backgroundColor
-
- Text {
- anchors.centerIn: parent
- text: "Hello Yellow World!"
+Item {
+ function myQmlFunction(msg) {
+ console.log("Got message:", msg)
+ return "some return value"
}
}
//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro b/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro
new file mode 100644
index 0000000..68eeaf2
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp
new file mode 100644
index 0000000..3e9e51e
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+// main.cpp
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, "MyItem.qml");
+QObject *object = component.create();
+
+QVariant returnedValue;
+QVariant msg = "Hello from C++";
+QMetaObject::invokeMethod(object, "myQmlFunction",
+ Q_RETURN_ARG(QVariant, returnedValue),
+ Q_ARG(QVariant, msg));
+
+qDebug() << "QML function returned:" << returnedValue.toString();
+delete object;
+//![0]
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml b/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml
new file mode 100644
index 0000000..40138f6
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![start]
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 100
+//![start]
+
+//![child]
+ Rectangle {
+ anchors.fill: parent
+ objectName: "rect"
+ }
+//![child]
+
+//![end]
+}
+//![end]
diff --git a/doc/src/snippets/declarative/qtbinding/loading/loading.pro b/doc/src/snippets/declarative/qtbinding/loading/loading.pro
new file mode 100644
index 0000000..68eeaf2
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/loading.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/loading/main.cpp b/doc/src/snippets/declarative/qtbinding/loading/main.cpp
new file mode 100644
index 0000000..bd400b0
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/main.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+static void withComponent()
+{
+//![QDeclarativeComponent-a]
+// Using QDeclarativeComponent
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine,
+ QUrl::fromLocalFile("MyItem.qml"));
+QObject *object = component.create();
+//![QDeclarativeComponent-a]
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![QDeclarativeView]
+// Using QDeclarativeView
+QDeclarativeView view;
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+QObject *object = view.rootObject();
+//![QDeclarativeView]
+
+//![properties]
+object->setProperty("width", 500);
+QDeclarativeProperty(object, "width").write(500);
+//![properties]
+
+//![cast]
+QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
+item->setWidth(500);
+//![cast]
+
+//![findChild]
+QObject *rect = object->findChild<QObject*>("rect");
+if (rect)
+ rect->setProperty("color", "red");
+//![findChild]
+
+//![QDeclarativeComponent-b]
+delete object;
+//![QDeclarativeComponent-b]
+
+withComponent();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h b/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h
new file mode 100644
index 0000000..fd9db5e
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+//![0]
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY imageChanged)
+
+public:
+ void setImage(const QUrl &url);
+ QUrl image() const;
+
+signals:
+ void imageChanged();
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/main.cpp b/doc/src/snippets/declarative/qtbinding/newelements/main.cpp
new file mode 100644
index 0000000..57994ca
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+#include "imageviewer.h"
+
+void ImageViewer::setImage(const QUrl &url) {}
+QUrl ImageViewer::image() const { return QUrl(); }
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ //![register]
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
+ //![register]
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("standalone.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro b/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro
new file mode 100644
index 0000000..82bc123
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += imageviewer.h
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml b/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml
new file mode 100644
index 0000000..7345f21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+import MyLibrary 1.0
+
+ImageViewer { image: "smile.png" }
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml b/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml
new file mode 100644
index 0000000..9db4b93
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: applicationData.backgroundColor
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: applicationData.backgroundColor = "red"
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
new file mode 100644
index 0000000..763a451
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QObject>
+#include <QColor>
+
+//![0]
+class ApplicationData : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor backgroundColor
+ READ backgroundColor
+ WRITE setBackgroundColor
+ NOTIFY backgroundColorChanged)
+
+public:
+ void setBackgroundColor(const QColor &c) {
+ if (c != m_color) {
+ m_color = c;
+ emit backgroundColorChanged();
+ }
+ }
+
+ QColor backgroundColor() const {
+ return m_color;
+ }
+
+signals:
+ void backgroundColorChanged();
+
+private:
+ QColor m_color;
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp b/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp
new file mode 100644
index 0000000..36b508d
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+#include "applicationdata.h"
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ ApplicationData data;
+ view.rootContext()->setContextProperty("applicationData", &data);
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro b/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro
new file mode 100644
index 0000000..188a9fb
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += applicationdata.h
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml b/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml
new file mode 100644
index 0000000..a43ded8
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ property int someNumber: 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp
new file mode 100644
index 0000000..d8daff8
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, "MyItem.qml");
+QObject *object = component.create();
+
+qDebug() << "Property value:" << QDeclarativeProperty::read(object, "someNumber").toInt();
+QDeclarativeProperty::write(object, "someNumber", 5000);
+
+qDebug() << "Property value:" << object->property("someNumber").toInt();
+object->setProperty("someNumber", 100);
+//![0]
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro b/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro
new file mode 100644
index 0000000..68eeaf2
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/resources/main.qml b/doc/src/snippets/declarative/qtbinding/resources/main.qml
index 644d963..43029cf 100644
--- a/doc/src/snippets/declarative/qtbinding/resources/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.qml
@@ -39,9 +39,8 @@
****************************************************************************/
//![0]
+// main.qml
import QtQuick 1.0
-Image {
- source: "images/background.png"
-}
+Image { source: "images/background.png" }
//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml b/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml
new file mode 100644
index 0000000..d900830
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ Connections {
+ target: imageViewer
+ onImageChanged: console.log("Image has changed!")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h b/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h
new file mode 100644
index 0000000..7288d11
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+//![start]
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY imageChanged)
+public:
+//![start]
+ ImageViewer(QDeclarativeItem *item = 0);
+
+ void setImage(const QUrl &url) {}
+ QUrl image() const { return QUrl(); }
+
+public slots:
+ void emitSignals();
+
+//![end]
+signals:
+ void imageChanged();
+ void loadingError(const QString &errorMsg);
+};
+//![end]
+
diff --git a/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp b/doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp
index 6887e8f..e5dd33c 100644
--- a/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp
@@ -37,42 +37,45 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
-#include <QDeclarativeComponent>
-#include <QDeclarativeEngine>
+#include "imageviewer.h"
-//![0]
-#include <QApplication>
-#include <QDeclarativeView>
-#include <QDeclarativeContext>
+
+ImageViewer::ImageViewer(QDeclarativeItem *item)
+ : QDeclarativeItem(item)
+{
+ QTimer::singleShot(0, this, SLOT(emitSignals()));
+}
+
+void ImageViewer::emitSignals()
+{
+ emit imageChanged();
+ emit loadingError("some error message");
+}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QDeclarativeView view;
- QDeclarativeContext *context = view.rootContext();
- context->setContextProperty("backgroundColor",
- QColor(Qt::yellow));
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
- view.setSource(QUrl::fromLocalFile("main.qml"));
- view.show();
+ QDeclarativeView standalone;
+ standalone.setSource(QUrl::fromLocalFile("standalone.qml"));
+ standalone.show();
- return app.exec();
-}
-//![0]
+//![connections]
+ImageViewer viewer;
-static void alternative()
-{
- // Alternatively, if we don't actually want to display main.qml:
-//![1]
- QDeclarativeEngine engine;
- QDeclarativeContext *windowContext = new QDeclarativeContext(engine.rootContext());
- windowContext->setContextProperty("backgroundColor", QColor(Qt::yellow));
+QDeclarativeView view;
+view.rootContext()->setContextProperty("imageViewer", &viewer);
- QDeclarativeComponent component(&engine, "main.qml");
- QObject *window = component.create(windowContext);
-//![1]
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+//![connections]
+
+ return app.exec();
}
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro b/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro
new file mode 100644
index 0000000..9aa8702
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += "imageviewer.h"
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml b/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml
new file mode 100644
index 0000000..4027b19
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 MyLibrary 1.0
+
+//![0]
+ImageViewer {
+ onImageChanged: console.log("Image changed!")
+ onLoadingError: console.log("Image failed to load:", errorMsg)
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml b/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml
new file mode 100644
index 0000000..e4b6ced
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 100; height: 100
+
+ signal qmlSignal(string msg)
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: item.qmlSignal("Hello from QML")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp
new file mode 100644
index 0000000..f1d03c4
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 Nokia Corporation 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 <QtCore>
+#include <QtDeclarative>
+
+//![0]
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view(QUrl::fromLocalFile("MyItem.qml"));
+ QObject *item = view.rootObject();
+
+ MyClass myClass;
+ QObject::connect(item, SIGNAL(qmlSignal(QString)),
+ &myClass, SLOT(cppSlot(QString)));
+
+ view.show();
+ return app.exec();
+}
+//![0]
+
+#include "moc_main.cpp"
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h b/doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h
index fd65916..c326a54 100644
--- a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h
@@ -37,25 +37,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
#include <QObject>
-
+#include <QDebug>
//![0]
-class Stopwatch : public QObject
+class MyClass : public QObject
{
Q_OBJECT
-public:
- Stopwatch();
-
- Q_INVOKABLE bool isRunning() const;
-
public slots:
- void start();
- void stop();
-
-private:
- bool m_running;
+ void cppSlot(const QString &msg) {
+ qDebug() << "Called the C++ slot with message:" << msg;
+ }
};
-
//![0]
-
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro b/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro
new file mode 100644
index 0000000..01066c1
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += myclass.h
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
deleted file mode 100644
index d803e6a..0000000
--- a/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-QT += declarative
-HEADERS += stopwatch.h
-SOURCES += main.cpp stopwatch.cpp
diff --git a/doc/src/snippets/moc/myclass2.h b/doc/src/snippets/moc/myclass2.h
index ca79515..daea23c 100644
--- a/doc/src/snippets/moc/myclass2.h
+++ b/doc/src/snippets/moc/myclass2.h
@@ -58,8 +58,11 @@ public:
MyClass(QObject *parent = 0);
~MyClass();
- void setPriority(Priority priority);
- Priority priority() const;
+ void setPriority(Priority priority) { m_priority = priority; }
+ Priority priority() const { return m_priority; }
+
+private:
+ Priority m_priority;
};
//! [0]
diff --git a/doc/src/sql-programming/sql-driver.qdoc b/doc/src/sql-programming/sql-driver.qdoc
index 21b106a..9c99ad2 100644
--- a/doc/src/sql-programming/sql-driver.qdoc
+++ b/doc/src/sql-programming/sql-driver.qdoc
@@ -153,7 +153,7 @@
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 3
- After installing Qt, as described in the \l{Installing Qt on X11
+ After installing Qt, as described in the \l{Installing Qt for X11
Platforms} document, you also need to install the plugin in the
standard location:
@@ -478,7 +478,7 @@
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 13
- After installing Qt, as described in the \l{Installing Qt on X11 Platforms} document,
+ After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 14
@@ -565,7 +565,7 @@
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 18
- After installing Qt, as described in the \l{Installing Qt on X11 Platforms} document,
+ After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 19
@@ -638,7 +638,7 @@
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 21
- After installing Qt, as described in the \l{Installing Qt on X11 Platforms} document,
+ After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
\snippet doc/src/snippets/code/doc_src_sql-driver.qdoc 22
diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js
index 47539d2..62bc535 100755
--- a/doc/src/template/scripts/functions.js
+++ b/doc/src/template/scripts/functions.js
@@ -105,17 +105,17 @@ function processNokiaData(response){
/* start a new list element */
full_li_element = '<li';
/* if the pageType element reads APIPage, add class name api */
- if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage') {
+ if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage') {
full_li_element += ' class="api"';
apiCount++;
}
/* if the pageType element reads Article, add class name article */
- else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article') {
+ else if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article') {
full_li_element += ' class="article"';
articleCount++;
}
/* if the pageType element reads Example, add class name example */
- else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example') {
+ else if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example') {
full_li_element += ' class="example"';
exampleCount++;
}
diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css
index c1e3f61..fbb0752 100644
--- a/doc/src/template/style/narrow.css
+++ b/doc/src/template/style/narrow.css
@@ -223,6 +223,7 @@
float: right;
margin: 15px 40px 0 0;
font-size: 11px;
+ position: relative;
}
.narrow #narrowmenu {
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 536b3c8..03bc9a9 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -101,7 +101,7 @@
}
a
{
- color: #00732f;
+ color: #00732F;
text-decoration: none;
}
hr
@@ -179,12 +179,27 @@
span.comment
{
- color: #8B0000;
- font-style: italic;
+ color: #008B00;
}
span.string, span.char
{
- color: #254117;
+ color: #000084;
+ }
+ span.number
+ {
+ color: #a46200;
+ }
+ span.operator
+ {
+ color: black;
+ }
+ span.keyword
+ {
+ color: #840000;
+ }
+ span.name
+ {
+ color: black
}
@@ -660,13 +675,31 @@
-webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
-moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
+ font-size: 11px;
+ }
+
+ #resultdialog a
+ {
+ color: #00732f;
}
#resultdialog.active {
display: block;
- width:30%;
}
+ .narrow #resultdialog {
+ width: 60%;
+ _width: 360px;
+ }
+
+ .narrow #resultdialog.active {
+ right: 10px;
+ *left: auto;
+ _left: auto;
+ _right: -20px;
+ }
+
+
#resultdialog #resultclose {
float: right;
}
@@ -779,6 +812,7 @@
margin-right: 15px;
font-weight: bold;
color: #B0ADAB;
+ font: bold 10px/1.2 Verdana;
}
.toolbuttons #print
@@ -892,7 +926,6 @@
}
.wrap .content h2
{
- border-bottom:1px solid #DDDDDD;
font:600 16px/1.2 Arial;
margin-top:15px;
width:100%;
@@ -990,7 +1023,7 @@
/*display:inline-block;*/
margin-left:10px;
min-width:250px;
- line-height: 1.2;
+ line-height: 1.5;
min-width:100%;
min-height:15px;
}
@@ -1279,6 +1312,10 @@
background-color: #E6E7E8;
margin: 0;
}
+ .small
+ {
+ font: normal 9px/1 Verdana;
+ }
/* end footer elements */
@@ -1453,7 +1490,7 @@
}
- .creator .header, .footer, .wrapper
+ .creator .header, .creator .footer, .creator .wrapper
{
max-width: 1500px;
margin: 0px;
@@ -1658,6 +1695,58 @@
}
/* end of creator spec*/
+ .item {
+ float: left;
+ position: relative;
+ width: 100%;
+ overflow: hidden;
+ }
+
+
+ .item .primary {
+ margin-right: 220px;
+ position: relative;
+ }
+
+ .item hr {
+ margin-left: -220px;
+ }
+
+ .item .secondary {
+ float: right;
+ width: 200px;
+ position: relative;
+ }
+
+ .item .cols {
+ clear: both;
+ display: block;
+ }
+
+ .item .cols .col {
+ float: left;
+ margin-left: 1.5%;
+ }
+
+ .item .cols .col.first {
+ margin-left: 0;
+ }
+
+ .item .cols.two .col {
+ width: 45%;
+ }
+
+ .item .box {
+ margin: 0 0 10px 0;
+ }
+
+ .item .box h3 {
+ margin: 0 0 10px 0;
+ }
+
+ .cols.unclear {
+ clear:none;
+ }
}
/* end of screen media */