summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure1
-rw-r--r--demos/declarative/flickr/common/Progress.qml2
-rw-r--r--demos/declarative/flickr/mobile/Button.qml2
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml2
-rw-r--r--demos/declarative/flickr/mobile/ListDelegate.qml6
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml2
-rw-r--r--doc/src/declarative/anchor-layout.qdoc2
-rw-r--r--doc/src/declarative/codingconventions.qdoc2
-rw-r--r--doc/src/declarative/declarativeui.qdoc98
-rw-r--r--doc/src/declarative/elements.qdoc9
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc1
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc34
-rw-r--r--doc/src/declarative/pics/flipable.gifbin80659 -> 131710 bytes
-rw-r--r--doc/src/declarative/pics/spacing_a.pngbin547 -> 0 bytes
-rw-r--r--doc/src/declarative/pics/spacing_b.pngbin560 -> 0 bytes
-rw-r--r--doc/src/declarative/propertybinding.qdoc33
-rw-r--r--doc/src/declarative/qdeclarativedocument.qdoc67
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc155
-rw-r--r--doc/src/declarative/qml-intro.qdoc6
-rw-r--r--doc/src/development/qmake-manual.qdoc109
-rw-r--r--doc/src/examples/qml-examples.qdoc4
-rw-r--r--doc/src/getting-started/gettingstartedqml.qdoc14
-rw-r--r--doc/src/images/qml-borderimage-normal-image.pngbin0 -> 5282 bytes
-rw-r--r--doc/src/images/qml-borderimage-scaled.pngbin0 -> 5580 bytes
-rw-r--r--doc/src/images/qml-borderimage-tiled.pngbin0 -> 5889 bytes
-rw-r--r--doc/src/images/qml-flow-snippet.pngbin0 -> 11465 bytes
-rw-r--r--doc/src/images/qml-flow-text1.pngbin0 -> 9647 bytes
-rw-r--r--doc/src/images/qml-flow-text2.pngbin0 -> 10870 bytes
-rw-r--r--doc/src/images/qml-grid-no-spacing.pngbin0 -> 416 bytes
-rw-r--r--doc/src/images/qml-grid-spacing.pngbin0 -> 421 bytes
-rw-r--r--doc/src/images/qml-listview-snippet.pngbin0 -> 2048 bytes
-rw-r--r--doc/src/images/qml-repeater-grid-index.pngbin0 -> 17964 bytes
-rw-r--r--doc/src/images/qml-row.pngbin0 -> 3090 bytes
-rw-r--r--doc/src/snippets/declarative/anchoranimation.qml1
-rw-r--r--doc/src/snippets/declarative/anchorchanges.qml53
-rw-r--r--doc/src/snippets/declarative/animatedimage.qml61
-rw-r--r--doc/src/snippets/declarative/behavior.qml57
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-scaled.qml (renamed from doc/src/snippets/declarative/borderimage.qml)40
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-tiled.qml81
-rw-r--r--doc/src/snippets/declarative/borderimage/normal-image.qml77
-rw-r--r--doc/src/snippets/declarative/borderimage/pics/borderframe.pngbin0 -> 3411 bytes
-rw-r--r--doc/src/snippets/declarative/borderimage/pics/borderframe.svg82
-rw-r--r--doc/src/snippets/declarative/coloranimation.qml57
-rw-r--r--doc/src/snippets/declarative/column/column.qml67
-rw-r--r--doc/src/snippets/declarative/column/vertical-positioner-transition.qml61
-rw-r--r--doc/src/snippets/declarative/column/vertical-positioner.qml50
-rw-r--r--doc/src/snippets/declarative/component.qml57
-rw-r--r--doc/src/snippets/declarative/flickable.qml50
-rw-r--r--doc/src/snippets/declarative/flipable/flipable.qml (renamed from doc/src/snippets/declarative/flipable.qml)0
-rw-r--r--doc/src/snippets/declarative/flow-diagram.qml75
-rw-r--r--doc/src/snippets/declarative/flow.qml64
-rw-r--r--doc/src/snippets/declarative/grid/grid-items.qml58
-rw-r--r--doc/src/snippets/declarative/grid/grid-no-spacing.qml57
-rw-r--r--doc/src/snippets/declarative/grid/grid-spacing.qml60
-rw-r--r--doc/src/snippets/declarative/grid/grid.qml53
-rw-r--r--doc/src/snippets/declarative/image.qml47
-rw-r--r--doc/src/snippets/declarative/listmodel-modify.qml53
-rw-r--r--doc/src/snippets/declarative/listmodel-nested.qml53
-rw-r--r--doc/src/snippets/declarative/listmodel-simple.qml53
-rw-r--r--doc/src/snippets/declarative/listview/listview-snippet.qml52
-rw-r--r--doc/src/snippets/declarative/numberanimation.qml57
-rw-r--r--doc/src/snippets/declarative/parallelanimation.qml57
-rw-r--r--doc/src/snippets/declarative/parentanimation.qml53
-rw-r--r--doc/src/snippets/declarative/parentchange.qml53
-rw-r--r--doc/src/snippets/declarative/pics/qtlogo.pngbin0 -> 2991 bytes
-rw-r--r--doc/src/snippets/declarative/propertyaction.qml53
-rw-r--r--doc/src/snippets/declarative/propertyanimation.qml53
-rw-r--r--doc/src/snippets/declarative/propertychanges.qml53
-rw-r--r--doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml67
-rw-r--r--doc/src/snippets/declarative/qml-data-models/listelements.qml77
-rw-r--r--doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml64
-rw-r--r--doc/src/snippets/declarative/qml-documents/inline-component.qml57
-rw-r--r--doc/src/snippets/declarative/qml-documents/inline-text-component.qml55
-rw-r--r--doc/src/snippets/declarative/qml-documents/non-trivial.qml62
-rw-r--r--doc/src/snippets/declarative/qml-documents/qmldocuments.qml66
-rw-r--r--doc/src/snippets/declarative/qml-intro/anchors1.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/anchors2.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/anchors3.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/hello-world4.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/hello-world5.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/images/qt-logo.svg104
-rw-r--r--doc/src/snippets/declarative/qml-intro/number-animation1.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/number-animation2.qml2
-rw-r--r--doc/src/snippets/declarative/qml-intro/sequential-animation1.qml4
-rw-r--r--doc/src/snippets/declarative/qml-intro/sequential-animation2.qml4
-rw-r--r--doc/src/snippets/declarative/qml-intro/sequential-animation3.qml6
-rw-r--r--doc/src/snippets/declarative/qml-intro/transformations1.qml2
-rw-r--r--doc/src/snippets/declarative/qmldocuments.qml66
-rw-r--r--doc/src/snippets/declarative/qtobject.qml57
-rw-r--r--doc/src/snippets/declarative/repeaters/repeater-grid-index.qml61
-rw-r--r--doc/src/snippets/declarative/repeaters/repeater.qml (renamed from doc/src/snippets/declarative/repeater.qml)0
-rw-r--r--doc/src/snippets/declarative/rotationanimation.qml53
-rw-r--r--doc/src/snippets/declarative/row.qml62
-rw-r--r--doc/src/snippets/declarative/row/row.qml50
-rw-r--r--doc/src/snippets/declarative/sequentialanimation.qml57
-rw-r--r--doc/src/snippets/declarative/state-when.qml57
-rw-r--r--doc/src/snippets/declarative/state.qml57
-rw-r--r--doc/src/snippets/declarative/states.qml57
-rw-r--r--doc/src/snippets/declarative/systempalette.qml57
-rw-r--r--doc/src/snippets/declarative/transition-from-to.qml57
-rw-r--r--doc/src/snippets/declarative/transition-reversible.qml53
-rw-r--r--doc/src/snippets/declarative/transition.qml57
-rw-r--r--doc/src/snippets/declarative/visualdatamodel.qml53
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp57
-rw-r--r--doc/src/snippets/declarative/~image-fillmode.qml46
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog12
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp10
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp94
-rw-r--r--src/corelib/io/qdir.cpp479
-rw-r--r--src/corelib/io/qdir.h7
-rw-r--r--src/corelib/io/qfileinfo.cpp216
-rw-r--r--src/corelib/io/qfileinfo.h16
-rw-r--r--src/corelib/io/qfileinfo_p.h114
-rw-r--r--src/corelib/io/qurl.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp57
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp129
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp56
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp29
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp46
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp74
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp437
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp2
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp11
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp3
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent.cpp2
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp37
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/gui/image/qpixmap_s60.cpp12
-rw-r--r--src/gui/image/qpixmap_s60_p.h11
-rw-r--r--src/gui/kernel/qapplication.cpp6
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp96
-rw-r--r--src/tools/rcc/rcc.cpp7
-rw-r--r--src/tools/uic/cpp/cppextractimages.cpp8
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp10
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp35
-rw-r--r--src/tools/uic/driver.cpp5
-rw-r--r--src/tools/uic/option.h8
-rw-r--r--tests/arthur/common/paintcommands.cpp2
-rw-r--r--tests/auto/qdir/tst_qdir.cpp99
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp65
-rw-r--r--tests/auto/qurl/tst_qurl.cpp6
-rw-r--r--tools/configure/configureapp.cpp4
-rw-r--r--tools/designer/src/components/formeditor/formeditor.qrc1
152 files changed, 4158 insertions, 1980 deletions
diff --git a/configure b/configure
index f2b6455..b796de9 100755
--- a/configure
+++ b/configure
@@ -7184,6 +7184,7 @@ if [ "$CFG_WEBKIT" = "yes" ]; then
# The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
CFG_WEBKIT="yes"
else
+ rm -f "$outpath/mkspecs/modules/qt_webkit_version.pri"
CFG_WEBKIT="no"
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
fi
diff --git a/demos/declarative/flickr/common/Progress.qml b/demos/declarative/flickr/common/Progress.qml
index 99e1a7b..23bffb9 100644
--- a/demos/declarative/flickr/common/Progress.qml
+++ b/demos/declarative/flickr/common/Progress.qml
@@ -68,6 +68,6 @@ Item {
text: Math.round(progress * 100) + "%"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- color: "white"; font.bold: true
+ color: "white"; font.bold: true; font.pixelSize: 15
}
}
diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml
index 93a6661..6228606 100644
--- a/demos/declarative/flickr/mobile/Button.qml
+++ b/demos/declarative/flickr/mobile/Button.qml
@@ -66,7 +66,7 @@ Item {
}
Text {
color: "white"
- anchors.centerIn: buttonImage; font.bold: true
+ anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15
text: container.text; style: Text.Raised; styleColor: "black"
}
states: [
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 7441ecc..6408fc6 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -96,7 +96,7 @@ Flipable {
Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
Common.Progress {
- anchors.centerIn: parent; width: 200; height: 18
+ anchors.centerIn: parent; width: 200; height: 22
progress: bigImage.progress; visible: bigImage.status != Image.Ready
}
diff --git a/demos/declarative/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/mobile/ListDelegate.qml
index 3dd2868..9ec02e1 100644
--- a/demos/declarative/flickr/mobile/ListDelegate.qml
+++ b/demos/declarative/flickr/mobile/ListDelegate.qml
@@ -55,9 +55,9 @@ Component {
}
Column {
x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
- Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
- Text { text: photoAuthor; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
- Text { text: photoDate; width: parent.width; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
+ Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
}
}
}
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 335c315..60ca4dc 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -78,7 +78,7 @@ Item {
}
elide: Text.ElideLeft
text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags)
- font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
+ font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black"
}
Button {
diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc
index 5c025e5..99f7777 100644
--- a/doc/src/declarative/anchor-layout.qdoc
+++ b/doc/src/declarative/anchor-layout.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\page anchor-layout.html
+\page qml-anchor-layout.html
\target anchor-layout
\title Anchor-based Layout in QML
diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc
index 9403920..aa4feef 100644
--- a/doc/src/declarative/codingconventions.qdoc
+++ b/doc/src/declarative/codingconventions.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\page codingconventions.html
+\page qml-coding-conventions.html
\title QML Coding Conventions
This document contains the QML coding conventions that we follow in our documentation and examples and recommend that others follow.
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index e1c9473..2f43682 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -34,28 +34,36 @@
\brief Qt Quick provides a declarative framework for building highly
dynamic, custom user interfaces.
-Qt Quick provides a declarative framework for building highly dynamic,
-custom user interfaces from a rich set of \l{QML Elements}{QML elements}.
-Qt Quick helps programmers and designers collaborate to
-build the fluid user interfaces that are becoming common in portable
-consumer devices, such as mobile phones, media players, set-top boxes
-and netbooks. Qt Quick consists of the QtDeclarative C++ module, QML, and
-the integration of both of these into the Qt Creator IDE. Using the QtDeclarative
-C++ module, you can load and interact with QML files from your Qt application.
-
-QML is an extension to \l{About JavaScript}{JavaScript}, that provides
-a mechanism to declaratively build an object tree of
-\l{QML Elements}{QML elements}. QML improves the integration between
-JavaScript and Qt's existing QObject-based type system, adds support for
-automatic \l{Property Binding}{property bindings} and provides
+\section1 Introduction
+
+Qt Quick is a collection of technologies that are designed to help
+developers create the kind of intuitive, modern-looking, fluid user
+interfaces that are increasingly used on mobile phones, media players,
+set-top boxes and other portable devices.
+
+Qt Quick consists of a rich set of user interface elements, a declarative
+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
+
+User interfaces and their behavior are described using QML, an extension to
+\l{About JavaScript}{JavaScript} that lets developers and designers
+use a declarative syntax to specify each user interface in terms of
+\l{QML Elements}{QML elements}. These elements are a sophisticated set of
+graphical and behavioral building blocks that can be combined together in
+\l{QML Documents}{QML documents} to build components ranging in complexity
+from simple buttons and sliders, to complete Internet-enabled applications.
+
+QML improves the integration between JavaScript and Qt's existing
+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 \l{QML Elements}{QML elements} are a sophisticated set of
-graphical and behavioral building blocks. These different elements
-are combined together in \l{QML Documents}{QML documents} to build
-components ranging in complexity from simple buttons and sliders, to
-complete Internet-enabled applications like a photo browser for the
-popular \l{http://www.flickr.com}{Flickr} photo-sharing site.
+The QtDeclarative 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
@@ -67,32 +75,55 @@ Module.
\list
\o \l{Introduction to the QML language}
-\o \l{QML Tutorial}{Tutorial: 'Hello World'}
-\o \l{QML Advanced Tutorial}{Tutorial: 'Same Game'}
-\o \l{QML Examples and Demos}
\o \l{QML for Qt Programmers}
\o \l{Getting Started Programming with QML}
\o \l{Beginning Qt Quick}
\endlist
-\section1 Core QML Features
+\list
+\o \l{QML Tutorial}{Tutorial: "Hello World"}
+\o \l{QML Advanced Tutorial}{Tutorial: "Same Game"}
+\o \l{QML Examples and Demos}
+\endlist
+
+\section1 QML Concepts
+
\list
\o \l{QML Documents}
\o \l{Property Binding}
-\o \l{Network Transparency}
\o \l{QML Scope}
-\o \l{Integrating JavaScript}
-\o \l{Data Models}
+\o \l{QML Modules}
\o \l{Anchor-based Layout in QML}
+\endlist
+
+\section1 User Interaction
+
+\list
+\o \l{Keyboard Focus in QML}
\o \l{QML States}
\o \l{QML Animation}
-\o \l{Keyboard Focus in QML}
-\o \l{QML Modules}
+\endlist
+
+\section1 Handling Data
+
+\list
+\o \l{Using QML Positioner and Repeater Items}
+\o \l{QML Data Models}
+\o \l{Presenting Data with QML}
+\o \l{Network Transparency}
+\endlist
+
+\section1 Architecture
+
+\list
+\o \l{Qt Declarative UI Runtime}
+\o \l{Integrating JavaScript}
\o \l{Extending types from QML}
\o \l{Dynamic Object Management in QML}
\endlist
\section1 Using QML with C++
+
\list
\o \l{Qt Declarative UI Runtime}
\o \l{Using QML in C++ Applications}
@@ -102,6 +133,7 @@ Module.
\endlist
\section1 Reference
+
\list
\o \l{QML Elements}
\o \l{QML Global Object}
@@ -113,4 +145,12 @@ Module.
\o \l{QML Performance}
\o \l{QML Coding Conventions}
\endlist
+
+\section1 Online Examples
+
+\list
+\o Forum Nokia:
+\l{http://wiki.forum.nokia.com/index.php/Qt_Quick_examples_for_porting}{Qt Quick
+examples for porting}
+\endlist
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 94abe10..252b964 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -29,12 +29,13 @@
\page qdeclarativeelements.html
\target elements
\title QML Elements
+ \brief A dictionary of standard QML elements.
- This is a dictionary of all the QML elements available in the \l
- {QtDeclarative} {Qt Declarative} module.
+ This is a dictionary of all standard QML elements made available
+ in the QtDeclarative module.
- To see the QML elements listed by
- functional area, \l{Groups Of Related QML Elements} {look here}.
+ To see the QML elements listed by functional area, see the
+ \l{Groups Of Related QML Elements} page.
\generatelist qmlclasses
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index d128d0f..349ac30 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -26,7 +26,6 @@
****************************************************************************/
/*!
-
\page qml-extending-tutorial-index.html
\title Tutorial: Writing QML extensions with C++
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index 18da3d2..d290690 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -173,6 +173,40 @@ handler to execute at startup, they are run sequentially in an undefined order.
Likewise, the \l {Component::onDestruction} attached property is triggered on
component destruction.
+
+\section1 Property Assignment vs Property Binding
+
+When working with both QML and JavaScript, it is important to differentiate between
+QML \l {Property Binding} and JavaScript value assignment. In QML, a property
+binding is created using the \e {property: value} syntax:
+
+\code
+Rectangle {
+ width: otherItem.width
+}
+\endcode
+
+The \c width of the above \l Rectangle is updated whenever \c otherItem.width changes. On the other
+hand, take the following JavaScript code snippet, that runs when the \l Rectangle is created:
+
+\code
+Rectangle {
+
+ Component.onCompleted: {
+ width = otherItem.width;
+ }
+}
+\endcode
+
+The \c width of this \l Rectangle is \e assigned the value of \c otherItem.width using the
+\e {property = value} syntax in JavaScript. Unlike the QML \e {property: value} syntax, this
+does not invoke QML property binding; the \c rectangle.width property is set to the value
+of \c otherItem.width at the time of the assignment and will not be updated if that value
+changes.
+
+See \l {Property Binding} for more information.
+
+
\section1 QML JavaScript Restrictions
QML executes standard JavaScript code, with the following restrictions:
diff --git a/doc/src/declarative/pics/flipable.gif b/doc/src/declarative/pics/flipable.gif
index 6386f06..da37b2b 100644
--- a/doc/src/declarative/pics/flipable.gif
+++ b/doc/src/declarative/pics/flipable.gif
Binary files differ
diff --git a/doc/src/declarative/pics/spacing_a.png b/doc/src/declarative/pics/spacing_a.png
deleted file mode 100644
index c0fe895..0000000
--- a/doc/src/declarative/pics/spacing_a.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/declarative/pics/spacing_b.png b/doc/src/declarative/pics/spacing_b.png
deleted file mode 100644
index 24cf640..0000000
--- a/doc/src/declarative/pics/spacing_b.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc
index 552b9e4..314bf67 100644
--- a/doc/src/declarative/propertybinding.qdoc
+++ b/doc/src/declarative/propertybinding.qdoc
@@ -94,10 +94,29 @@ Rectangle {
}
\endcode
-Imperatively assigning a value directly to a property will also implicitly remove a binding
-on a property. A property can only have one value at a time, and if code explicitly sets
-this value the binding must be removed. The \l Rectangle in the example below will have
-a width of 13, regardless of the otherItem's width.
+
+\section1 Effects of Property Assignment in JavaScript
+
+Assigning a property value from JavaScript does \e not create a property binding.
+For example:
+
+\code
+Rectangle {
+
+ Component.onCompleted: {
+ width = otherItem.width;
+ }
+}
+\endcode
+
+Instead of creating a property binding, this simply sets the \c width of the \l Rectangle
+to the value of \c other.width at the time the JavaScript code is invoked. See
+\l {Property Assignment vs Property Binding} for more details.
+
+Also note that assigning a value to a property that is currently bound will remove the binding.
+A property can only have one value at a time, and if any code explicitly sets
+this value, the binding is removed. The \l Rectangle in the example below will have
+a width of 13, regardless of the \c otherItem's width.
\code
Rectangle {
@@ -109,7 +128,9 @@ Rectangle {
}
\endcode
-There is no way to create a property binding directly from imperative JavaScript code.
+There is no way to create a property binding directly from imperative JavaScript code,
+although it is possible to set up a \l Binding object (shown below).
+
\section1 Binding Element
@@ -126,5 +147,7 @@ Binding {
value: slider.value
}
\endqml
+
+
*/
diff --git a/doc/src/declarative/qdeclarativedocument.qdoc b/doc/src/declarative/qdeclarativedocument.qdoc
index 068297a..8ca6c11 100644
--- a/doc/src/declarative/qdeclarativedocument.qdoc
+++ b/doc/src/declarative/qdeclarativedocument.qdoc
@@ -28,34 +28,17 @@
/*!
\page qdeclarativedocuments.html
\title QML Documents
+\brief A description of QML documents and the kind of content they contain.
-A QML document is a block of QML source code. QML documents generally correspond to files
-stored on a disk or network resource, but can also be constructed directly from text data.
+\section1 Introduction
-Here is a simple QML document:
+A QML document is a block of QML source code. QML documents generally correspond to files
+stored on a disk or at a location on a network, but they can also be constructed directly
+from text data.
-\code
-import Qt 4.7
+Here is a simple QML document:
-Rectangle {
- width: 240; height: 320;
-
- resources: [
- Component {
- id: contactDelegate
- Text {
- text: modelData.firstName + " " + modelData.lastName
- }
- }
- ]
-
- ListView {
- anchors.fill: parent
- model: contactModel
- delegate: contactDelegate
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-documents/non-trivial.qml document
QML documents are always encoded in UTF-8 format.
@@ -96,7 +79,7 @@ Each instance is created with a different value for its \c text property:
\o application.qml
\row
-\o \snippet doc/src/snippets/declarative/qmldocuments.qml 0
+\o \snippet doc/src/snippets/declarative/qml-documents/qmldocuments.qml document
\o
\qml
import Qt 4.7
@@ -153,39 +136,9 @@ These final two examples are behaviorally identical to the original document.
\table
\row
\o
-\code
-import Qt 4.7
-
-Rectangle {
- width: 240; height: 320;
-
- ListView {
- anchors.fill: parent
- model: contactModel
- delegate: Component {
- Text {
- text: modelData.firstName + " " + modelData.lastName
- }
- }
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-documents/inline-component.qml document
\o
-\code
-import Qt 4.7
-
-Rectangle {
- width: 240; height: 320;
-
- ListView {
- anchors.fill: parent
- model: contactModel
- delegate: Text {
- text: modelData.firstName + " " + modelData.lastName
- }
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-documents/inline-text-component.qml document
\endtable
\sa QDeclarativeComponent
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index 173002a..7548c96 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -28,7 +28,7 @@
/*!
\page qdeclarativemodels.html
\target qmlmodels
-\title Data Models
+\title QML Data Models
QML items such as ListView, GridView and \l Repeater require Data Models
that provide the data to be displayed.
@@ -41,30 +41,7 @@ delegate may bind to. Here is a ListModel with two roles, \e type and \e age,
and a ListView with a delegate that binds to these roles to display their
values:
-\qml
-import Qt 4.7
-
-Item {
- width: 200; height: 250
-
- ListModel {
- id: myModel
- ListElement { type: "Dog"; age: 8 }
- ListElement { type: "Cat"; age: 5 }
- }
-
- Component {
- id: myDelegate
- Text { text: type + ", " + age }
- }
-
- ListView {
- anchors.fill: parent
- model: myModel
- delegate: myDelegate
- }
-}
-\endqml
+\snippet doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml document
If there is a naming clash between the model's properties and the delegate's
properties, the roles can be accessed with the qualified \e model name instead.
@@ -91,6 +68,10 @@ QML provides several types of data models among the built-in set of
QML elements. In addition, models can be created with C++ and then
made available to QML components.
+The views used to access data models are described in \l{Presenting Data with QML}.
+The use of positioner items to arrange items from a model is covered in
+\l{Using QML Positioner and Repeater Items}.
+
\section1 QML Data Models
@@ -99,38 +80,12 @@ made available to QML components.
ListModel is a simple hierarchy of elements specified in QML. The
available roles are specified by the \l ListElement properties.
-\code
-ListModel {
- id: fruitModel
-
- ListElement {
- name: "Apple"
- cost: 2.45
- }
- ListElement {
- name: "Orange"
- cost: 3.25
- }
- ListElement {
- name: "Banana"
- cost: 1.95
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-data-models/listelements.qml model
The above model has two roles, \e name and \e cost. These can be bound
to by a ListView delegate, for example:
-\code
-ListView {
- width: 200; height: 250
- model: fruitModel
- delegate: Row {
- Text { text: "Fruit: " + name }
- Text { text: "Cost: $" + cost }
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view
ListModel provides methods to manipulate the ListModel directly via JavaScript.
In this case, the first item inserted determines the roles available
@@ -138,16 +93,9 @@ to any views that are using the model. For example, if an empty ListModel is
created and populated via JavaScript, the roles provided by the first
insertion are the only roles that will be shown in the view:
-\code
-Item {
- ListModel { id: fruitModel }
-
- MouseArea {
- anchors.fill: parent
- onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml model
+\dots
+\snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml mouse area
When the MouseArea is clicked, \c fruitModel will have two roles, \e cost and \e name.
Even if subsequent roles are added, only the first two will be handled by views
@@ -515,3 +463,84 @@ a function in the model, e.g.:
updated, and that \e{value} holds the new value.
*/
+
+/*!
+\page qml-presenting-data.html
+\title Presenting Data with QML
+
+\section1 Introduction
+
+Qt Quick contains a set of standard items that can be used to present data in a
+number of different ways. For simple user interfaces,
+\l{Using QML Positioner and Repeater Items#Repeaters}{Repeaters} can be used
+in combination with
+\l{Using QML Positioner and Repeater Items#Positioners}{Positioners}
+to obtain pieces of data and arrange them in a user interface. However, when
+large quantities of data are involved, it is often better to use models with
+the standard views since these contain many built-in display and navigation
+features.
+
+\section1 Views
+
+Views are scrolling containers for collections of items. They are feature-rich,
+supporting many of the use cases found in typical applications, and can be
+customized to meet requirements on style and behavior.
+
+A set of standard views are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{#ListView}{ListView} arranges items in a horizontal or vertical list
+\o \l{#GridView}{GridView} arranges items in a grid within the available space
+\o \l{#PathView}{PathView} arranges items on a path
+\endlist
+
+Unlike these items, \l WebView is not a fully-featured view item, and needs
+to be combined with a \l Flickable item to create a view that performs like
+a Web browser.
+
+\section2 ListView
+
+\l ListView shows a classic list of items with horizontal or vertical placing
+of items.
+
+\beginfloatright
+\inlineimage qml-listview-snippet.png
+\endfloat
+
+The following example shows a minimal ListView displaying a sequence of
+numbers (using an \l{QML Data Models#An Integer}{integer as a model}).
+A simple delegate is used to define an items for each piece of data in the
+model.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/listview/listview-snippet.qml document
+
+
+
+\section2 GridView
+
+\l GridView displays items in a grid like an file manager's icon view.
+
+\section2 PathView
+
+\l PathView displays items on a path, where the selection remains in
+the same place and the items move around it.
+
+\section1 Decorating Views
+
+\section2 Headers and Footers
+
+\section2 Sections
+
+\section2 Navigation
+
+In traditional user interfaces, views can be scrolled using standard
+controls, such as scroll bars and arrow buttons. In some situations, it
+is also possible to drag the view directly by pressing and holding a
+mouse button while moving the cursor. In touch-based user interfaces,
+this dragging action is often complemented with a flicking action, where
+scrolling continues after the user has stopped touching the view.
+
+\section1 Further Reading
+*/
diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc
index 9130be0..b77611c 100644
--- a/doc/src/declarative/qml-intro.qdoc
+++ b/doc/src/declarative/qml-intro.qdoc
@@ -58,12 +58,12 @@ would be a property.
The basic syntax of an \l{QML Elements}{element} is
-\code
+\qml
SomeElement {
id: myObject
... some other things here ...
}
-\endcode
+\endqml
Here we are defining a new object. We specify its 'type' first as SomeElement.
Then within matching braces { ... } we specify the various parts of our
@@ -583,7 +583,7 @@ rectangle. The \c value attribute of 'dial' is set to a value based on the
the rotation of the needle image. Notice this piece of code in Dial where
the change in \c value modifies the position of the needle.
-\snippet examples/declarative/ui-components/dialcontrol/Dial.qml needle angle
+\snippet examples/declarative/ui-components/dialcontrol/content/Dial.qml needle angle
This is part of the \c needleRotation that rotates the needle and causes the
rotation of its shadow. \l SpringAnimation is an element that modifies the value
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index baa30fc..44658bc 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1079,27 +1079,27 @@
\target BLD_INF_RULES
\section1 BLD_INF_RULES
-
+
\e {This is only used on the Symbian platform.}
-
+
Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables.
The section of \c bld.inf file where each rule goes is appended to
\c BLD_INF_RULES with a dot.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 146
-
+
This will add the specified statements to the \c prj_exports section of the
generated \c bld.inf file.
-
+
It is also possible to add multiple rows in a single block. Each double
quoted string will be placed on a new row in the generated \c bld.inf file.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 143
-
+
Any rules you define will be added after automatically generated
rules in each section.
@@ -1274,7 +1274,7 @@
the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable.
These options only have an effect on the Symbian platform:
-
+
\table 95%
\header \o Option \o Description
\row \o stdbinary \o Builds an Open C binary (i.e. STDDLL, STDEXE, or STDLIB,
@@ -1286,7 +1286,7 @@
Note that this only affects automatically generated bld.inf content;
the content added via \c BLD_INF_RULES variable is not affected.
\endtable
-
+
These options have an effect on Linux/Unix platforms:
\table 95%
@@ -1353,7 +1353,7 @@
The default deployment target path for Windows CE is
\c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
\c{\Program Files\target}. For the Symbian platform, the default target
-is the application private directory on the drive it is installed to.
+ is the application private directory on the drive it is installed to.
It is also possible to specify multiple \c sources to be deployed on
target \c paths. In addition, different variables can be used for
@@ -1366,7 +1366,7 @@ is the application private directory on the drive it is installed to.
\note In Windows CE all linked Qt libraries will be deployed to the path
specified by \c{myFiles.path}. On Symbian platform all libraries and executables
will always be deployed to the \\sys\\bin of the installation drive.
-
+
Since the Symbian platform build system automatically moves binaries to certain
directories under the epoc32 directory, custom plugins, executables or
dynamically loadable libraries need special handling. When deploying
@@ -1389,7 +1389,7 @@ is the application private directory on the drive it is installed to.
\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:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
@@ -1397,7 +1397,7 @@ is the application private directory on the drive it is installed to.
Please note that \c pkg_prerules can also replace default statements in
pkg file. If no pkg_prerules is defined, qmake makes sure that PKG file
syntax is correct and it contains all mandatory statements such as:
-
+
\list
\o languages, for example \BR
&EN,FR
@@ -1407,7 +1407,7 @@ is the application private directory on the drive it is installed to.
%{"Vendor-EN", ..., "Vendor-FR"}
:"Unique vendor name"
\endlist
-
+
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
@@ -1419,7 +1419,7 @@ is the application private directory on the drive it is installed to.
- e.g. if a specific device is required to run the application or
more languages need to be supported by the package file. The supported
\c default_deployment rules that can be disabled are:
-
+
\list
\o pkg_depends_qt
\o pkg_depends_webkit
@@ -1427,9 +1427,9 @@ is the application private directory on the drive it is installed to.
\endlist
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141
-
+
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
@@ -1454,10 +1454,10 @@ is the application private directory on the drive it is installed to.
\note In Windows CE, No plugins will be deployed automatically.
If the application depends on plugins, these plugins have to be specified
manually.
-
+
\note On the Symbian platform, all plugins supported by this variable
-will be deployed by default with Qt libraries, so generally using this
-variable is not needed.
+ will be deployed by default with Qt libraries, so generally using this
+ variable is not needed.
For example:
@@ -1561,14 +1561,14 @@ variable is not needed.
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 34
See also \l{#SOURCES}{SOURCES}.
-
+
\target ICON
\section1 ICON
-
+
This variable is used only in MAC and the Symbian platform to set the application icon.
Please see \l{Setting the Application Icon}{the application icon documentation}
for more information.
-
+
\target INCLUDEPATH
\section1 INCLUDEPATH
@@ -1657,7 +1657,7 @@ variable is not needed.
file name suffix.
\bold{Note:} On the Symbian platform, the build system makes a
-distinction between shared and
+ distinction between shared and
static libraries. In most cases, qmake will figure out which library you
are refering to, but in some cases you may have to specify it explicitly to
get the expected behavior. This typically happens if you are building a
@@ -1702,28 +1702,28 @@ distinction between shared and
\target MMP_RULES
\section1 MMP_RULES
-
+
\e {This is only used on the Symbian platform.}
-
+
Generic MMP file content can be specified with this variable.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 137
-
+
This will add the specified statement to the end of the generated MMP file.
-
+
It is also possible to add multiple rows in a single block. Each double
quoted string will be placed on a new row in the generated MMP file.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 138
-
+
If you need to include a hash (\c{#}) character inside the
\c MMP_RULES statement, it can be done with the variable
\c LITERAL_HASH as follows:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 139
There is also a convenience function for adding conditional rules
@@ -2031,8 +2031,8 @@ distinction between shared and
respectively.
\bold{Note:} On the Symbian platform, this variable can be used to pass
-architecture specific options to each compiler in the Symbian build system.
-For example:
+ architecture specific options to each compiler in the Symbian build system.
+ For example:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131
@@ -2374,10 +2374,10 @@ For example:
\section1 QMAKE_LFLAGS_RPATH
\e {This is used on Unix platforms only.}
-
+
Library paths in this definition are added to the executable at link
time so that the added paths will be preferentially searched at runtime.
-
+
\section1 QMAKE_LFLAGS_QT_DLL
This variable contains link flags when building programs that
@@ -2716,7 +2716,7 @@ For example:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 45
\section1 QMAKE_RPATH
-
+
\e {This is used on Unix platforms only.}
Is equivalent to \l QMAKE_LFLAGS_RPATH.
@@ -2870,30 +2870,30 @@ For example:
This variable contains the name of the resource file for the application.
The value of this variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
-
+
\target RSS_RULES
\section1 RSS_RULES
-
+
\e {This is only used on the Symbian platform.}
-
+
Generic RSS file content can be specified with this variable. The syntax is
similar to \c MMP_RULES and \c BLD_INF_RULES.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 144
-
+
This will add the specified statement to the end of the \c APP_REGISTRATION_INFO
resource struct in the generated registration resource file.
As an impact of this statement, the application will not be visible in application shell.
-
+
It is also possible to add multiple rows in a single block. Each double
quoted string will be placed on a new row in the registration resource file.
-
+
For example:
-
+
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145
-
+
This example will install the application to MyFolder in the Symbian
platform application shell. In addition it will make the application to
be launched in background.
@@ -2933,7 +2933,7 @@ For example:
\section1 S60_VERSION
\e {This is only used on the Symbian platform.}
-
+
Contains the version number of the underlying S60 SDK; e.g. "5.0".
\target SIGNATURE_FILE
@@ -2969,8 +2969,9 @@ For example:
\section1 SUBDIRS
This variable, when used with the \l{#TEMPLATE}{\c subdirs template}
- contains the names of all subdirectories that contain parts of the project
- that need be built. Each subdirectory must contain its own project file.
+ contains the names of all subdirectories or project files that contain
+ parts of the project that need be built. Each subdirectory specified
+ using this variable must contain its own project file.
For example:
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index b140562..745baa3 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -230,7 +230,7 @@
*/
/*!
- \title Internationlization Example
+ \title Internationalization Example
\example declarative/i18n
This example shows how to enable text translation in QML.
@@ -375,7 +375,7 @@
\title Models and Views: WebView Example
\example declarative/modelviews/webview
- These examples shows how to use the WebView element.
+ These examples show how to use the WebView element.
\table
\row
diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc
index 405e791..6cef316 100644
--- a/doc/src/getting-started/gettingstartedqml.qdoc
+++ b/doc/src/getting-started/gettingstartedqml.qdoc
@@ -296,8 +296,8 @@
\section2 Using Data Models and Views
- QML has different \l {Data Models}{data views} that display
- \l {Data Models}{data models}. Our menu bar will display the menus in a list,
+ QML has different \l{QML Data Models}{data views} that display
+ \l{QML Data Models}{data models}. Our menu bar will display the menus in a list,
with a header that displays a row of menu names. The list of menus are declared
inside a \c VisualItemModel. The \l{VisualItemModel}{\c VisualItemModel}
element contains items that already have views such as \c Rectangle elements
@@ -812,11 +812,11 @@
The \c files list property is a list of all the filtered files in a directory.
The \c Directory class is implemented to filter out invalid text files; only
- files with a \c .txt extension are valid. Further, \l {QLists}{QLists} can be
- used in QML files by declaring them as a \c QDeclarativeListProperty in C++.
- The templated object needs to inherit from a \l {QObject}{QObject}, therefore,
- the \c File class must also inherit from \c QObject. In the \c Directory class,
- the list of \c File objects is stored in a \c QList called \c m_fileList.
+ files with a \c .txt extension are valid. Further, \l{QList}s can be
+ used in QML files by declaring them as a QDeclarativeListProperty in C++.
+ The templated object needs to inherit from a QObject, therefore,
+ the \c File class must also inherit from QObject. In the \c Directory class,
+ the list of \c File objects is stored in a QList called \c m_fileList.
\code
class File : public QObject{
diff --git a/doc/src/images/qml-borderimage-normal-image.png b/doc/src/images/qml-borderimage-normal-image.png
new file mode 100644
index 0000000..ae7460a
--- /dev/null
+++ b/doc/src/images/qml-borderimage-normal-image.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-scaled.png b/doc/src/images/qml-borderimage-scaled.png
new file mode 100644
index 0000000..8035c79
--- /dev/null
+++ b/doc/src/images/qml-borderimage-scaled.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-tiled.png b/doc/src/images/qml-borderimage-tiled.png
new file mode 100644
index 0000000..14883d0
--- /dev/null
+++ b/doc/src/images/qml-borderimage-tiled.png
Binary files differ
diff --git a/doc/src/images/qml-flow-snippet.png b/doc/src/images/qml-flow-snippet.png
new file mode 100644
index 0000000..af873d1
--- /dev/null
+++ b/doc/src/images/qml-flow-snippet.png
Binary files differ
diff --git a/doc/src/images/qml-flow-text1.png b/doc/src/images/qml-flow-text1.png
new file mode 100644
index 0000000..99ce752
--- /dev/null
+++ b/doc/src/images/qml-flow-text1.png
Binary files differ
diff --git a/doc/src/images/qml-flow-text2.png b/doc/src/images/qml-flow-text2.png
new file mode 100644
index 0000000..844e0de
--- /dev/null
+++ b/doc/src/images/qml-flow-text2.png
Binary files differ
diff --git a/doc/src/images/qml-grid-no-spacing.png b/doc/src/images/qml-grid-no-spacing.png
new file mode 100644
index 0000000..c2092e0
--- /dev/null
+++ b/doc/src/images/qml-grid-no-spacing.png
Binary files differ
diff --git a/doc/src/images/qml-grid-spacing.png b/doc/src/images/qml-grid-spacing.png
new file mode 100644
index 0000000..1083bee
--- /dev/null
+++ b/doc/src/images/qml-grid-spacing.png
Binary files differ
diff --git a/doc/src/images/qml-listview-snippet.png b/doc/src/images/qml-listview-snippet.png
new file mode 100644
index 0000000..0ee0ffc
--- /dev/null
+++ b/doc/src/images/qml-listview-snippet.png
Binary files differ
diff --git a/doc/src/images/qml-repeater-grid-index.png b/doc/src/images/qml-repeater-grid-index.png
new file mode 100644
index 0000000..44aed24
--- /dev/null
+++ b/doc/src/images/qml-repeater-grid-index.png
Binary files differ
diff --git a/doc/src/images/qml-row.png b/doc/src/images/qml-row.png
new file mode 100644
index 0000000..30d9caa
--- /dev/null
+++ b/doc/src/images/qml-row.png
Binary files differ
diff --git a/doc/src/snippets/declarative/anchoranimation.qml b/doc/src/snippets/declarative/anchoranimation.qml
index 6c7aaf6..9a7b8ff 100644
--- a/doc/src/snippets/declarative/anchoranimation.qml
+++ b/doc/src/snippets/declarative/anchoranimation.qml
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
//![0]
import Qt 4.7
diff --git a/doc/src/snippets/declarative/anchorchanges.qml b/doc/src/snippets/declarative/anchorchanges.qml
index 993618b..3f11421 100644
--- a/doc/src/snippets/declarative/anchorchanges.qml
+++ b/doc/src/snippets/declarative/anchorchanges.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/animatedimage.qml b/doc/src/snippets/declarative/animatedimage.qml
new file mode 100644
index 0000000..bf5d611
--- /dev/null
+++ b/doc/src/snippets/declarative/animatedimage.qml
@@ -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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+// This snippet should be turned into an example and put in
+// examples/declarative/imageelements/animatedimage
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: animation.width; height: animation.height + 8
+
+ AnimatedImage { id: animation; source: "animation.gif" }
+
+ Rectangle {
+ property int frames: animation.frameCount
+
+ width: 4; height: 8
+ x: (animation.width - width) * animation.currentFrame / frames
+ y: animation.height
+ color: "red"
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/behavior.qml b/doc/src/snippets/declarative/behavior.qml
index 420dfc4..4260e38 100644
--- a/doc/src/snippets/declarative/behavior.qml
+++ b/doc/src/snippets/declarative/behavior.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/borderimage.qml b/doc/src/snippets/declarative/borderimage/borderimage-scaled.qml
index 447ad92..cc3ae2f 100644
--- a/doc/src/snippets/declarative/borderimage.qml
+++ b/doc/src/snippets/declarative/borderimage/borderimage-scaled.qml
@@ -43,27 +43,39 @@ import Qt 4.7
Rectangle {
id: page
color: "white"
- width: 520; height: 280
+ width: 180; height: 180
- Row {
- anchors.centerIn: parent
- spacing: 50
-//! [0]
+//! [scaled border image]
BorderImage {
width: 180; height: 180
border { left: 30; top: 30; right: 30; bottom: 30 }
horizontalTileMode: BorderImage.Stretch
verticalTileMode: BorderImage.Stretch
- source: "content/colors.png"
+ source: "pics/borderframe.png"
}
+//! [scaled border image]
-BorderImage {
- width: 180; height: 180
- border { left: 30; top: 30; right: 30; bottom: 30 }
- horizontalTileMode: BorderImage.Round
- verticalTileMode: BorderImage.Round
- source: "content/colors.png"
-}
-//! [0]
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 150; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 180; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 150
+ width: 180; height: 1
+ color: "gray"
}
}
diff --git a/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml b/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml
new file mode 100644
index 0000000..e792814
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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 Qt 4.7
+
+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 }
+ horizontalTileMode: BorderImage.Repeat
+ verticalTileMode: BorderImage.Repeat
+ source: "pics/borderframe.png"
+}
+//! [tiled border image]
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 150; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 180; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 150
+ width: 180; height: 1
+ color: "gray"
+ }
+}
diff --git a/doc/src/snippets/declarative/borderimage/normal-image.qml b/doc/src/snippets/declarative/borderimage/normal-image.qml
new file mode 100644
index 0000000..76ec6e2
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/normal-image.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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 Qt 4.7
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 120; height: 120
+
+//! [normal image]
+Image {
+ source: "pics/borderframe.png"
+}
+//! [normal image]
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 90; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 200; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 90
+ width: 200; height: 1
+ color: "gray"
+ }
+}
diff --git a/doc/src/snippets/declarative/borderimage/pics/borderframe.png b/doc/src/snippets/declarative/borderimage/pics/borderframe.png
new file mode 100644
index 0000000..97a9452
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/pics/borderframe.png
Binary files differ
diff --git a/doc/src/snippets/declarative/borderimage/pics/borderframe.svg b/doc/src/snippets/declarative/borderimage/pics/borderframe.svg
new file mode 100644
index 0000000..9286c82
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/pics/borderframe.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="borderframe.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="219.40254"
+ inkscape:cy="802.84271"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1226"
+ inkscape:window-height="668"
+ inkscape:window-x="220"
+ inkscape:window-y="284">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ spacingx="1px"
+ spacingy="1px" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;stroke-dasharray:none"
+ d="M 120,102.36218 C 120,77.362186 145,77.362186 145,102.36218 L 195,102.36218 L 220,77.362186 L 245,102.36218 L 295,102.36218 C 295,77.362186 320,77.362186 320,102.36218 C 345,102.36218 345,127.36218 320,127.36218 L 320,177.36218 L 345,202.36218 L 320,227.36218 L 320,277.36218 C 345,277.36218 345,302.36218 320,302.36218 C 320,327.36218 295,327.36218 295,302.36218 L 245,302.36218 L 220,327.36218 L 195,302.36218 L 145,302.36218 C 145,327.36218 120,327.36218 120,302.36218 C 95,302.36218 95,277.36218 120,277.36218 L 120,227.36218 L 95,202.36218 L 120,177.36218 L 120,127.36218 C 95,127.36218 95,102.36218 120,102.36218 z"
+ id="rect2387"
+ sodipodi:nodetypes="ccccccccccccccccccccccccc" />
+ <path
+ sodipodi:nodetypes="ccccccccccccccccccccccccc"
+ id="path3160"
+ d="M 130,112.3622 C 130,89.862207 130,92.362183 140,112.36218 L 197.5,112.3622 L 220,89.862207 L 242.5,112.3622 L 300,112.36218 C 310,92.362183 310,89.862207 310,112.3622 C 332.5,112.3622 330,112.36218 310,122.36218 L 310,179.8622 L 332.5,202.3622 L 310,224.8622 L 310,282.36218 C 330,292.36218 332.5,292.3622 310,292.3622 C 310,314.8622 310,312.36218 300,292.36218 L 242.5,292.3622 L 220,314.8622 L 197.5,292.3622 L 140,292.36218 C 130,312.36218 130,314.8622 130,292.3622 C 107.5,292.3622 110,292.36218 130,282.36218 L 130,224.8622 L 107.5,202.3622 L 130,179.8622 L 130,122.36218 C 110,112.36218 107.5,112.3622 130,112.3622 z"
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/coloranimation.qml b/doc/src/snippets/declarative/coloranimation.qml
index 4e35f22..7e8e9fe 100644
--- a/doc/src/snippets/declarative/coloranimation.qml
+++ b/doc/src/snippets/declarative/coloranimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/column/column.qml b/doc/src/snippets/declarative/column/column.qml
new file mode 100644
index 0000000..e372cfd
--- /dev/null
+++ b/doc/src/snippets/declarative/column/column.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Item {
+ width: 310; height: 170
+
+ Column {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 5
+
+ Rectangle { color: "lightblue"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.fill: parent
+ font.pointSize: 32; text: "Books" } }
+ Rectangle { color: "gold"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.fill: parent
+ font.pointSize: 32; text: "Music" } }
+ Rectangle { color: "lightgreen"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.fill: parent
+ font.pointSize: 32; text: "Movies" } }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/column/vertical-positioner-transition.qml b/doc/src/snippets/declarative/column/vertical-positioner-transition.qml
new file mode 100644
index 0000000..7785776
--- /dev/null
+++ b/doc/src/snippets/declarative/column/vertical-positioner-transition.qml
@@ -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$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+//! [document]
+Column {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { id: rect1; color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+
+ //![transitions]
+ add: Transition {
+ NumberAnimation { properties: "opacity"; duration: 1000 }
+ }
+ //![transitions]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect1.opacity = 0
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/column/vertical-positioner.qml b/doc/src/snippets/declarative/column/vertical-positioner.qml
new file mode 100644
index 0000000..27b09c1
--- /dev/null
+++ b/doc/src/snippets/declarative/column/vertical-positioner.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 QtDeclarative module 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 Qt 4.7
+
+//! [document]
+Column {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/component.qml b/doc/src/snippets/declarative/component.qml
index 09c4aa2..a0ab28c 100644
--- a/doc/src/snippets/declarative/component.qml
+++ b/doc/src/snippets/declarative/component.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/flickable.qml b/doc/src/snippets/declarative/flickable.qml
new file mode 100644
index 0000000..d7a163b
--- /dev/null
+++ b/doc/src/snippets/declarative/flickable.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Flickable {
+ width: 200; height: 200
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "bigImage.png" }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/flipable.qml b/doc/src/snippets/declarative/flipable/flipable.qml
index c2ecbbe..c2ecbbe 100644
--- a/doc/src/snippets/declarative/flipable.qml
+++ b/doc/src/snippets/declarative/flipable/flipable.qml
diff --git a/doc/src/snippets/declarative/flow-diagram.qml b/doc/src/snippets/declarative/flow-diagram.qml
new file mode 100644
index 0000000..80506b9
--- /dev/null
+++ b/doc/src/snippets/declarative/flow-diagram.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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 Qt 4.7
+
+Rectangle {
+ color: "lightblue"
+ width: 300; height: 200
+
+//! [flow item]
+ Flow {
+ anchors.fill: parent
+ anchors.margins: 4
+ spacing: 10
+
+ Repeater {
+ id: repeater
+ model: {
+ var strings = ["Text", "items", "flowing", "inside", "a",
+ "Flow", "item"];
+ strings;
+ }
+
+ Rectangle {
+ color: "white"
+ width: textItem.width + 4
+ height: textItem.height + 4
+ Text {
+ id: textItem
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: repeater.model[index]
+ font.pixelSize: 40
+ }
+ }
+ }
+ }
+//! [flow item]
+}
diff --git a/doc/src/snippets/declarative/flow.qml b/doc/src/snippets/declarative/flow.qml
new file mode 100644
index 0000000..77db683
--- /dev/null
+++ b/doc/src/snippets/declarative/flow.qml
@@ -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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ color: "lightblue"
+ width: 300; height: 200
+
+//! [flow item]
+ Flow {
+ anchors.fill: parent
+ anchors.margins: 4
+ spacing: 10
+
+ Text { text: "Text"; font.pixelSize: 40 }
+ Text { text: "items"; font.pixelSize: 40 }
+ Text { text: "flowing"; font.pixelSize: 40 }
+ Text { text: "inside"; font.pixelSize: 40 }
+ Text { text: "a"; font.pixelSize: 40 }
+ Text { text: "Flow"; font.pixelSize: 40 }
+ Text { text: "item"; font.pixelSize: 40 }
+ }
+//! [flow item]
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/grid/grid-items.qml b/doc/src/snippets/declarative/grid/grid-items.qml
new file mode 100644
index 0000000..5099758
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-items.qml
@@ -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 QtDeclarative module 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 Qt 4.7
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-no-spacing.qml b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
new file mode 100644
index 0000000..f04c242
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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 Qt 4.7
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-spacing.qml b/doc/src/snippets/declarative/grid/grid-spacing.qml
new file mode 100644
index 0000000..8715977
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-spacing.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/grid/grid.qml b/doc/src/snippets/declarative/grid/grid.qml
new file mode 100644
index 0000000..d57b4b2
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Grid {
+ columns: 3
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+ Rectangle { color: "cyan"; width: 50; height: 50 }
+ Rectangle { color: "magenta"; width: 10; height: 10 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/image.qml b/doc/src/snippets/declarative/image.qml
new file mode 100644
index 0000000..42efb8f
--- /dev/null
+++ b/doc/src/snippets/declarative/image.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Image {
+ source: "pics/qtlogo.png"
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/listmodel-modify.qml b/doc/src/snippets/declarative/listmodel-modify.qml
index 03fb314..8f381f7 100644
--- a/doc/src/snippets/declarative/listmodel-modify.qml
+++ b/doc/src/snippets/declarative/listmodel-modify.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/listmodel-nested.qml b/doc/src/snippets/declarative/listmodel-nested.qml
index 4ae43ff..3d876a3 100644
--- a/doc/src/snippets/declarative/listmodel-nested.qml
+++ b/doc/src/snippets/declarative/listmodel-nested.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/listmodel-simple.qml b/doc/src/snippets/declarative/listmodel-simple.qml
index 00b8cb0..382fd13 100644
--- a/doc/src/snippets/declarative/listmodel-simple.qml
+++ b/doc/src/snippets/declarative/listmodel-simple.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/listview/listview-snippet.qml b/doc/src/snippets/declarative/listview/listview-snippet.qml
new file mode 100644
index 0000000..c510472
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/listview-snippet.qml
@@ -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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+ListView {
+ width: 50; height: 200
+ model: 4
+ delegate: Text {
+ text: index;
+ font.pixelSize: 40
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/numberanimation.qml b/doc/src/snippets/declarative/numberanimation.qml
index 57d23b1..0a1d5a4 100644
--- a/doc/src/snippets/declarative/numberanimation.qml
+++ b/doc/src/snippets/declarative/numberanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/parallelanimation.qml b/doc/src/snippets/declarative/parallelanimation.qml
index d823b4f..a8e80cd 100644
--- a/doc/src/snippets/declarative/parallelanimation.qml
+++ b/doc/src/snippets/declarative/parallelanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/parentanimation.qml b/doc/src/snippets/declarative/parentanimation.qml
index 7f11a43..506eff4 100644
--- a/doc/src/snippets/declarative/parentanimation.qml
+++ b/doc/src/snippets/declarative/parentanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/parentchange.qml b/doc/src/snippets/declarative/parentchange.qml
index ea50832..c704f12 100644
--- a/doc/src/snippets/declarative/parentchange.qml
+++ b/doc/src/snippets/declarative/parentchange.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/pics/qtlogo.png b/doc/src/snippets/declarative/pics/qtlogo.png
new file mode 100644
index 0000000..4f68e16
--- /dev/null
+++ b/doc/src/snippets/declarative/pics/qtlogo.png
Binary files differ
diff --git a/doc/src/snippets/declarative/propertyaction.qml b/doc/src/snippets/declarative/propertyaction.qml
index 1a15469..ff299f1 100644
--- a/doc/src/snippets/declarative/propertyaction.qml
+++ b/doc/src/snippets/declarative/propertyaction.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/propertyanimation.qml b/doc/src/snippets/declarative/propertyanimation.qml
index 059cde5..55ea9f6 100644
--- a/doc/src/snippets/declarative/propertyanimation.qml
+++ b/doc/src/snippets/declarative/propertyanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/propertychanges.qml b/doc/src/snippets/declarative/propertychanges.qml
index 9f119bf..5959e54 100644
--- a/doc/src/snippets/declarative/propertychanges.qml
+++ b/doc/src/snippets/declarative/propertychanges.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml b/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml
new file mode 100644
index 0000000..72e27f3
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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 Qt 4.7
+
+Item {
+ width: 200; height: 250
+
+ //! [model]
+ ListModel { id: fruitModel }
+ //! [model]
+
+ //! [view]
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: Row {
+ Text { text: "Fruit: " + name }
+ Text { text: "Cost: $" + cost }
+ }
+ }
+ //! [view]
+
+ //! [mouse area]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
+ }
+ //! [mouse area]
+}
diff --git a/doc/src/snippets/declarative/qml-data-models/listelements.qml b/doc/src/snippets/declarative/qml-data-models/listelements.qml
new file mode 100644
index 0000000..d9cea81
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/listelements.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Item {
+ width: 200; height: 250
+
+ //! [model]
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+ }
+ //! [model]
+
+ //! [view]
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: Row {
+ Text { text: "Fruit: " + name }
+ Text { text: "Cost: $" + cost }
+ }
+ }
+ //! [view]
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml b/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml
new file mode 100644
index 0000000..92107f1
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml
@@ -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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Item {
+ width: 200; height: 250
+
+ ListModel {
+ id: myModel
+ ListElement { type: "Dog"; age: 8 }
+ ListElement { type: "Cat"; age: 5 }
+ }
+
+ Component {
+ id: myDelegate
+ Text { text: type + ", " + age }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: myModel
+ delegate: myDelegate
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/inline-component.qml b/doc/src/snippets/declarative/qml-documents/inline-component.qml
new file mode 100644
index 0000000..9233bbf
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/inline-component.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Component {
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/inline-text-component.qml b/doc/src/snippets/declarative/qml-documents/inline-text-component.qml
new file mode 100644
index 0000000..83ba213
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/inline-text-component.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/non-trivial.qml b/doc/src/snippets/declarative/qml-documents/non-trivial.qml
new file mode 100644
index 0000000..eb2364b
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/non-trivial.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 240; height: 320;
+
+ resources: [
+ Component {
+ id: contactDelegate
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ ]
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: contactDelegate
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/qmldocuments.qml b/doc/src/snippets/declarative/qml-documents/qmldocuments.qml
new file mode 100644
index 0000000..cd0a1f7
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/qmldocuments.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ property alias text: textItem.text
+
+ width: 100; height: 30
+ border.width: 1
+ radius: 5
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "darkGray" }
+ GradientStop { position: 0.5; color: "black" }
+ GradientStop { position: 1.0; color: "darkGray" }
+ }
+
+ Text {
+ id: textItem
+ anchors.centerIn: parent
+ font.pointSize: 20
+ color: "white"
+ }
+
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-intro/anchors1.qml b/doc/src/snippets/declarative/qml-intro/anchors1.qml
index 09ef3b2..c1158b8 100644
--- a/doc/src/snippets/declarative/qml-intro/anchors1.qml
+++ b/doc/src/snippets/declarative/qml-intro/anchors1.qml
@@ -48,7 +48,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 150; height: 150
anchors.bottom: myWin.bottom
}
diff --git a/doc/src/snippets/declarative/qml-intro/anchors2.qml b/doc/src/snippets/declarative/qml-intro/anchors2.qml
index ef0ec1f..a7d4922 100644
--- a/doc/src/snippets/declarative/qml-intro/anchors2.qml
+++ b/doc/src/snippets/declarative/qml-intro/anchors2.qml
@@ -48,7 +48,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 150; height: 150
anchors.bottom: myWin.bottom
anchors.horizontalCenter: myWin.horizontalCenter
diff --git a/doc/src/snippets/declarative/qml-intro/anchors3.qml b/doc/src/snippets/declarative/qml-intro/anchors3.qml
index 008ad1a..a2e0f03 100644
--- a/doc/src/snippets/declarative/qml-intro/anchors3.qml
+++ b/doc/src/snippets/declarative/qml-intro/anchors3.qml
@@ -47,7 +47,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 150; height: 150
anchors.bottom: myWin.bottom
anchors.horizontalCenter: myWin.horizontalCenter
diff --git a/doc/src/snippets/declarative/qml-intro/hello-world4.qml b/doc/src/snippets/declarative/qml-intro/hello-world4.qml
index c18fe15..9656ff8 100644
--- a/doc/src/snippets/declarative/qml-intro/hello-world4.qml
+++ b/doc/src/snippets/declarative/qml-intro/hello-world4.qml
@@ -53,7 +53,7 @@ Rectangle {
//! [added an image]
Image {
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
}
//! [added an image]
diff --git a/doc/src/snippets/declarative/qml-intro/hello-world5.qml b/doc/src/snippets/declarative/qml-intro/hello-world5.qml
index bde8dc3..b816e09 100644
--- a/doc/src/snippets/declarative/qml-intro/hello-world5.qml
+++ b/doc/src/snippets/declarative/qml-intro/hello-world5.qml
@@ -54,7 +54,7 @@ Rectangle {
//! [positioning the image]
Image {
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
x: 100; y: 150
width: 150; height: 150
}
diff --git a/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
new file mode 100644
index 0000000..8c018be
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ clip-rule="evenodd"
+ stroke-miterlimit="10"
+ viewBox="0 0 174.35 209.78"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="744.09186"
+ height="895.29858"
+ sodipodi:docname="qt-logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0"
+ style="stroke-miterlimit:10">
+ <metadata
+ id="metadata29">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="668"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.12195802"
+ inkscape:cx="525.6108"
+ inkscape:cy="-287.87189"
+ inkscape:window-x="476"
+ inkscape:window-y="228"
+ inkscape:current-layer="svg2" />
+ <desc
+ id="desc4">SVG generated by Lineform</desc>
+ <defs
+ id="defs6">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective31" />
+ </defs>
+ <g
+ id="g8"
+ transform="translate(-1.5304326e-4,-3.775985e-4)">
+ <path
+ d="M 43.08,0.36 C 40.94,0 38.84,-0.08 36.81,0.08 L 36.8,0.08 C 36.8,0.08 22.92,1.02 22.29,1.07 C 9.62,2.08 0,12.5 0,26.89 L 0,196.55 L 14.19,209.78 L 156.79,185.81 C 166.6,184.11 174.35,172.54 174.35,160.04 L 174.35,21.88 L 43.08,0.36"
+ id="path10"
+ style="fill:#0c481e" />
+ <path
+ d="M 174.35,160.04 C 174.35,172.54 166.6,184.11 156.79,185.82 L 14.19,209.78 L 14.19,25.99 C 14.19,9.27 27.53,-2.21 43.08,0.36 L 174.35,21.88 L 174.35,160.04"
+ id="path12"
+ style="fill:#66b036" />
+ <path
+ d="M 130.42,45.91 L 141.94,47.15 L 141.94,67.36 L 154.9,68.28 L 154.9,80.96 L 141.94,80.36 L 141.94,126.69 C 141.94,130.72 142.38,133.31 143.28,134.48 C 144.08,135.55 145.32,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 155.83,145.4 C 150.69,147.65 145.65,149 140.7,149.42 C 139.99,149.47 139.29,149.5 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 125.65,66.22 L 130.42,45.91"
+ id="path14"
+ style="fill:#ffffff" />
+ <path
+ d="M 154.9,80.96 L 141.94,80.36 L 141.94,80.64 L 148.88,80.96 L 154.9,80.96"
+ id="path16"
+ style="fill:#0c481e" />
+ <path
+ d="M 144.64,135.6 C 145.3,135.92 146.07,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 149.81,133.75 C 147.99,134.58 146.28,135.21 144.64,135.6"
+ id="path18"
+ style="fill:#0c481e" />
+ <path
+ d="M 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 112.05,65.67 L 112.05,68.71 C 112.92,71.98 113.6,75.53 114.11,79.35 L 118.28,79.54 L 118.28,130.9 C 118.28,137.62 119.64,142.52 122.37,145.57 C 124.71,148.2 128.13,149.5 132.61,149.5 L 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 z M 130.42,45.91 L 124.41,45.91 L 119.74,65.79 L 125.65,66.22 L 130.42,45.91"
+ id="path20"
+ style="fill:#0c481e" />
+ <path
+ d="M 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 75.26,54.23 71.92,56.77 69.59,61.86 C 67.07,67.4 65.8,78.9 65.8,96.3 C 65.8,113.11 67.04,125.05 69.54,132.05 C 71.89,138.72 75.41,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 M 109.13,136.15 C 105.01,145.86 98.73,152.21 90.14,155.15 C 91.01,159.6 92.32,162.6 94.06,164.17 C 95.41,165.39 97.49,165.99 100.28,165.99 C 101.09,165.99 101.96,165.94 102.87,165.84 L 102.87,178.96 L 96.91,179.75 C 95.16,179.97 93.49,180.09 91.91,180.09 C 86.69,180.09 82.47,178.82 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 77.24,38.78 78.93,38.88 80.66,39.08 C 92.61,40.46 101.28,46.1 106.92,55.87 C 112.46,65.43 115.17,79.14 115.17,97.13 C 115.17,113.62 113.17,126.58 109.13,136.15"
+ id="path22"
+ style="fill:#ffffff" />
+ <path
+ d="M 100.28,165.99 C 101.09,165.99 101.95,165.94 102.87,165.84 L 98.04,165.84 C 98.71,165.94 99.49,165.99 100.28,165.99"
+ id="path24"
+ style="fill:#0c481e" />
+ <path
+ d="M 84.85,63.98 C 87.19,69.97 88.34,80.9 88.34,96.79 C 88.34,114.49 87.18,126.36 84.82,132.4 C 82.93,137.28 80.3,140.31 76.96,141.48 C 77.93,141.84 78.96,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 78.51,54.23 77.48,54.39 76.52,54.72 L 76.52,54.72 C 80.12,55.83 82.89,58.93 84.85,63.98 z M 82.51,178.25 C 82.4,178.2 82.28,178.15 82.17,178.09 C 82.16,178.09 82.15,178.08 82.14,178.08 C 82.03,178.03 81.93,177.97 81.83,177.92 C 81.81,177.91 81.79,177.9 81.77,177.89 C 81.68,177.84 81.59,177.79 81.49,177.74 C 81.46,177.72 81.44,177.71 81.41,177.69 C 81.33,177.65 81.24,177.6 81.16,177.55 C 81.12,177.53 81.09,177.51 81.05,177.48 C 80.98,177.44 80.91,177.4 80.84,177.36 C 80.79,177.33 80.74,177.3 80.7,177.27 C 80.64,177.23 80.58,177.19 80.52,177.15 C 80.46,177.12 80.41,177.08 80.35,177.04 C 80.3,177.01 80.25,176.98 80.2,176.94 C 80.14,176.9 80.07,176.85 80.01,176.81 C 79.97,176.78 79.93,176.75 79.89,176.72 C 79.82,176.67 79.74,176.61 79.67,176.55 C 79.64,176.54 79.61,176.52 79.59,176.5 C 79.49,176.42 79.39,176.34 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 75.65,38.78 69.27,38.77 69.27,38.77 L 69.27,38.78 C 59.12,38.78 51.05,42.75 45.27,50.81 C 38.41,60.38 34.92,75.46 34.92,95.89 C 34.92,114.83 37.47,129.32 42.47,139.23 C 47.41,148.97 54.53,154.78 63.67,156.73 C 65.65,166.37 68.76,172.89 72.96,176.26 C 76.14,178.82 80.36,180.09 85.58,180.09 C 85.68,180.09 85.78,180.09 85.88,180.09 L 91.42,180.09 C 88.01,180.03 85.04,179.43 82.52,178.26 C 82.51,178.26 82.51,178.26 82.51,178.25"
+ id="path26"
+ style="fill:#0c481e" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/qml-intro/number-animation1.qml b/doc/src/snippets/declarative/qml-intro/number-animation1.qml
index 8d8d747..7b405e4 100644
--- a/doc/src/snippets/declarative/qml-intro/number-animation1.qml
+++ b/doc/src/snippets/declarative/qml-intro/number-animation1.qml
@@ -48,7 +48,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
x: 200; y: 100
width: 100; height: 100
diff --git a/doc/src/snippets/declarative/qml-intro/number-animation2.qml b/doc/src/snippets/declarative/qml-intro/number-animation2.qml
index d556c21..f109f76 100644
--- a/doc/src/snippets/declarative/qml-intro/number-animation2.qml
+++ b/doc/src/snippets/declarative/qml-intro/number-animation2.qml
@@ -48,7 +48,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
x: 200; y: 100
width: 100; height: 100
diff --git a/doc/src/snippets/declarative/qml-intro/sequential-animation1.qml b/doc/src/snippets/declarative/qml-intro/sequential-animation1.qml
index e68de20..7ae2fde 100644
--- a/doc/src/snippets/declarative/qml-intro/sequential-animation1.qml
+++ b/doc/src/snippets/declarative/qml-intro/sequential-animation1.qml
@@ -49,14 +49,14 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
x: 20; y: 20 ; z: 1
width: 100; height: 100
}
Image {
id: image2
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 100; height: 100
x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2
z: 2
diff --git a/doc/src/snippets/declarative/qml-intro/sequential-animation2.qml b/doc/src/snippets/declarative/qml-intro/sequential-animation2.qml
index 31835a1..ac0f3f5 100644
--- a/doc/src/snippets/declarative/qml-intro/sequential-animation2.qml
+++ b/doc/src/snippets/declarative/qml-intro/sequential-animation2.qml
@@ -49,7 +49,7 @@ Rectangle {
//! [adding a sequential animation]
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 100; height: 100
SequentialAnimation on x {
@@ -65,7 +65,7 @@ Rectangle {
Image {
id: image2
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 100; height: 100
x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2
z: 2
diff --git a/doc/src/snippets/declarative/qml-intro/sequential-animation3.qml b/doc/src/snippets/declarative/qml-intro/sequential-animation3.qml
index 6926f8a..97c574b 100644
--- a/doc/src/snippets/declarative/qml-intro/sequential-animation3.qml
+++ b/doc/src/snippets/declarative/qml-intro/sequential-animation3.qml
@@ -38,6 +38,8 @@
**
****************************************************************************/
+import Qt 4.7
+
//! [document]
import Qt 4.7
@@ -49,7 +51,7 @@ Rectangle {
Image {
id: image2
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 100; height: 100
x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2
z: 2
@@ -57,7 +59,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
x: 20; y: 20 ; z: 1
width: 100; height: 100
diff --git a/doc/src/snippets/declarative/qml-intro/transformations1.qml b/doc/src/snippets/declarative/qml-intro/transformations1.qml
index af39e69..b4a1692 100644
--- a/doc/src/snippets/declarative/qml-intro/transformations1.qml
+++ b/doc/src/snippets/declarative/qml-intro/transformations1.qml
@@ -48,7 +48,7 @@ Rectangle {
Image {
id: image1
- source: "images/qt-logo.png"
+ source: "images/qt-logo.svg"
width: 150; height: 150
anchors.bottom: myWin.bottom
anchors.horizontalCenter: myWin.horizontalCenter
diff --git a/doc/src/snippets/declarative/qmldocuments.qml b/doc/src/snippets/declarative/qmldocuments.qml
deleted file mode 100644
index c19a658..0000000
--- a/doc/src/snippets/declarative/qmldocuments.qml
+++ /dev/null
@@ -1,66 +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 QtDeclarative module 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 Qt 4.7
-
-Rectangle {
- property alias text: textItem.text
-
- width: 100; height: 30
- border.width: 1
- radius: 5
- smooth: true
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: "darkGray" }
- GradientStop { position: 0.5; color: "black" }
- GradientStop { position: 1.0; color: "darkGray" }
- }
-
- Text {
- id: textItem
- anchors.centerIn: parent
- font.pointSize: 20
- color: "white"
- }
-
-}
-//![0]
diff --git a/doc/src/snippets/declarative/qtobject.qml b/doc/src/snippets/declarative/qtobject.qml
index 970fa16..bd48390 100644
--- a/doc/src/snippets/declarative/qtobject.qml
+++ b/doc/src/snippets/declarative/qtobject.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml b/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml
new file mode 100644
index 0000000..106550e
--- /dev/null
+++ b/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml
@@ -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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 400; height: 400; color: "black"
+
+ Grid {
+ x: 5; y: 5
+ rows: 5; columns: 5; spacing: 10
+
+ Repeater { model: 24
+ Rectangle { width: 70; height: 70
+ color: "lightgreen"
+
+ Text { text: index
+ font.pointSize: 30
+ anchors.centerIn: parent } }
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/repeater.qml b/doc/src/snippets/declarative/repeaters/repeater.qml
index d71fd29..d71fd29 100644
--- a/doc/src/snippets/declarative/repeater.qml
+++ b/doc/src/snippets/declarative/repeaters/repeater.qml
diff --git a/doc/src/snippets/declarative/rotationanimation.qml b/doc/src/snippets/declarative/rotationanimation.qml
index b56cb3f..a0f6354 100644
--- a/doc/src/snippets/declarative/rotationanimation.qml
+++ b/doc/src/snippets/declarative/rotationanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/row.qml b/doc/src/snippets/declarative/row.qml
new file mode 100644
index 0000000..bd2db16
--- /dev/null
+++ b/doc/src/snippets/declarative/row.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Rectangle {
+ width: 320; height: 110
+ color: "#c0c0c0"
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 5
+
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "#024c1c" }
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "#42a51c" }
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "white" }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/row/row.qml b/doc/src/snippets/declarative/row/row.qml
new file mode 100644
index 0000000..c863243
--- /dev/null
+++ b/doc/src/snippets/declarative/row/row.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 QtDeclarative module 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$
+**
+****************************************************************************/
+
+//! [document]
+import Qt 4.7
+
+Row {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/sequentialanimation.qml b/doc/src/snippets/declarative/sequentialanimation.qml
index a15f7f3..bf73be5 100644
--- a/doc/src/snippets/declarative/sequentialanimation.qml
+++ b/doc/src/snippets/declarative/sequentialanimation.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/state-when.qml b/doc/src/snippets/declarative/state-when.qml
index 6d3bb75..8e38f82 100644
--- a/doc/src/snippets/declarative/state-when.qml
+++ b/doc/src/snippets/declarative/state-when.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
index ce2653b..5f43947 100644
--- a/doc/src/snippets/declarative/state.qml
+++ b/doc/src/snippets/declarative/state.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
index 127e3a7..1f9dc2c 100644
--- a/doc/src/snippets/declarative/states.qml
+++ b/doc/src/snippets/declarative/states.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/systempalette.qml b/doc/src/snippets/declarative/systempalette.qml
index 98b333e..cf5c902 100644
--- a/doc/src/snippets/declarative/systempalette.qml
+++ b/doc/src/snippets/declarative/systempalette.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/transition-from-to.qml b/doc/src/snippets/declarative/transition-from-to.qml
index 615de17..09949fc 100644
--- a/doc/src/snippets/declarative/transition-from-to.qml
+++ b/doc/src/snippets/declarative/transition-from-to.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/transition-reversible.qml b/doc/src/snippets/declarative/transition-reversible.qml
index 8a7b69a..367ad49 100644
--- a/doc/src/snippets/declarative/transition-reversible.qml
+++ b/doc/src/snippets/declarative/transition-reversible.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/transition.qml b/doc/src/snippets/declarative/transition.qml
index 098d509..a79e483 100644
--- a/doc/src/snippets/declarative/transition.qml
+++ b/doc/src/snippets/declarative/transition.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/visualdatamodel.qml b/doc/src/snippets/declarative/visualdatamodel.qml
index cdde513..231e4dd 100644
--- a/doc/src/snippets/declarative/visualdatamodel.qml
+++ b/doc/src/snippets/declarative/visualdatamodel.qml
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
index 174adee..8d8004d 100644
--- a/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
@@ -6,35 +6,34 @@
**
** This file is part of the QtDeclarative module 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_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$
**
****************************************************************************/
diff --git a/doc/src/snippets/declarative/~image-fillmode.qml b/doc/src/snippets/declarative/~image-fillmode.qml
new file mode 100644
index 0000000..cee26c4
--- /dev/null
+++ b/doc/src/snippets/declarative/~image-fillmode.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 QtDeclarative module 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 Qt 4.7
+
+Image {
+ source: "pics/qtlogo.png"
+ width: 20; height: 20
+}
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index d31a2b4..1148320 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-72b1c38579ca1fdb3f242e29cd16e5bfb4925813
+460b651cbe4f6994b492ff08614e57b0e31a24c8
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index c09ad79..2be6f5a 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-08 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Interpreter: Crash in op_load_varargs on 64-bit
+ https://bugs.webkit.org/show_bug.cgi?id=41795
+
+ Added missing cast of argCount to int32_t in op_load_varargs.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
2010-07-02 Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed by Oliver Hunt.
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
index 73efc0d..a56040c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
@@ -3465,17 +3465,17 @@ skip_id_custom_self:
goto vm_throw;
}
ASSERT(!callFrame->callee()->isHostFunction());
- uint32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount();
- uint32_t inplaceArgs = min(argCount, expectedParams);
- uint32_t i = 0;
+ int32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount();
+ int32_t inplaceArgs = min(static_cast<int32_t>(argCount), expectedParams);
+ int32_t i = 0;
Register* argStore = callFrame->registers() + argsOffset;
// First step is to copy the "expected" parameters from their normal location relative to the callframe
for (; i < inplaceArgs; i++)
argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams];
// Then we copy any additional arguments that may be further up the stack ('-1' to account for 'this')
- for (; i < argCount; i++)
- argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams - argCount - 1];
+ for (; i < static_cast<int32_t>(argCount); i++)
+ argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams - static_cast<int32_t>(argCount) - 1];
} else if (!arguments.isUndefinedOrNull()) {
if (!arguments.isObject()) {
exceptionValue = createInvalidParamError(callFrame, "Function.prototype.apply", arguments, vPC - callFrame->codeBlock()->instructions().begin(), callFrame->codeBlock());
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 62aa8ce..aff3f2a 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 72b1c38579ca1fdb3f242e29cd16e5bfb4925813
+ 460b651cbe4f6994b492ff08614e57b0e31a24c8
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index 2d74d4b..94f08bd 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -145,46 +145,76 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
\qmlclass WebView QDeclarativeWebView
\ingroup qml-view-elements
\since 4.7
- \brief The WebView item allows you to add web content to a canvas.
+ \brief The WebView item allows you to add Web content to a canvas.
\inherits Item
- A WebView renders web content based on a URL.
+ A WebView renders Web content based on a URL.
This type is made available by importing the \c QtWebKit module:
\bold{import QtWebKit 1.0}
- If the width and height of the item is not set, they will
- dynamically adjust to a size appropriate for the content.
- This width may be large for typical online web pages.
+ The WebView item includes no scrolling, scaling, toolbars, or other common browser
+ components. These must be implemented around WebView. See the \l{QML Web Browser}
+ example for a demonstration of this.
- If the width or height is explictly set, the rendered website
- will be clipped, not scaled, to fit into the set dimensions.
+ The page to be displayed by the item is specified using the \l url property,
+ and this can be changed to fetch and display a new page. While the page loads,
+ the \l progress property is updated to indicate how much of the page has been
+ loaded.
- If the preferredWidth is set, the width will be this amount or larger,
- usually laying out the web content to fit the preferredWidth.
+ \section1 Appearance
- \qml
- import QtWebKit 1.0
+ If the width and height of the item is not set, they will dynamically adjust
+ to a size appropriate for the content. This width may be large for typical
+ online web pages, typically greater than 800 by 600 pixels.
- WebView {
- url: "http://www.nokia.com"
- preferredWidth: 490
- preferredHeight: 400
- scale: 0.5
- smooth: false
- smoothCache: true
- }
- \endqml
+ If the \l{Item::}{width} or \l{Item::}{height} is explictly set, the rendered Web site will be
+ clipped, not scaled, to fit into the set dimensions.
- \image webview.png
+ If the preferredWidth property is set, the width will be this amount or larger,
+ usually laying out the Web content to fit the preferredWidth.
- The item includes no scrolling, scaling,
- toolbars, etc., those must be implemented around WebView. See the WebBrowser example
- for a demonstration of this.
+ The appearance of the content can be controlled to a certain extent by changing
+ the settings.standardFontFamily property and other settings related to fonts.
+
+ The page can be zoomed by calling the heuristicZoom() method, which performs a
+ series of tests to determine whether zoomed content will be displayed in an
+ appropriate way in the space allocated to the item.
+
+ \section1 User Interaction and Navigation
+
+ By default, certain mouse and touch events are delivered to other items in
+ preference to the Web content. For example, when a scrolling view is created
+ by placing a WebView in a Flickable, move events are delivered to the Flickable
+ so that the user can scroll the page. This prevents the user from accidentally
+ selecting text in a Web page instead of scrolling.
+
+ The pressGrabTime property defines the time the user must touch or press a
+ mouse button over the WebView before the Web content will receive the move
+ events it needs to select text and images.
+
+ When this item has keyboard focus, all keyboard input will be sent directly to
+ the Web page within.
+
+ When the navigates by clicking on links, the item records the pages visited
+ in its internal history
+
+ Because this item is designed to be used as a component in a browser, it
+ exposes \l{Action}{actions} for \l back, \l forward, \l reload and \l stop.
+ These can be triggered to change the current page displayed by the item.
+
+ \section1 Example Usage
+
+ \beginfloatright
+ \inlineimage webview.png
+ \endfloat
+
+ The following example displays a scaled down Web page at a fixed size.
+
+ \snippet doc/src/snippets/declarative/webview/webview.qml document
- When this item has keyboard focus, all keyboard input will be sent directly to the
- web page within.
+ \clearfloat
\sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo}
*/
@@ -393,7 +423,7 @@ void QDeclarativeWebView::setPreferredHeight(int height)
}
/*!
- \qmlmethod bool WebView::evaluateJavaScript(string)
+ \qmlmethod bool WebView::evaluateJavaScript(string scriptSource)
Evaluates the \a scriptSource JavaScript inside the context of the
main web frame, and returns the result of the last executed statement.
@@ -517,14 +547,14 @@ void QDeclarativeWebView::setRenderingEnabled(bool enabled)
}
/*!
- \qmlsignal WebView::onDoubleClick(clickx, clicky)
+ \qmlsignal WebView::onDoubleClick(int clickx, int clicky)
The WebView does not pass double-click events to the web engine, but rather
emits this signals.
*/
/*!
- \qmlmethod bool WebView::heuristicZoom(clickX,clickY,maxzoom)
+ \qmlmethod bool WebView::heuristicZoom(int clickX, int clickY, real maxzoom)
Finds a zoom that:
\list
@@ -559,11 +589,11 @@ bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxZoom)
\qmlproperty int WebView::pressGrabTime
The number of milliseconds the user must press before the WebView
- starts passing move events through to the web engine (rather than
+ starts passing move events through to the Web engine (rather than
letting other QML elements such as a Flickable take them).
Defaults to 400ms. Set to 0 to always grab and pass move events to
- the web engine.
+ the Web engine.
*/
int QDeclarativeWebView::pressGrabTime() const
{
@@ -980,7 +1010,7 @@ QString QDeclarativeWebPage::chooseFile(QWebFrame* originatingFrame, const QStri
}
/*!
- \qmlsignal WebView::onAlert(message)
+ \qmlsignal WebView::onAlert(string message)
The handler is called when the web engine sends a JavaScript alert. The \a message is the text
to be displayed in the alert to the user.
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index e54d95e..fcd17f7 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -82,20 +82,69 @@ static QString driveSpec(const QString &path)
//************* QDirPrivate
class QDirPrivate
+ : public QSharedData
{
- friend struct QScopedPointerDeleter<QDirPrivate>;
-
public:
- QDirPrivate(const QDir *copy = 0);
- ~QDirPrivate();
-
- void updateFileLists() const;
- void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const;
+ QDirPrivate(const QString &path,
+ const QStringList &nameFilters_ = QStringList(),
+ QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
+ QDir::Filters filters_ = QDir::AllEntries)
+ : QSharedData()
+ , nameFilters(nameFilters_)
+ , sort(sort_)
+ , filters(filters_)
+#ifdef QT3_SUPPORT
+ , filterSepChar(0)
+ , matchAllDirs(false)
+#endif
+ , fileListsInitialized(false)
+ {
+ setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
+
+ bool empty = nameFilters.isEmpty();
+ if (!empty) {
+ empty = true;
+ for (int i = 0; i < nameFilters.size(); ++i) {
+ if (!nameFilters.at(i).isEmpty()) {
+ empty = false;
+ break;
+ }
+ }
+ }
+ if (empty)
+ nameFilters = QStringList(QString::fromLatin1("*"));
+ }
+ QDirPrivate(const QDirPrivate &copy)
+ : QSharedData(copy)
+ , path(copy.path)
+ , nameFilters(copy.nameFilters)
+ , sort(copy.sort)
+ , filters(copy.filters)
#ifdef QT3_SUPPORT
- QChar filterSepChar;
- bool matchAllDirs;
+ , filterSepChar(copy.filterSepChar)
+ , matchAllDirs(copy.matchAllDirs)
#endif
+ , fileListsInitialized(false)
+ {
+ }
+
+ bool exists() const
+ {
+ const QAbstractFileEngine::FileFlags info =
+ fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
+ | QAbstractFileEngine::ExistsFlag
+ | QAbstractFileEngine::Refresh);
+ if (!(info & QAbstractFileEngine::DirectoryType))
+ return false;
+ return info & QAbstractFileEngine::ExistsFlag;
+ }
+
+ void initFileEngine();
+ void initFileLists() const;
+
+ static void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *);
+
static inline QChar getFilterSepChar(const QString &nameFilter)
{
QChar sep(QLatin1Char(';'));
@@ -104,7 +153,9 @@ public:
sep = QChar(QLatin1Char(' '));
return sep;
}
- static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0) {
+
+ static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0)
+ {
if (sep == 0)
sep = getFilterSepChar(nameFilter);
QStringList ret = nameFilter.split(sep);
@@ -113,80 +164,46 @@ public:
return ret;
}
- struct Data {
- inline Data()
- : ref(1), fileEngine(0), listsDirty(1)
- {}
- inline Data(const Data &copy)
- : ref(1), path(copy.path), nameFilters(copy.nameFilters), sort(copy.sort),
- filters(copy.filters), fileEngine(0), listsDirty(1)
- {}
- inline ~Data()
- { delete fileEngine; }
-
- inline void clear() {
- listsDirty = 1;
- files.clear();
- fileInfos.clear();
- }
- mutable QAtomicInt ref;
-
- QString path;
- QStringList nameFilters;
- QDir::SortFlags sort;
- QDir::Filters filters;
-
- mutable QAbstractFileEngine *fileEngine;
-
- mutable uint listsDirty : 1;
- mutable QStringList files;
- mutable QFileInfoList fileInfos;
- } *data;
- inline void setPath(const QString &p)
+ inline void setPath(QString p)
{
- detach(false);
- QString path = p;
- if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
- && path.length() > 1) {
+ if ((p.endsWith(QLatin1Char('/')) || p.endsWith(QLatin1Char('\\')))
+ && p.length() > 1) {
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
+ if (!(p.length() == 3 && p.at(1) == QLatin1Char(':')))
#endif
- path.truncate(path.length() - 1);
+ p.truncate(p.length() - 1);
}
- delete data->fileEngine;
- data->fileEngine = QAbstractFileEngine::create(path);
+ path = p;
+ initFileEngine();
// set the path to be the qt friendly version so then we can operate on it using just /
- data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName);
- data->clear();
+ path = fileEngine->fileName(QAbstractFileEngine::DefaultName);
+ clearFileLists();
}
- inline void reset() {
- detach();
- data->clear();
+
+ inline void clearFileLists() {
+ fileListsInitialized = false;
+ files.clear();
+ fileInfos.clear();
}
- void detach(bool createFileEngine = true);
-};
-QDirPrivate::QDirPrivate(const QDir *copy)
+ QString path;
+ QStringList nameFilters;
+ QDir::SortFlags sort;
+ QDir::Filters filters;
+
#ifdef QT3_SUPPORT
- : filterSepChar(0), matchAllDirs(false)
+ QChar filterSepChar;
+ bool matchAllDirs;
#endif
-{
- if (copy) {
- copy->d_func()->data->ref.ref();
- data = copy->d_func()->data;
- } else {
- data = new QDirPrivate::Data;
- }
-}
-QDirPrivate::~QDirPrivate()
-{
- if (!data->ref.deref())
- delete data;
- data = 0;
-}
+ QScopedPointer<QAbstractFileEngine> fileEngine;
+
+ mutable bool fileListsInitialized;
+ mutable QStringList files;
+ mutable QFileInfoList fileInfos;
+};
/* For sorting */
struct QDirSortItem
@@ -269,7 +286,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt
}
inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
- QStringList *names, QFileInfoList *infos) const
+ QStringList *names, QFileInfoList *infos)
{
// names and infos are always empty lists or 0 here
int n = l.size();
@@ -299,28 +316,23 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
}
}
-inline void QDirPrivate::updateFileLists() const
+inline void QDirPrivate::initFileLists() const
{
- if (data->listsDirty) {
+ if (!fileListsInitialized) {
QFileInfoList l;
- QDirIterator it(data->path, data->nameFilters, data->filters);
+ QDirIterator it(path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
}
- sortFileList(data->sort, l, &data->files, &data->fileInfos);
- data->listsDirty = 0;
+ sortFileList(sort, l, &files, &fileInfos);
+ fileListsInitialized = true;
}
}
-void QDirPrivate::detach(bool createFileEngine)
+inline void QDirPrivate::initFileEngine()
{
- qAtomicDetach(data);
- if (createFileEngine) {
- QAbstractFileEngine *newFileEngine = QAbstractFileEngine::create(data->path);
- delete data->fileEngine;
- data->fileEngine = newFileEngine;
- }
+ fileEngine.reset(QAbstractFileEngine::create(path));
}
/*!
@@ -504,13 +516,8 @@ void QDirPrivate::detach(bool createFileEngine)
\sa currentPath()
*/
-QDir::QDir(const QString &path) : d_ptr(new QDirPrivate)
+QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(path))
{
- Q_D(QDir);
- d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
- d->data->nameFilters = QStringList(QString::fromLatin1("*"));
- d->data->filters = AllEntries;
- d->data->sort = SortFlags(Name | IgnoreCase);
}
/*!
@@ -532,25 +539,9 @@ QDir::QDir(const QString &path) : d_ptr(new QDirPrivate)
\sa exists(), setPath(), setNameFilter(), setFilter(), setSorting()
*/
QDir::QDir(const QString &path, const QString &nameFilter,
- SortFlags sort, Filters filters) : d_ptr(new QDirPrivate)
-{
- Q_D(QDir);
- d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
- d->data->nameFilters = QDir::nameFiltersFromString(nameFilter);
- bool empty = d->data->nameFilters.isEmpty();
- if (!empty) {
- empty = true;
- for (int i = 0; i < d->data->nameFilters.size(); ++i) {
- if (!d->data->nameFilters.at(i).isEmpty()) {
- empty = false;
- break;
- }
- }
- }
- if (empty)
- d->data->nameFilters = QStringList(QString::fromLatin1("*"));
- d->data->sort = sort;
- d->data->filters = filters;
+ SortFlags sort, Filters filters)
+ : d_ptr(new QDirPrivate(path, QDir::nameFiltersFromString(nameFilter), sort, filters))
+{
}
/*!
@@ -559,7 +550,8 @@ QDir::QDir(const QString &path, const QString &nameFilter,
\sa operator=()
*/
-QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir))
+QDir::QDir(const QDir &dir)
+ : d_ptr(dir.d_ptr)
{
}
@@ -589,8 +581,7 @@ QDir::~QDir()
*/
void QDir::setPath(const QString &path)
{
- Q_D(QDir);
- d->setPath(path);
+ d_ptr->setPath(path);
}
/*!
@@ -605,8 +596,8 @@ void QDir::setPath(const QString &path)
*/
QString QDir::path() const
{
- Q_D(const QDir);
- return d->data->path;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->path;
}
/*!
@@ -619,8 +610,8 @@ QString QDir::path() const
*/
QString QDir::absolutePath() const
{
- Q_D(const QDir);
- QString ret = d->data->path;
+ const QDirPrivate* d = d_ptr.constData();
+ QString ret = d->path;
if (QDir::isRelativePath(ret))
ret = absoluteFilePath(QString::fromLatin1(""));
return cleanPath(ret);
@@ -644,11 +635,7 @@ QString QDir::absolutePath() const
*/
QString QDir::canonicalPath() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return QLatin1String("");
- return cleanPath(d->data->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
+ return cleanPath(d_ptr->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
}
/*!
@@ -664,11 +651,11 @@ QString QDir::canonicalPath() const
*/
QString QDir::dirName() const
{
- Q_D(const QDir);
- int pos = d->data->path.lastIndexOf(QLatin1Char('/'));
+ const QDirPrivate* d = d_ptr.constData();
+ int pos = d->path.lastIndexOf(QLatin1Char('/'));
if (pos == -1)
- return d->data->path;
- return d->data->path.mid(pos + 1);
+ return d->path;
+ return d->path.mid(pos + 1);
}
/*!
@@ -682,11 +669,11 @@ QString QDir::dirName() const
*/
QString QDir::filePath(const QString &fileName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
return QString(fileName);
- QString ret = d->data->path;
+ QString ret = d->path;
if (!fileName.isEmpty()) {
if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/'))
ret += QLatin1Char('/');
@@ -705,21 +692,19 @@ QString QDir::filePath(const QString &fileName) const
*/
QString QDir::absoluteFilePath(const QString &fileName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
return fileName;
- if (!d->data->fileEngine)
- return fileName;
QString ret;
#ifndef QT_NO_FSFILEENGINE
- if (isRelativePath(d->data->path)) //get pwd
+ if (isRelativePath(d->path)) //get pwd
ret = QFSFileEngine::currentPath(fileName);
#endif
- if (!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {
+ if (!d->path.isEmpty() && d->path != QLatin1String(".")) {
if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
ret += QLatin1Char('/');
- ret += d->data->path;
+ ret += d->path;
}
if (!fileName.isEmpty()) {
if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
@@ -867,11 +852,12 @@ QString QDir::fromNativeSeparators(const QString &pathName)
*/
bool QDir::cd(const QString &dirName)
{
- Q_D(QDir);
+ // Don't detach just yet.
+ const QDirPrivate * const d = d_ptr.constData();
if (dirName.isEmpty() || dirName == QLatin1String("."))
return true;
- QString newPath = d->data->path;
+ QString newPath = d->path;
if (isAbsolutePath(dirName)) {
newPath = cleanPath(dirName);
} else {
@@ -884,7 +870,7 @@ bool QDir::cd(const QString &dirName)
newPath += dirName;
if (dirName.indexOf(QLatin1Char('/')) >= 0
- || d->data->path == QLatin1String(".")
+ || d->path == QLatin1String(".")
|| dirName == QLatin1String("..")) {
newPath = cleanPath(newPath);
/*
@@ -901,12 +887,13 @@ bool QDir::cd(const QString &dirName)
}
}
- QDir dir(*this);
- dir.setPath(newPath);
- if (!dir.exists())
+ QScopedPointer<QDirPrivate> dir(new QDirPrivate(*d_ptr.constData()));
+ dir->setPath(newPath);
+
+ if (!dir->exists())
return false;
- *this = dir;
+ d_ptr = dir.take();
return true;
}
@@ -930,9 +917,8 @@ bool QDir::cdUp()
*/
QStringList QDir::nameFilters() const
{
- Q_D(const QDir);
-
- return d->data->nameFilters;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->nameFilters;
}
/*!
@@ -952,10 +938,11 @@ QStringList QDir::nameFilters() const
*/
void QDir::setNameFilters(const QStringList &nameFilters)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->nameFilters = nameFilters;
+ d->nameFilters = nameFilters;
}
/*!
@@ -1058,9 +1045,8 @@ QStringList QDir::searchPaths(const QString &prefix)
*/
QDir::Filters QDir::filter() const
{
- Q_D(const QDir);
-
- return d->data->filters;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->filters;
}
/*!
@@ -1141,10 +1127,11 @@ QDir::Filters QDir::filter() const
*/
void QDir::setFilter(Filters filters)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->filters = filters;
+ d->filters = filters;
}
/*!
@@ -1154,9 +1141,8 @@ void QDir::setFilter(Filters filters)
*/
QDir::SortFlags QDir::sorting() const
{
- Q_D(const QDir);
-
- return d->data->sort;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->sort;
}
/*!
@@ -1199,10 +1185,11 @@ QDir::SortFlags QDir::sorting() const
*/
void QDir::setSorting(SortFlags sort)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->sort = sort;
+ d->sort = sort;
}
/*!
@@ -1214,10 +1201,9 @@ void QDir::setSorting(SortFlags sort)
*/
uint QDir::count() const
{
- Q_D(const QDir);
-
- d->updateFileLists();
- return d->data->files.count();
+ const QDirPrivate* d = d_ptr.constData();
+ d->initFileLists();
+ return d->files.count();
}
/*!
@@ -1229,10 +1215,9 @@ uint QDir::count() const
*/
QString QDir::operator[](int pos) const
{
- Q_D(const QDir);
-
- d->updateFileLists();
- return d->data->files[pos];
+ const QDirPrivate* d = d_ptr.constData();
+ d->initFileLists();
+ return d->files[pos];
}
/*!
@@ -1256,9 +1241,8 @@ QString QDir::operator[](int pos) const
*/
QStringList QDir::entryList(Filters filters, SortFlags sort) const
{
- Q_D(const QDir);
-
- return entryList(d->data->nameFilters, filters, sort);
+ const QDirPrivate* d = d_ptr.constData();
+ return entryList(d->nameFilters, filters, sort);
}
@@ -1280,9 +1264,8 @@ QStringList QDir::entryList(Filters filters, SortFlags sort) const
*/
QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const
{
- Q_D(const QDir);
-
- return entryInfoList(d->data->nameFilters, filters, sort);
+ const QDirPrivate* d = d_ptr.constData();
+ return entryInfoList(d->nameFilters, filters, sort);
}
/*!
@@ -1304,24 +1287,24 @@ QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const
QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
SortFlags sort) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (filters == NoFilter)
- filters = d->data->filters;
+ filters = d->filters;
#ifdef QT3_SUPPORT
if (d->matchAllDirs)
filters |= AllDirs;
#endif
if (sort == NoSort)
- sort = d->data->sort;
+ sort = d->sort;
- if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) {
- d->updateFileLists();
- return d->data->files;
+ if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
+ d->initFileLists();
+ return d->files;
}
QFileInfoList l;
- QDirIterator it(d->data->path, nameFilters, filters);
+ QDirIterator it(d->path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
@@ -1350,24 +1333,24 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters,
SortFlags sort) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (filters == NoFilter)
- filters = d->data->filters;
+ filters = d->filters;
#ifdef QT3_SUPPORT
if (d->matchAllDirs)
filters |= AllDirs;
#endif
if (sort == NoSort)
- sort = d->data->sort;
+ sort = d->sort;
- if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) {
- d->updateFileLists();
- return d->data->fileInfos;
+ if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
+ d->initFileLists();
+ return d->fileInfos;
}
QFileInfoList l;
- QDirIterator it(d->data->path, nameFilters, filters);
+ QDirIterator it(d->path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
@@ -1386,17 +1369,15 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
*/
bool QDir::mkdir(const QString &dirName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirName.isEmpty()) {
qWarning("QDir::mkdir: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirName);
- return d->data->fileEngine->mkdir(fn, false);
+ return d->fileEngine->mkdir(fn, false);
}
/*!
@@ -1410,17 +1391,15 @@ bool QDir::mkdir(const QString &dirName) const
*/
bool QDir::rmdir(const QString &dirName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirName.isEmpty()) {
qWarning("QDir::rmdir: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirName);
- return d->data->fileEngine->rmdir(fn, false);
+ return d->fileEngine->rmdir(fn, false);
}
/*!
@@ -1435,17 +1414,15 @@ bool QDir::rmdir(const QString &dirName) const
*/
bool QDir::mkpath(const QString &dirPath) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirPath.isEmpty()) {
qWarning("QDir::mkpath: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirPath);
- return d->data->fileEngine->mkdir(fn, true);
+ return d->fileEngine->mkdir(fn, true);
}
/*!
@@ -1461,17 +1438,15 @@ bool QDir::mkpath(const QString &dirPath) const
*/
bool QDir::rmpath(const QString &dirPath) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirPath.isEmpty()) {
qWarning("QDir::rmpath: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirPath);
- return d->data->fileEngine->rmdir(fn, true);
+ return d->fileEngine->rmdir(fn, true);
}
/*!
@@ -1485,12 +1460,10 @@ bool QDir::rmpath(const QString &dirPath) const
*/
bool QDir::isReadable() const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
- if (!d->data->fileEngine)
- return false;
const QAbstractFileEngine::FileFlags info =
- d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
+ d->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
| QAbstractFileEngine::PermsMask);
if (!(info & QAbstractFileEngine::DirectoryType))
return false;
@@ -1510,17 +1483,7 @@ bool QDir::isReadable() const
*/
bool QDir::exists() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return false;
- const QAbstractFileEngine::FileFlags info =
- d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
- | QAbstractFileEngine::ExistsFlag
- | QAbstractFileEngine::Refresh);
- if (!(info & QAbstractFileEngine::DirectoryType))
- return false;
- return info & QAbstractFileEngine::ExistsFlag;
+ return d_ptr->exists();
}
/*!
@@ -1537,11 +1500,7 @@ bool QDir::exists() const
*/
bool QDir::isRoot() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return true;
- return d->data->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
+ return d_ptr->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
}
/*!
@@ -1571,11 +1530,7 @@ bool QDir::isRoot() const
*/
bool QDir::isRelative() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return false;
- return d->data->fileEngine->isRelativePath();
+ return d_ptr->fileEngine->isRelativePath();
}
@@ -1588,18 +1543,17 @@ bool QDir::isRelative() const
*/
bool QDir::makeAbsolute() // ### What do the return values signify?
{
- Q_D(QDir);
-
- if (!d->data->fileEngine)
- return false;
- QString absolutePath = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
+ QString absolutePath = d_ptr.constData()->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
if (QDir::isRelativePath(absolutePath))
return false;
- d->detach();
- d->data->path = absolutePath;
- d->data->fileEngine->setFileName(absolutePath);
- if (!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
+
+ QScopedPointer<QDirPrivate> dir(new QDirPrivate(*d_ptr.constData()));
+ dir->setPath(absolutePath);
+
+ if (!(dir->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
return false;
+
+ d_ptr = dir.take();
return true;
}
@@ -1614,19 +1568,18 @@ bool QDir::makeAbsolute() // ### What do the return values signify?
*/
bool QDir::operator==(const QDir &dir) const
{
- const QDirPrivate *d = d_func();
- const QDirPrivate *other = dir.d_func();
+ const QDirPrivate *d = d_ptr.constData();
+ const QDirPrivate *other = dir.d_ptr.constData();
- if (d->data == other->data)
+ if (d == other)
return true;
- Q_ASSERT(d->data->fileEngine && other->data->fileEngine);
- if (d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive())
+ if (d->fileEngine->caseSensitive() != other->fileEngine->caseSensitive())
return false;
- if (d->data->filters == other->data->filters
- && d->data->sort == other->data->sort
- && d->data->nameFilters == other->data->nameFilters) {
+ if (d->filters == other->filters
+ && d->sort == other->sort
+ && d->nameFilters == other->nameFilters) {
QString dir1 = absolutePath(), dir2 = dir.absolutePath();
- if (!other->data->fileEngine->caseSensitive())
+ if (!other->fileEngine->caseSensitive())
return (dir1.toLower() == dir2.toLower());
return (dir1 == dir2);
@@ -1641,11 +1594,7 @@ bool QDir::operator==(const QDir &dir) const
*/
QDir &QDir::operator=(const QDir &dir)
{
- if (this == &dir)
- return *this;
-
- Q_D(QDir);
- qAtomicAssign(d->data, dir.d_func()->data);
+ d_ptr = dir.d_ptr;
return *this;
}
@@ -1659,9 +1608,7 @@ QDir &QDir::operator=(const QDir &dir)
*/
QDir &QDir::operator=(const QString &path)
{
- Q_D(QDir);
-
- d->setPath(path);
+ d_ptr->setPath(path);
return *this;
}
@@ -1705,14 +1652,10 @@ bool QDir::remove(const QString &fileName)
*/
bool QDir::rename(const QString &oldName, const QString &newName)
{
- Q_D(QDir);
-
if (oldName.isEmpty() || newName.isEmpty()) {
qWarning("QDir::rename: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QFile file(filePath(oldName));
if (!file.exists())
@@ -2150,9 +2093,9 @@ bool QDir::isRelativePath(const QString &path)
*/
void QDir::refresh() const
{
- Q_D(const QDir);
-
- const_cast<QDirPrivate *>(d)->reset();
+ QDirPrivate *d = const_cast<QDir*>(this)->d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
}
/*!
@@ -2228,7 +2171,7 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter)
*/
bool QDir::matchAllDirs() const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
return d->matchAllDirs;
}
@@ -2240,9 +2183,10 @@ bool QDir::matchAllDirs() const
*/
void QDir::setMatchAllDirs(bool on)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
d->matchAllDirs = on;
}
@@ -2251,8 +2195,7 @@ void QDir::setMatchAllDirs(bool on)
*/
QString QDir::nameFilter() const
{
- Q_D(const QDir);
-
+ const QDirPrivate* d = d_ptr.constData();
return nameFilters().join(QString(d->filterSepChar));
}
@@ -2278,10 +2221,12 @@ QString QDir::nameFilter() const
*/
void QDir::setNameFilter(const QString &nameFilter)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter);
- setNameFilters(QDirPrivate::splitFilters(nameFilter, d->filterSepChar));
+ d->nameFilters = QDirPrivate::splitFilters(nameFilter, d->filterSepChar);
}
/*!
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 28da271..7e5fbac 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -45,7 +45,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qstringlist.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
QT_BEGIN_HEADER
@@ -58,9 +58,8 @@ class QDirPrivate;
class Q_CORE_EXPORT QDir
{
protected:
- QScopedPointer<QDirPrivate> d_ptr;
-private:
- Q_DECLARE_PRIVATE(QDir)
+ QSharedDataPointer<QDirPrivate> d_ptr;
+
public:
enum Filter { Dirs = 0x001,
Files = 0x002,
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 61f7180..7eca212 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -47,59 +47,27 @@
QT_BEGIN_NAMESPACE
-QFileInfoPrivate::QFileInfoPrivate(const QFileInfo *copy)
-{
- if (copy) {
- copy->d_func()->data->ref.ref();
- data = copy->d_func()->data;
- } else {
- data = new QFileInfoPrivate::Data;
- }
-}
-
-QFileInfoPrivate::~QFileInfoPrivate()
-{
- if (!data->ref.deref())
- delete data;
- data = 0;
-}
-
-void QFileInfoPrivate::initFileEngine(const QString &file)
-{
- detach();
- delete data->fileEngine;
- data->fileEngine = 0;
- data->clear();
- data->fileEngine = QAbstractFileEngine::create(file);
- data->fileName = file;
-}
-
-void QFileInfoPrivate::detach()
-{
- qAtomicDetach(data);
-}
-
QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
{
- if (data->cache_enabled && !data->fileNames[(int)name].isNull())
- return data->fileNames[(int)name];
- QString ret = data->fileEngine->fileName(name);
+ if (cache_enabled && !fileNames[(int)name].isNull())
+ return fileNames[(int)name];
+ QString ret = fileEngine->fileName(name);
if (ret.isNull())
ret = QLatin1String("");
- if (data->cache_enabled)
- data->fileNames[(int)name] = ret;
+ if (cache_enabled)
+ fileNames[(int)name] = ret;
return ret;
}
QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const
{
- if (data->cache_enabled && !data->fileOwners[(int)own].isNull())
- return data->fileOwners[(int)own];
- QString ret = data->fileEngine->owner(own);
+ if (cache_enabled && !fileOwners[(int)own].isNull())
+ return fileOwners[(int)own];
+ QString ret = fileEngine->owner(own);
if (ret.isNull())
ret = QLatin1String("");
- if (data->cache_enabled)
- data->fileOwners[(int)own] = ret;
+ if (cache_enabled)
+ fileOwners[(int)own] = ret;
return ret;
}
@@ -118,7 +86,7 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
uint cachedFlags = 0;
if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) {
- if (!data->getCachedFlag(CachedFileFlags)) {
+ if (!getCachedFlag(CachedFileFlags)) {
req |= QAbstractFileEngine::FlagsMask;
req |= QAbstractFileEngine::TypesMask;
req &= (~QAbstractFileEngine::LinkType);
@@ -128,14 +96,14 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
}
if (request & QAbstractFileEngine::LinkType) {
- if (!data->getCachedFlag(CachedLinkTypeFlag)) {
+ if (!getCachedFlag(CachedLinkTypeFlag)) {
req |= QAbstractFileEngine::LinkType;
cachedFlags |= CachedLinkTypeFlag;
}
}
if (request & QAbstractFileEngine::BundleType) {
- if (!data->getCachedFlag(CachedBundleTypeFlag)) {
+ if (!getCachedFlag(CachedBundleTypeFlag)) {
req |= QAbstractFileEngine::BundleType;
cachedFlags |= CachedBundleTypeFlag;
}
@@ -143,30 +111,30 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
}
if (request & QAbstractFileEngine::PermsMask) {
- if (!data->getCachedFlag(CachedPerms)) {
+ if (!getCachedFlag(CachedPerms)) {
req |= QAbstractFileEngine::PermsMask;
cachedFlags |= CachedPerms;
}
}
if (req) {
- if (data->cache_enabled)
+ if (cache_enabled)
req &= (~QAbstractFileEngine::Refresh);
else
req |= QAbstractFileEngine::Refresh;
- QAbstractFileEngine::FileFlags flags = data->fileEngine->fileFlags(req);
- data->fileFlags |= uint(flags);
- data->setCachedFlag(cachedFlags);
+ QAbstractFileEngine::FileFlags flags = fileEngine->fileFlags(req);
+ fileFlags |= uint(flags);
+ setCachedFlag(cachedFlags);
}
- return data->fileFlags & request;
+ return fileFlags & request;
}
QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const
{
- if (!data->cache_enabled)
- data->clearFlags();
+ if (!cache_enabled)
+ clearFlags();
uint cf;
if (request == QAbstractFileEngine::CreationTime)
cf = CachedCTime;
@@ -174,11 +142,11 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
cf = CachedMTime;
else
cf = CachedATime;
- if (!data->getCachedFlag(cf)) {
- data->fileTimes[request] = data->fileEngine->fileTime(request);
- data->setCachedFlag(cf);
+ if (!getCachedFlag(cf)) {
+ fileTimes[request] = fileEngine->fileTime(request);
+ setCachedFlag(cf);
}
- return data->fileTimes[request];
+ return fileTimes[request];
}
//************* QFileInfo
@@ -285,9 +253,8 @@ QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate())
\sa setFile(), isRelative(), QDir::setCurrent(), QDir::isRelativePath()
*/
-QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate(file))
{
- d_ptr->initFileEngine(file);
}
/*!
@@ -299,9 +266,8 @@ QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate())
\sa isRelative()
*/
-QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate(file.fileName()))
{
- d_ptr->initFileEngine(file.fileName());
}
/*!
@@ -316,15 +282,16 @@ QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate())
\sa isRelative()
*/
-QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QDir &dir, const QString &file)
+ : d_ptr(new QFileInfoPrivate(dir.filePath(file)))
{
- d_ptr->initFileEngine(dir.filePath(file));
}
/*!
Constructs a new QFileInfo that is a copy of the given \a fileinfo.
*/
-QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fileinfo))
+QFileInfo::QFileInfo(const QFileInfo &fileinfo)
+ : d_ptr(fileinfo.d_ptr)
{
}
@@ -359,17 +326,17 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
Q_D(const QFileInfo);
// ### Qt 5: understand long and short file names on Windows
// ### (GetFullPathName()).
- if (fileinfo.d_func()->data == d->data)
+ if (fileinfo.d_ptr == d_ptr)
return true;
- if (!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine)
+ if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
return false;
- if (d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive())
+ if (d->fileEngine->caseSensitive() != fileinfo.d_ptr->fileEngine->caseSensitive())
return false;
if (fileinfo.size() == size()) { //if the size isn't the same...
QString file1 = canonicalFilePath(),
file2 = fileinfo.canonicalFilePath();
if (file1.length() == file2.length()) {
- if (!fileinfo.d_func()->data->fileEngine->caseSensitive()) {
+ if (!fileinfo.d_ptr->fileEngine->caseSensitive()) {
for (int i = 0; i < file1.length(); i++) {
if (file1.at(i).toLower() != file2.at(i).toLower())
return false;
@@ -407,8 +374,7 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo)
*/
QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
{
- Q_D(QFileInfo);
- qAtomicAssign(d->data, fileinfo.d_func()->data);
+ d_ptr = fileinfo.d_ptr;
return *this;
}
@@ -429,7 +395,9 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
*/
void QFileInfo::setFile(const QString &file)
{
+ bool caching = d_ptr.constData()->cache_enabled;
*this = QFileInfo(file);
+ d_ptr->cache_enabled = caching;
}
/*!
@@ -445,7 +413,7 @@ void QFileInfo::setFile(const QString &file)
*/
void QFileInfo::setFile(const QFile &file)
{
- *this = QFileInfo(file.fileName());
+ setFile(file.fileName());
}
/*!
@@ -461,7 +429,7 @@ void QFileInfo::setFile(const QFile &file)
*/
void QFileInfo::setFile(const QDir &dir, const QString &file)
{
- *this = QFileInfo(dir.filePath(file));
+ setFile(dir.filePath(file));
}
/*!
@@ -488,7 +456,7 @@ void QFileInfo::setFile(const QDir &dir, const QString &file)
QString QFileInfo::absoluteFilePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::AbsoluteName);
}
@@ -505,7 +473,7 @@ QString QFileInfo::absoluteFilePath() const
QString QFileInfo::canonicalFilePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::CanonicalName);
}
@@ -532,9 +500,9 @@ QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine) {
+ if (d->isDefaultConstructed) {
return QLatin1String("");
- } else if (d->data->fileName.isEmpty()) {
+ } else if (d->fileName.isEmpty()) {
qWarning("QFileInfo::absolutePath: Constructed with empty filename");
return QLatin1String("");
}
@@ -552,7 +520,7 @@ QString QFileInfo::absolutePath() const
QString QFileInfo::canonicalPath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::CanonicalPathName);
}
@@ -569,7 +537,7 @@ QString QFileInfo::canonicalPath() const
QString QFileInfo::path() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::PathName);
}
@@ -593,9 +561,9 @@ QString QFileInfo::path() const
bool QFileInfo::isRelative() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return true;
- return d->data->fileEngine->isRelativePath();
+ return d->fileEngine->isRelativePath();
}
/*!
@@ -607,11 +575,13 @@ bool QFileInfo::isRelative() const
*/
bool QFileInfo::makeAbsolute()
{
- Q_D(QFileInfo);
- if (!d->data->fileEngine || !d->data->fileEngine->isRelativePath())
+ if (d_ptr.constData()->isDefaultConstructed
+ || !d_ptr.constData()->fileEngine->isRelativePath())
return false;
- QString absFileName = d->getFileName(QAbstractFileEngine::AbsoluteName);
- d->initFileEngine(absFileName);
+ QString absFileName = d_ptr.constData()->getFileName(QAbstractFileEngine::AbsoluteName);
+ // QSharedDataPointer::operator->() will detach.
+
+ setFile(absFileName);
return true;
}
@@ -624,7 +594,7 @@ bool QFileInfo::makeAbsolute()
bool QFileInfo::exists() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
}
@@ -639,7 +609,7 @@ bool QFileInfo::exists() const
void QFileInfo::refresh()
{
Q_D(QFileInfo);
- d->reset();
+ d->clear();
}
/*!
@@ -651,7 +621,7 @@ void QFileInfo::refresh()
QString QFileInfo::filePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::DefaultName);
}
@@ -670,7 +640,7 @@ QString QFileInfo::filePath() const
QString QFileInfo::fileName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BaseName);
}
@@ -690,7 +660,7 @@ QString QFileInfo::fileName() const
QString QFileInfo::bundleName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BundleName);
}
@@ -714,7 +684,7 @@ QString QFileInfo::bundleName() const
QString QFileInfo::baseName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BaseName).section(QLatin1Char('.'), 0, 0);
}
@@ -733,7 +703,7 @@ QString QFileInfo::baseName() const
QString QFileInfo::completeBaseName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString name = d->getFileName(QAbstractFileEngine::BaseName);
int index = name.lastIndexOf(QLatin1Char('.'));
@@ -754,7 +724,7 @@ QString QFileInfo::completeBaseName() const
QString QFileInfo::completeSuffix() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString fileName = d->getFileName(QAbstractFileEngine::BaseName);
int firstDot = fileName.indexOf(QLatin1Char('.'));
@@ -781,7 +751,7 @@ QString QFileInfo::completeSuffix() const
QString QFileInfo::suffix() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString fileName = d->getFileName(QAbstractFileEngine::BaseName);
int lastDot = fileName.lastIndexOf(QLatin1Char('.'));
@@ -846,7 +816,7 @@ QDir QFileInfo::dir(bool absPath) const
bool QFileInfo::isReadable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ReadUserPerm);
}
@@ -859,7 +829,7 @@ bool QFileInfo::isReadable() const
bool QFileInfo::isWritable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::WriteUserPerm);
}
@@ -872,7 +842,7 @@ bool QFileInfo::isWritable() const
bool QFileInfo::isExecutable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ExeUserPerm);
}
@@ -886,7 +856,7 @@ bool QFileInfo::isExecutable() const
bool QFileInfo::isHidden() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::HiddenFlag);
}
@@ -901,7 +871,7 @@ bool QFileInfo::isHidden() const
bool QFileInfo::isFile() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::FileType);
}
@@ -915,7 +885,7 @@ bool QFileInfo::isFile() const
bool QFileInfo::isDir() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::DirectoryType);
}
@@ -931,7 +901,7 @@ bool QFileInfo::isDir() const
bool QFileInfo::isBundle() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::BundleType);
}
@@ -956,7 +926,7 @@ bool QFileInfo::isBundle() const
bool QFileInfo::isSymLink() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::LinkType);
}
@@ -969,7 +939,7 @@ bool QFileInfo::isSymLink() const
bool QFileInfo::isRoot() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return true;
return d->getFileFlags(QAbstractFileEngine::RootFlag);
}
@@ -997,7 +967,7 @@ bool QFileInfo::isRoot() const
QString QFileInfo::readLink() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::LinkName);
}
@@ -1015,7 +985,7 @@ QString QFileInfo::readLink() const
QString QFileInfo::owner() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileOwner(QAbstractFileEngine::OwnerUser);
}
@@ -1031,9 +1001,9 @@ QString QFileInfo::owner() const
uint QFileInfo::ownerId() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
+ return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
}
/*!
@@ -1049,7 +1019,7 @@ uint QFileInfo::ownerId() const
QString QFileInfo::group() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileOwner(QAbstractFileEngine::OwnerGroup);
}
@@ -1065,9 +1035,9 @@ QString QFileInfo::group() const
uint QFileInfo::groupId() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
+ return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
}
/*!
@@ -1086,7 +1056,7 @@ uint QFileInfo::groupId() const
bool QFileInfo::permission(QFile::Permissions permissions) const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions;
}
@@ -1098,7 +1068,7 @@ bool QFileInfo::permission(QFile::Permissions permissions) const
QFile::Permissions QFileInfo::permissions() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
}
@@ -1113,13 +1083,13 @@ QFile::Permissions QFileInfo::permissions() const
qint64 QFileInfo::size() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- if (!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) {
- d->data->setCachedFlag(QFileInfoPrivate::CachedSize);
- d->data->fileSize = d->data->fileEngine->size();
+ if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
+ d->setCachedFlag(QFileInfoPrivate::CachedSize);
+ d->fileSize = d->fileEngine->size();
}
- return d->data->fileSize;
+ return d->fileSize;
}
/*!
@@ -1138,7 +1108,7 @@ qint64 QFileInfo::size() const
QDateTime QFileInfo::created() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::CreationTime);
}
@@ -1151,7 +1121,7 @@ QDateTime QFileInfo::created() const
QDateTime QFileInfo::lastModified() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::ModificationTime);
}
@@ -1167,7 +1137,7 @@ QDateTime QFileInfo::lastModified() const
QDateTime QFileInfo::lastRead() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::AccessTime);
}
@@ -1177,8 +1147,7 @@ QDateTime QFileInfo::lastRead() const
*/
void QFileInfo::detach()
{
- Q_D(QFileInfo);
- d->detach();
+ d_ptr.detach();
}
/*!
@@ -1189,7 +1158,7 @@ void QFileInfo::detach()
bool QFileInfo::caching() const
{
Q_D(const QFileInfo);
- return d->data->cache_enabled;
+ return d->cache_enabled;
}
/*!
@@ -1207,8 +1176,7 @@ bool QFileInfo::caching() const
void QFileInfo::setCaching(bool enable)
{
Q_D(QFileInfo);
- detach();
- d->data->cache_enabled = enable;
+ d->cache_enabled = enable;
}
/*!
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 7e82aed..f0128b1 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -44,7 +44,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlist.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
QT_BEGIN_HEADER
@@ -166,10 +166,20 @@ public:
#endif
protected:
- QScopedPointer<QFileInfoPrivate> d_ptr;
+ QSharedDataPointer<QFileInfoPrivate> d_ptr;
private:
- Q_DECLARE_PRIVATE(QFileInfo)
+ inline QFileInfoPrivate* d_func()
+ {
+ detach();
+ return const_cast<QFileInfoPrivate *>(d_ptr.constData());
+ }
+
+ inline const QFileInfoPrivate* d_func() const
+ {
+ return d_ptr.constData();
+ }
};
+
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
#ifdef QT3_SUPPORT
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 306ffe1..b9b1092 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -57,71 +57,83 @@
#include "qabstractfileengine.h"
#include "qdatetime.h"
#include "qatomic.h"
+#include "qshareddata.h"
QT_BEGIN_NAMESPACE
-class QFileInfoPrivate
+class QFileInfoPrivate : public QSharedData
{
public:
- QFileInfoPrivate(const QFileInfo *copy=0);
- ~QFileInfoPrivate();
- void initFileEngine(const QString &);
+ enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04,
+ CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40,
+ CachedSize =0x08, CachedPerms=0x80 };
+
+ inline QFileInfoPrivate()
+ : QSharedData(), fileEngine(0),
+ cachedFlags(0),
+ isDefaultConstructed(true),
+ cache_enabled(true), fileFlags(0), fileSize(0)
+ {}
+ inline QFileInfoPrivate(const QFileInfoPrivate &copy)
+ : QSharedData(copy), fileEngine(QAbstractFileEngine::create(copy.fileName)),
+ fileName(copy.fileName),
+ cachedFlags(0),
+#ifndef QT_NO_FSFILEENGINE
+ isDefaultConstructed(false),
+#else
+ isDefaultConstructed(!fileEngine),
+#endif
+ cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
+ {}
+ inline QFileInfoPrivate(const QString &file)
+ : QSharedData(), fileEngine(QAbstractFileEngine::create(file)),
+ fileName(file),
+ cachedFlags(0),
+#ifndef QT_NO_FSFILEENGINE
+ isDefaultConstructed(false),
+#else
+ isDefaultConstructed(!fileEngine),
+#endif
+ cache_enabled(true), fileFlags(0), fileSize(0)
+ {
+ }
+
+ inline void clearFlags() const {
+ fileFlags = 0;
+ cachedFlags = 0;
+ if (fileEngine)
+ (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh);
+ }
+ inline void clear() {
+ clearFlags();
+ for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
+ fileNames[i].clear();
+ fileOwners[1].clear();
+ fileOwners[0].clear();
+ }
uint getFileFlags(QAbstractFileEngine::FileFlags) const;
QDateTime &getFileTime(QAbstractFileEngine::FileTime) const;
QString getFileName(QAbstractFileEngine::FileName) const;
QString getFileOwner(QAbstractFileEngine::FileOwner own) const;
- enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04,
- CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40,
- CachedSize =0x08, CachedPerms=0x80 };
- struct Data {
- inline Data()
- : ref(1), fileEngine(0),
- cachedFlags(0), cache_enabled(1), fileFlags(0), fileSize(0)
- {}
- inline Data(const Data &copy)
- : ref(1), fileEngine(QAbstractFileEngine::create(copy.fileName)),
- fileName(copy.fileName),
- cachedFlags(0), cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
- {}
- inline ~Data() { delete fileEngine; }
- inline void clearFlags() {
- fileFlags = 0;
- cachedFlags = 0;
- if (fileEngine)
- (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh);
- }
- inline void clear() {
- clearFlags();
- for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
- fileNames[i].clear();
- fileOwners[1].clear();
- fileOwners[0].clear();
- }
- mutable QAtomicInt ref;
+ QScopedPointer<QAbstractFileEngine> const fileEngine;
- QAbstractFileEngine *fileEngine;
- mutable QString fileName;
- mutable QString fileNames[QAbstractFileEngine::NFileNames];
- mutable QString fileOwners[2];
+ mutable QString fileName;
+ mutable QString fileNames[QAbstractFileEngine::NFileNames];
+ mutable QString fileOwners[2];
- mutable uint cachedFlags : 31;
- mutable uint cache_enabled : 1;
- mutable uint fileFlags;
- mutable qint64 fileSize;
- mutable QDateTime fileTimes[3];
- inline bool getCachedFlag(uint c) const
- { return cache_enabled ? (cachedFlags & c) : 0; }
- inline void setCachedFlag(uint c)
- { if (cache_enabled) cachedFlags |= c; }
- } *data;
- inline void reset() {
- detach();
- data->clear();
- }
- void detach();
+ mutable uint cachedFlags : 30;
+ bool const isDefaultConstructed : 1; // QFileInfo is a default constructed instance
+ bool cache_enabled : 1;
+ mutable uint fileFlags;
+ mutable qint64 fileSize;
+ mutable QDateTime fileTimes[3];
+ inline bool getCachedFlag(uint c) const
+ { return cache_enabled ? (cachedFlags & c) : 0; }
+ inline void setCachedFlag(uint c) const
+ { if (cache_enabled) cachedFlags |= c; }
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 56a03c9..74c24b5 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3399,16 +3399,20 @@ QString QUrlPrivate::canonicalHost() const
if (host.contains(QLatin1Char(':'))) {
// This is an IP Literal, use _IPLiteral to validate
QByteArray ba = host.toLatin1();
+ bool needsBraces = false;
if (!ba.startsWith('[')) {
// surround the IP Literal with [ ] if it's not already done so
ba.reserve(ba.length() + 2);
ba.prepend('[');
ba.append(']');
+ needsBraces = true;
}
const char *ptr = ba.constData();
if (!_IPLiteral(&ptr))
that->host.clear();
+ else if (needsBraces)
+ that->host = QString::fromLatin1(ba.toLower());
else
that->host = host.toLower();
} else {
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index a95e944..12a820f 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -58,35 +58,32 @@ QT_BEGIN_NAMESPACE
\inherits Image
\since 4.7
\ingroup basic-visual-elements
-
- The AnimatedImage element provides for playing animations stored as images containing a series of frames,
- such as GIF files.
-
+
+ The AnimatedImage element extends the features of the \l Image element, providing
+ a way to play animations stored as images containing a series of frames,
+ such as those stored in GIF files.
+
+ Information about the current frame and totla length of the animation can be
+ obtained using the \l currentFrame and \l frameCount properties. You can
+ start, pause and stop the animation by changing the values of the \l playing
+ and \l paused properties.
+
The full list of supported formats can be determined with QMovie::supportedFormats().
- \table
- \row
- \o \image animatedimageitem.gif
- \o
- \qml
- import Qt 4.7
+ \section1 Example Usage
- Rectangle {
- width: animation.width; height: animation.height + 8
+ \beginfloatleft
+ \image animatedimageitem.gif
+ \endfloat
- AnimatedImage { id: animation; source: "animation.gif" }
+ The following QML shows how to display an animated image and obtain information
+ about its state, such as the current frame and total number of frames.
+ The result is an animated image with a simple progress indicator underneath it.
- Rectangle {
- property int frames: animation.frameCount
+ \clearfloat
+ \snippet doc/src/snippets/declarative/animatedimage.qml document
- width: 4; height: 8
- x: (animation.width - width) * animation.currentFrame / frames
- y: animation.height
- color: "red"
- }
- }
- \endqml
- \endtable
+ \sa BorderImage, Image
*/
QDeclarativeAnimatedImage::QDeclarativeAnimatedImage(QDeclarativeItem *parent)
@@ -104,7 +101,8 @@ QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage()
\qmlproperty bool AnimatedImage::paused
This property holds whether the animated image is paused.
- Defaults to false, and can be set to true when you want to pause.
+ By default, this property is false. Set it to true when you want to pause
+ the animation.
*/
bool QDeclarativeAnimatedImage::isPaused() const
{
@@ -128,7 +126,8 @@ void QDeclarativeAnimatedImage::setPaused(bool pause)
\qmlproperty bool AnimatedImage::playing
This property holds whether the animated image is playing.
- Defaults to true, so as to start playing immediately.
+ By defaults, this property is true, meaning that the animation
+ will start playing immediately.
*/
bool QDeclarativeAnimatedImage::isPlaying() const
{
@@ -156,9 +155,11 @@ void QDeclarativeAnimatedImage::setPlaying(bool play)
\qmlproperty int AnimatedImage::currentFrame
\qmlproperty int AnimatedImage::frameCount
- currentFrame is the frame that is currently visible. Watching when this changes can
- allow other things to animate at the same time as the image. frameCount is the number
- of frames in the animation. For some animation formats, frameCount is unknown and set to zero.
+ currentFrame is the frame that is currently visible. By monitoring this property
+ for changes, you can animate other items at the same time as the image.
+
+ frameCount is the number of frames in the animation. For some animation formats,
+ frameCount is unknown and has a value of zero.
*/
int QDeclarativeAnimatedImage::currentFrame() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index f16770b..c58a08d 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -56,27 +56,97 @@ QT_BEGIN_NAMESPACE
\brief The BorderImage element provides an image that can be used as a border.
\inherits Item
\since 4.7
- \ingroup qm-basic-visual-elements
+ \ingroup qml-basic-visual-elements
- A BorderImage breaks an image into 9 sections, as shown below:
+ The BorderImage element is used to create borders out of images by scaling or tiling
+ parts of each image.
+
+ A BorderImage element breaks a source image, specified using the \l url property,
+ into 9 regions, as shown below:
\image declarative-scalegrid.png
- When the image is scaled:
+ When the image is scaled, regions of the source image are scaled or tiled to
+ create the displayed border image in the following way:
+
\list
- \i the corners (sections 1, 3, 7, and 9) are not scaled at all
- \i sections 2 and 8 are scaled according to \l{BorderImage::horizontalTileMode}{horizontalTileMode}
- \i sections 4 and 6 are scaled according to \l{BorderImage::verticalTileMode}{verticalTileMode}
- \i the middle (section 5) is scaled according to both \l{BorderImage::horizontalTileMode}{horizontalTileMode} and \l{BorderImage::verticalTileMode}{verticalTileMode}
+ \i The corners (regions 1, 3, 7, and 9) are not scaled at all.
+ \i Regions 2 and 8 are scaled according to
+ \l{BorderImage::horizontalTileMode}{horizontalTileMode}.
+ \i Regions 4 and 6 are scaled according to
+ \l{BorderImage::verticalTileMode}{verticalTileMode}.
+ \i The middle (region 5) is scaled according to both
+ \l{BorderImage::horizontalTileMode}{horizontalTileMode} and
+ \l{BorderImage::verticalTileMode}{verticalTileMode}.
\endlist
- Examples:
- \snippet snippets/declarative/borderimage.qml 0
+ The regions of the image are defined using the \l border property group, which
+ describes the distance from each edge of the source image to use as a border.
+
+ \section1 Example Usage
+
+ The following examples show the effects of the different modes on an image.
+ Guide lines are overlaid onto the image to show the different regions of the
+ image as described above.
+
+ \beginfloatleft
+ \image qml-borderimage-normal-image.png
+ \endfloat
+
+ An unscaled image is displayed using an Image element. The \l border property is
+ used to determine the parts of the image that will lie inside the unscaled corner
+ areas and the parts that will be stretched horizontally and vertically.
+
+ \snippet doc/src/snippets/declarative/borderimage/normal-image.qml normal image
+
+ \clearfloat
+ \beginfloatleft
+ \image qml-borderimage-scaled.png
+ \endfloat
+
+ A BorderImage element is used to display the image, and it is given a size that is
+ larger than the original image. Since the \l horizontalTileMode property is set to
+ \l{BorderImage::horizontalTileMode}{BorderImage.Stretch}, the parts of image in
+ regions 2 and 8 are stretched horizontally. Since the \l verticalTileMode property
+ is set to \l{BorderImage::verticalTileMode}{BorderImage.Stretch}, the parts of image
+ in regions 4 and 6 are stretched vertically.
+
+ \snippet doc/src/snippets/declarative/borderimage/borderimage-scaled.qml scaled border image
+
+ \clearfloat
+ \beginfloatleft
+ \image qml-borderimage-tiled.png
+ \endfloat
- \image BorderImage.png
+ Again, a large BorderImage element is used to display the image. With the
+ \l horizontalTileMode property set to \l{BorderImage::horizontalTileMode}{BorderImage.Repeat},
+ the parts of image in regions 2 and 8 are tiled so that they fill the space at the
+ top and bottom of the element. Similarly, the \l verticalTileMode property is set to
+ \l{BorderImage::verticalTileMode}{BorderImage.Repeat}, the parts of image in regions
+ 4 and 6 are tiled so that they fill the space at the left and right of the element.
- The \l{declarative/imageelements/borderimage}{BorderImage example} shows how a BorderImage can be used to simulate a shadow effect on a
- rectangular item.
+ \snippet doc/src/snippets/declarative/borderimage/borderimage-tiled.qml tiled border image
+
+ \clearfloat
+ In some situations, the width of regions 2 and 8 may not be an exact multiple of the width
+ of the corresponding regions in the source image. Similarly, the height of regions 4 and 6
+ may not be an exact multiple of the height of the corresponding regions. It can be useful
+ to use \l{BorderImage::horizontalTileMode}{BorderImage.Round} instead of
+ \l{BorderImage::horizontalTileMode}{BorderImage.Repeat} in cases like these.
+
+ The \l{declarative/imageelements/borderimage}{BorderImage example} shows how a BorderImage
+ can be used to simulate a shadow effect on a rectangular item.
+
+ \section1 Quality and Performance
+
+ By default, any scaled regions of the image are rendered without smoothing to improve
+ rendering speed. Setting the \l smooth property improves rendering quality of scaled
+ regions, but may slow down rendering.
+
+ The source image may not be loaded instantaneously, depending on its original location.
+ Loading progress can be monitored with the \l progress property.
+
+ \sa Image, AnimatedImage
*/
QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent)
@@ -93,7 +163,8 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
/*!
\qmlproperty enumeration BorderImage::status
- This property holds the status of image loading. It can be one of:
+ This property describes the status of image loading. It can be one of:
+
\list
\o BorderImage.Null - no image has been set
\o BorderImage.Ready - the image has been loaded
@@ -121,20 +192,28 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
the image is displayed at its natural size, this property has no visual or
performance effect.
+ By default, this property is set to false.
+
\note Generally scaling artifacts are only visible if the image is stationary on
the screen. A common pattern when animating an image is to disable smooth
- filtering at the beginning of the animation and reenable it at the conclusion.
+ filtering at the beginning of the animation and enable it at the conclusion.
*/
/*!
\qmlproperty url BorderImage::source
- BorderImage can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.
+ This property holds the URL that refers to the source image.
+
+ BorderImage can handle any image format supported by Qt, loaded from any
+ URL scheme supported by Qt.
- It can also handle .sci files, which are a QML-specific format. A .sci file uses a simple text-based format that specifies
- the borders, the image file and the tile rules.
+ It can also handle .sci files, which are a QML-specific format. A .sci
+ file uses a simple text-based format that specifies the borders, the
+ image file and the tile rules.
+
+ The following .sci file sets the borders to 10 on each side for the
+ image \c picture.png:
- The following .sci file sets the borders to 10 on each side for the image \c picture.png:
\qml
border.left: 10
border.top: 10
@@ -245,17 +324,21 @@ void QDeclarativeBorderImage::load()
\qmlproperty int BorderImage::border.top
\qmlproperty int BorderImage::border.bottom
- The 4 border lines (2 horizontal and 2 vertical) break the image into 9 sections, as shown below:
+ The 4 border lines (2 horizontal and 2 vertical) break the image into 9 sections,
+ as shown below:
\image declarative-scalegrid.png
- Each border line (left, right, top, and bottom) specifies an offset in pixels from the respective side.
+ Each border line (left, right, top, and bottom) specifies an offset in pixels
+ from the respective edge of the source image. By default, each border line has
+ a value of 0.
+
+ For example, the following definition sets the bottom line 10 pixels up from
+ the bottom of the image:
- For example:
\qml
border.bottom: 10
\endqml
- sets the bottom line 10 pixels up from the bottom of the image.
The border lines can also be specified using a
\l {BorderImage::source}{.sci file}.
@@ -274,7 +357,7 @@ QDeclarativeScaleGrid *QDeclarativeBorderImage::border()
This property describes how to repeat or stretch the middle parts of the border image.
\list
- \o BorderImage.Stretch - Scale the image to fit to the available area.
+ \o BorderImage.Stretch - Scales the image to fit to the available area.
\o BorderImage.Repeat - Tile the image until there is no more space. May crop the last image.
\o BorderImage.Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
\endlist
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index b302393..062bbfb 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -350,24 +350,34 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
\brief The Flickable item provides a surface that can be "flicked".
\inherits Item
- Flickable places its children on a surface that can be dragged and flicked.
+ The Flickable item places its children on a surface that can be dragged
+ and flicked, causing the view onto the child items to scroll. This
+ behavior forms the basis of Items that are designed to show large numbers
+ of child items, such as \l ListView and \l GridView.
- \code
- import Qt 4.7
+ In traditional user interfaces, views can be scrolled using standard
+ controls, such as scroll bars and arrow buttons. In some situations, it
+ is also possible to drag the view directly by pressing and holding a
+ mouse button while moving the cursor. In touch-based user interfaces,
+ this dragging action is often complemented with a flicking action, where
+ scrolling continues after the user has stopped touching the view.
- Flickable {
- width: 200; height: 200
- contentWidth: image.width; contentHeight: image.height
+ Flickable does not automatically clip its contents. If it is not used as
+ a full-screen item, you should consider setting the \l{Item::}{clip} property
+ to true.
- Image { id: image; source: "bigImage.png" }
- }
- \endcode
+ \section1 Example Usage
+
+ \beginfloatright
+ \inlineimage flickable.gif
+ \endfloat
- \image flickable.gif
+ The following example shows a large
- Flickable does not automatically clip its contents. If
- it is not full-screen it is likely that \l {Item::clip}{clip} should be set
- to \c true.
+ \clearfloat
+ \snippet doc/src/snippets/declarative/flickable.qml document
+
+ \section1 Limitations
\note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by
\c id. Use \c parent instead.
@@ -491,12 +501,15 @@ void QDeclarativeFlickable::setContentY(qreal pos)
/*!
\qmlproperty bool Flickable::interactive
- This property holds whether the user can interact with the Flickable. A user
- cannot drag or flick a Flickable that is not interactive.
+ This property describes whether the user can interact with the Flickable.
+ A user cannot drag or flick a Flickable that is not interactive.
+
+ By default, this property is true.
This property is useful for temporarily disabling flicking. This allows
- special interaction with Flickable's children: for example, you might want to
- freeze a flickable map while scrolling through a pop-up dialog that is a child of the Flickable.
+ special interaction with Flickable's children; for example, you might want
+ to freeze a flickable map while scrolling through a pop-up dialog that
+ is a child of the Flickable.
*/
bool QDeclarativeFlickable::isInteractive() const
{
@@ -1333,8 +1346,8 @@ bool QDeclarativeFlickable::isFlicking() const
\qmlproperty bool Flickable::flickingHorizontally
\qmlproperty bool Flickable::flickingVertically
- These properties hold whether the view is currently moving horizontally
- or vertically due to the user flicking the view.
+ These properties describe whether the view is currently moving horizontally,
+ vertically or in either direction, due to the user flicking the view.
*/
bool QDeclarativeFlickable::isFlickingHorizontally() const
{
@@ -1386,8 +1399,9 @@ bool QDeclarativeFlickable::isMoving() const
\qmlproperty bool Flickable::movingHorizontally
\qmlproperty bool Flickable::movingVertically
- These properties hold whether the view is currently moving horizontally
- or vertically due to the user either dragging or flicking the view.
+ These properties describe whether the view is currently moving horizontally,
+ vertically or in either direction, due to the user either dragging or
+ flicking the view.
*/
bool QDeclarativeFlickable::isMovingHorizontally() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index 69dd66a..4ecf87b 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -71,31 +71,40 @@ public:
\qmlclass Flipable QDeclarativeFlipable
\since 4.7
\ingroup qml-basic-interaction-elements
-
\brief The Flipable item provides a surface that can be flipped.
\inherits Item
Flipable is an item that can be visibly "flipped" between its front and
- back sides. It is used together with \l Rotation and \l {State}/\l {Transition} to
- produce a flipping effect.
+ back sides, like a card. It is used together with \l Rotation, \l State
+ and \l Transition elements to produce a flipping effect.
+
+ The \l front and \l back properties are used to hold the items that are
+ shown respectively on the front and back sides of the flipable item.
- Here is a Flipable that flips whenever it is clicked:
+ \section1 Example Usage
- \snippet doc/src/snippets/declarative/flipable.qml 0
+ \beginfloatright
+ \inlineimage flipable.gif
+ \endfloat
- \image flipable.gif
+ The following example shows a Flipable item that flips whenever it is
+ clicked, rotating about the y-axis.
The \l Rotation element is used to specify the angle and axis of the flip.
- When \c flipped is \c true, the item changes to the "back" state, where
+ When \c flipped is true, the item changes to the "back" state, where
the angle is changed to 180 degrees to produce the flipping effect.
- Finally, the \l Transition creates the animation that changes the
- angle over one second: when the item changes between its "back" and
+
+ \clearfloat
+ \snippet doc/src/snippets/declarative/flipable/flipable-snippet.qml 0
+
+ The \l Transition creates the animation that changes the angle over the
+ duration of one second. When the item changes between its "back" and
default states, the NumberAnimation animates the angle between
its old and new values.
See the \l {QML States} and \l {QML Animation} documentation for more
details on state changes and how animations work within transitions.
-
+
\sa {declarative/ui-components/flipable}{Flipable example}
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 7a88e78..9cd9ad6 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -51,34 +51,46 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Image QDeclarativeImage
\since 4.7
- \ingroup qml-vasic-visual-elements
-
- \brief The Image element allows you to add bitmaps to a scene.
+ \ingroup qml-basic-visual-elements
+ \brief The Image element displays an image in a declarative user interface
\inherits Item
- An Image element displays a specified \l source image:
+ The Image element is used to display images in a declarative user interface.
- \table
- \row
- \o \image declarative-qtlogo.png
- \o \qml
- import Qt 4.7
+ The source of the image is specified as a URL using the \l source property.
+ Images can be supplied in any of the standard image formats supported by Qt,
+ including bitmap formats such as PNG and JPEG, and vector graphics formats
+ such as SVG. If you need to display animated images, use the \l AnimatedImage
+ element.
- Image { source: "qtlogo.png" }
- \endqml
- \endtable
+ If the \l{Item::width}{width} and \l{Item::height}{height} properties are not
+ specified, the Image element automatically uses the size of the loaded image.
+ By default, specifying the width and height of the element causes the image
+ to be scaled to that size. This behavior can be changed by setting the
+ \l fillMode property, allowing the image to be stretched and tiled instead.
+
+ \section1 Example Usage
+
+ The following example shows the simplest usage of the Image element.
+
+ \snippet doc/src/snippets/declarative/image.qml document
+
+ \beginfloatleft
+ \image declarative-qtlogo.png
+ \endfloat
+
+ \clearfloat
- If the \l {Item::width}{width} and \l{Item::height}{height} properties are not specified,
- the Image element is automatically sized to the loaded image. Image elements can be
- stretched and tiled using the \l fillMode property.
+ \section1 Performance
By default, locally available images are loaded immediately, and the user interface
is blocked until loading is complete. If a large image is to be loaded, it may be
preferable to load the image in a low priority thread, by enabling the \l asynchronous
property.
- If the image is from a network rather than a local resource, it is automatically loaded
- asynchronously, and the \l progress and \l status properties are updated as appropriate.
+ If the image is obtained from a network rather than a local resource, it is
+ automatically loaded asynchronously, and the \l progress and \l status properties
+ are updated as appropriate.
Images are cached and shared internally, so if several Image elements have the same \l source,
only one copy of the image will be loaded.
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index aca2bb7..11f9179 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -830,259 +830,259 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
*/
/*!
- \qmlsignal Keys::onPressed(event)
+ \qmlsignal Keys::onPressed(KeyEvent event)
This handler is called when a key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onReleased(event)
+ \qmlsignal Keys::onReleased(KeyEvent event)
This handler is called when a key has been released. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit0Pressed(event)
+ \qmlsignal Keys::onDigit0Pressed(KeyEvent event)
This handler is called when the digit '0' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit1Pressed(event)
+ \qmlsignal Keys::onDigit1Pressed(KeyEvent event)
This handler is called when the digit '1' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit2Pressed(event)
+ \qmlsignal Keys::onDigit2Pressed(KeyEvent event)
This handler is called when the digit '2' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit3Pressed(event)
+ \qmlsignal Keys::onDigit3Pressed(KeyEvent event)
This handler is called when the digit '3' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit4Pressed(event)
+ \qmlsignal Keys::onDigit4Pressed(KeyEvent event)
This handler is called when the digit '4' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit5Pressed(event)
+ \qmlsignal Keys::onDigit5Pressed(KeyEvent event)
This handler is called when the digit '5' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit6Pressed(event)
+ \qmlsignal Keys::onDigit6Pressed(KeyEvent event)
This handler is called when the digit '6' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit7Pressed(event)
+ \qmlsignal Keys::onDigit7Pressed(KeyEvent event)
This handler is called when the digit '7' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit8Pressed(event)
+ \qmlsignal Keys::onDigit8Pressed(KeyEvent event)
This handler is called when the digit '8' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDigit9Pressed(event)
+ \qmlsignal Keys::onDigit9Pressed(KeyEvent event)
This handler is called when the digit '9' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onLeftPressed(event)
+ \qmlsignal Keys::onLeftPressed(KeyEvent event)
This handler is called when the Left arrow has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onRightPressed(event)
+ \qmlsignal Keys::onRightPressed(KeyEvent event)
This handler is called when the Right arrow has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onUpPressed(event)
+ \qmlsignal Keys::onUpPressed(KeyEvent event)
This handler is called when the Up arrow has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDownPressed(event)
+ \qmlsignal Keys::onDownPressed(KeyEvent event)
This handler is called when the Down arrow has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onAsteriskPressed(event)
+ \qmlsignal Keys::onAsteriskPressed(KeyEvent event)
This handler is called when the Asterisk '*' has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onEscapePressed(event)
+ \qmlsignal Keys::onEscapePressed(KeyEvent event)
This handler is called when the Escape key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onReturnPressed(event)
+ \qmlsignal Keys::onReturnPressed(KeyEvent event)
This handler is called when the Return key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onEnterPressed(event)
+ \qmlsignal Keys::onEnterPressed(KeyEvent event)
This handler is called when the Enter key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onDeletePressed(event)
+ \qmlsignal Keys::onDeletePressed(KeyEvent event)
This handler is called when the Delete key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onSpacePressed(event)
+ \qmlsignal Keys::onSpacePressed(KeyEvent event)
This handler is called when the Space key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onBackPressed(event)
+ \qmlsignal Keys::onBackPressed(KeyEvent event)
This handler is called when the Back key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onCancelPressed(event)
+ \qmlsignal Keys::onCancelPressed(KeyEvent event)
This handler is called when the Cancel key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onSelectPressed(event)
+ \qmlsignal Keys::onSelectPressed(KeyEvent event)
This handler is called when the Select key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onYesPressed(event)
+ \qmlsignal Keys::onYesPressed(KeyEvent event)
This handler is called when the Yes key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onNoPressed(event)
+ \qmlsignal Keys::onNoPressed(KeyEvent event)
This handler is called when the No key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onContext1Pressed(event)
+ \qmlsignal Keys::onContext1Pressed(KeyEvent event)
This handler is called when the Context1 key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onContext2Pressed(event)
+ \qmlsignal Keys::onContext2Pressed(KeyEvent event)
This handler is called when the Context2 key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onContext3Pressed(event)
+ \qmlsignal Keys::onContext3Pressed(KeyEvent event)
This handler is called when the Context3 key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onContext4Pressed(event)
+ \qmlsignal Keys::onContext4Pressed(KeyEvent event)
This handler is called when the Context4 key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onCallPressed(event)
+ \qmlsignal Keys::onCallPressed(KeyEvent event)
This handler is called when the Call key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onHangupPressed(event)
+ \qmlsignal Keys::onHangupPressed(KeyEvent event)
This handler is called when the Hangup key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onFlipPressed(event)
+ \qmlsignal Keys::onFlipPressed(KeyEvent event)
This handler is called when the Flip key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onMenuPressed(event)
+ \qmlsignal Keys::onMenuPressed(KeyEvent event)
This handler is called when the Menu key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onVolumeUpPressed(event)
+ \qmlsignal Keys::onVolumeUpPressed(KeyEvent event)
This handler is called when the VolumeUp key has been pressed. The \a event
parameter provides information about the event.
*/
/*!
- \qmlsignal Keys::onVolumeDownPressed(event)
+ \qmlsignal Keys::onVolumeDownPressed(KeyEvent event)
This handler is called when the VolumeDown key has been pressed. The \a event
parameter provides information about the event.
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 2eae0af..177c5b3 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1432,7 +1432,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
to set \e {clip: true} in order to have the out of view items clipped
nicely.
- \sa {Data Models}, GridView, {declarative/modelviews/listview}{ListView examples}
+ \sa {QML Data Models}, GridView, {declarative/modelviews/listview}{ListView examples}
*/
QDeclarativeListView::QDeclarativeListView(QDeclarativeItem *parent)
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index ec01549..5516611 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -250,7 +250,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
- \qmlsignal MouseArea::onClicked(mouse)
+ \qmlsignal MouseArea::onClicked(MouseEvent mouse)
This handler is called when there is a click. A click is defined as a press followed by a release,
both inside the MouseArea (pressing, moving outside the MouseArea, and then moving back inside and
@@ -263,7 +263,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
- \qmlsignal MouseArea::onPressed(mouse)
+ \qmlsignal MouseArea::onPressed(MouseEvent mouse)
This handler is called when there is a press.
The \l {MouseEvent}{mouse} parameter provides information about the press, including the x and y
@@ -277,7 +277,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
- \qmlsignal MouseArea::onReleased(mouse)
+ \qmlsignal MouseArea::onReleased(MouseEvent mouse)
This handler is called when there is a release.
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
@@ -287,7 +287,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
- \qmlsignal MouseArea::onPressAndHold(mouse)
+ \qmlsignal MouseArea::onPressAndHold(MouseEvent mouse)
This handler is called when there is a long press (currently 800ms).
The \l {MouseEvent}{mouse} parameter provides information about the press, including the x and y
@@ -297,7 +297,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
- \qmlsignal MouseArea::onDoubleClicked(mouse)
+ \qmlsignal MouseArea::onDoubleClicked(MouseEvent mouse)
This handler is called when there is a double-click (a press followed by a release followed by a press).
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 77b26b9..e2a373f 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -323,58 +323,65 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
/*!
\qmlclass Column QDeclarativeColumn
- \ingroup qml-positioning-elements
- \since 4.7
+ \ingroup qml-positioning-elements
+ \since 4.7
\brief The Column item arranges its children vertically.
\inherits Item
The Column item positions its child items so that they are vertically
- aligned and not overlapping. Spacing between items can be added.
+ aligned and not overlapping.
- The below example positions differently shaped rectangles using a Column.
- \table
- \row
- \o \image verticalpositioner_example.png
- \o
- \qml
-Column {
- spacing: 2
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
-}
- \endqml
- \endtable
+ Spacing between items can be added using the \l spacing property.
+ Transitions can be used for cases where items managed by a Column are
+ added or moved. These are stored in the \l add and \l move properties
+ respectively.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example positions differently shaped rectangles using a Column
+ item.
+
+ \image verticalpositioner_example.png
+
+ \snippet doc/src/snippets/declarative/column/vertical-positioner.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Column item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Column item.
+
+ The use of transitions with positioners is described in more detail in the
+ \l{Using QML Positioner and Repeater Items#Using Transitions}{Using QML
+ Positioner and Repeater Items} document.
- Column also provides for transitions to be set when items are added, moved,
- or removed in the positioner. Adding and removing apply both to items which are deleted
- or have their position in the document changed so as to no longer be children of the positioner,
- as well as to items which have their opacity set to or from zero so as to appear or disappear.
+ \image verticalpositioner_transition.gif
- \table
- \row
- \o \image verticalpositioner_transition.gif
- \o
\qml
-Column {
- spacing: 2
- add: ...
- move: ...
- ...
-}
+ Column {
+ spacing: 2
+ add: ...
+ move: ...
+ ...
+ }
\endqml
- \endtable
+
+ \section1 Limitations
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour. If you need to perform any of these
+ positioner may exhibit strange behavior. If you need to perform any of these
actions, consider positioning the items without the use of a Column.
Items with a width or height of 0 will not be positioned.
- \sa Row, {declarative/positioners}{Positioners example}
+ \sa Row, Grid, Flow, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Column::add
@@ -382,55 +389,47 @@ Column {
This property holds the transition to be applied when adding an
item to the positioner. The transition will only be applied to the
added item(s). Positioner transitions will only affect the
- position (x,y) of items.
-
- Added can mean that either the object has been created or
- reparented, and thus is now a child or the positioner, or that the
- object has had its opacity increased from zero, and thus is now
- visible.
+ position (x, y) of items.
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+ \sa move
*/
/*!
\qmlproperty Transition Column::move
This property holds the transition to apply when moving an item
within the positioner. Positioner transitions will only affect
- the position (x,y) of items.
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
- This can happen when other items are added or removed from the
- positioner, or when items resize themselves.
+ \image positioner-move.gif
- \table
- \row
- \o \image positioner-move.gif
- \o
\qml
-Column {
- move: Transition {
- NumberAnimation {
- properties: "y"
- easing.type: Easing.OutBounce
+ Column {
+ move: Transition {
+ NumberAnimation {
+ properties: "y"
+ easing.type: Easing.OutBounce
+ }
}
}
-}
\endqml
- \endtable
+
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Column::spacing
- spacing is the amount in pixels left empty between each adjacent
- item, and defaults to 0.
-
- The below example places a \l Grid containing a red, a blue and a
- green rectangle on a gray background. The area the grid positioner
- occupies is colored white. The top positioner has the default of no spacing,
- and the bottom positioner has its spacing set to 2.
-
- \image spacing_a.png
- \image spacing_b.png
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
+ \sa Grid::spacing
*/
QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Vertical, parent)
@@ -484,29 +483,38 @@ void QDeclarativeColumn::reportConflictingAnchors()
/*!
\qmlclass Row QDeclarativeRow
- \ingroup qml-positioning-elements
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Row item arranges its children horizontally.
\inherits Item
- The Row item positions its child items so that they are
- horizontally aligned and not overlapping.
+ The Row item positions its child items so that they are horizontally
+ aligned and not overlapping.
Use \l spacing to set the spacing between items in a Row, and use the
\l add and \l move properties to set the transitions that should be applied
when items are added to, removed from, or re-positioned within the Row.
- The below example lays out differently shaped rectangles using a Row.
- \qml
-Row {
- spacing: 2
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
-}
- \endqml
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example lays out differently shaped rectangles using a Row.
+
\image horizontalpositioner_example.png
+ \snippet doc/src/snippets/declarative/row/row.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Grid item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Row item.
+
+ \section1 Limitations
+
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
@@ -516,56 +524,54 @@ Row {
Items with a width or height of 0 will not be positioned.
- \sa Column, {declarative/positioners}{Positioners example}
+ \sa Column, Grid, Flow, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Row::add
- This property holds the transition to apply when adding an item to the positioner.
- The transition will only be applied to the added item(s).
- Positioner transitions will only affect the position (x,y) of items.
-
- An object is considered to be added to the positioner if it has been
- created or reparented and thus is now a child or the positioner, or if the
- object has had its opacity increased from zero, and thus is now
- visible.
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
*/
/*!
\qmlproperty Transition Row::move
- This property holds the transition to apply when moving an item
- within the positioner. Positioner transitions will only affect
- the position (x,y) of items.
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
- This can happen when other items are added or removed from the
- positioner, or when items resize themselves.
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
\qml
-Row {
- id: positioner
- move: Transition {
- NumberAnimation {
- properties: "x"
- ease: "easeOutBounce"
+ Row {
+ id: positioner
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ ease: "easeOutBounce"
+ }
}
}
-}
\endqml
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Row::spacing
- spacing is the amount in pixels left empty between each adjacent
- item, and defaults to 0.
-
- The below example places a \l Grid containing a red, a blue and a
- green rectangle on a gray background. The area the grid positioner
- occupies is colored white. The top positioner has the default of no spacing,
- and the bottom positioner has its spacing set to 2.
-
- \image spacing_a.png
- \image spacing_b.png
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
+ \sa Grid::spacing
*/
QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Horizontal, parent)
@@ -618,47 +624,46 @@ void QDeclarativeRow::reportConflictingAnchors()
/*!
\qmlclass Grid QDeclarativeGrid
- \ingroup qml-positioning-elements
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Grid item positions its children in a grid.
\inherits Item
The Grid item positions its child items so that they are
aligned in a grid and are not overlapping.
-
- Spacing can be added
- between child items. It also provides for transitions to be set when items are
- added, moved, or removed in the positioner. Adding and removing apply
- both to items which are deleted or have their position in the
- document changed so as to no longer be children of the positioner, as
- well as to items which have their opacity set to or from zero so
- as to appear or disappear.
-
- A Grid defaults to four columns, and as many rows as
- are necessary to fit all child items. The number of rows
- and/or the number of columns can be constrained by setting the \l rows
- or \l columns properties. The grid positioner calculates a grid with
- rectangular cells of sufficient size to hold all items, and then
- places the items in the cells, going across then down, and
- positioning each item at the (0,0) corner of the cell. The below
- example demonstrates this.
-
- \table
- \row
- \o \image gridLayout_example.png
- \o
- \qml
-Grid {
- columns: 3
- spacing: 2
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
- Rectangle { color: "cyan"; width: 50; height: 50 }
- Rectangle { color: "magenta"; width: 10; height: 10 }
-}
- \endqml
- \endtable
+
+ The grid positioner calculates a grid of rectangular cells of sufficient
+ size to hold all items, placing the items in the cells, from left to right
+ and top to bottom. Each item is positioned in the top-left corner of its
+ cell with position (0, 0).
+
+ A Grid defaults to four columns, and as many rows as are necessary to
+ fit all child items. The number of rows and columns can be constrained
+ by setting the \l rows and \l columns properties.
+
+ Spacing can be added between child items by setting the \l spacing
+ property. The amount of spacing applied will be the same in the
+ horizontal and vertical directions.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example demonstrates this.
+
+ \image gridLayout_example.png
+
+ \snippet doc/src/snippets/declarative/grid/grid.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Grid item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Grid item.
+
+ \section1 Limitations
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
@@ -669,55 +674,62 @@ Grid {
Items with a width or height of 0 will not be positioned.
- \sa Flow, {declarative/positioners}{Positioners example}
+ \sa Flow, Row, Column, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Grid::add
- This property holds the transition to apply when adding an item to the positioner.
- The transition is only applied to the added item(s).
- Positioner transitions will only affect the position (x,y) of items,
- as that is all the positioners affect. To animate other property change
- you will have to do so based on how you have changed those properties.
-
- An object is considered to be added to the positioner if it has been
- created or reparented and thus is now a child or the positioner, or if the
- object has had its opacity increased from zero, and thus is now
- visible.
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
*/
/*!
\qmlproperty Transition Grid::move
- This property holds the transition to apply when moving an item within the positioner.
- Positioner transitions will only affect the position (x,y) of items.
- This can happen when other items are added or removed from the positioner, or
- when items resize themselves.
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
\qml
-Grid {
- move: Transition {
- NumberAnimation {
- properties: "x,y"
- ease: "easeOutBounce"
+ Grid {
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ ease: "easeOutBounce"
+ }
}
}
-}
\endqml
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Grid::spacing
- spacing is the amount in pixels left empty between each adjacent
- item, and defaults to 0.
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
The below example places a Grid containing a red, a blue and a
green rectangle on a gray background. The area the grid positioner
- occupies is colored white. The top positioner has the default of no spacing,
- and the bottom positioner has its spacing set to 2.
+ occupies is colored white. The positioner on the left has the
+ no spacing (the default), and the positioner on the right has
+ a spacing of 6.
- \image spacing_a.png
- \image spacing_b.png
+ \inlineimage qml-grid-no-spacing.png
+ \inlineimage qml-grid-spacing.png
+ \sa rows, columns
*/
QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
@@ -726,7 +738,9 @@ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
/*!
\qmlproperty int Grid::columns
- This property holds the number of columns in the grid.
+
+ This property holds the number of columns in the grid. The default
+ number of columns is 4.
If the grid does not have enough items to fill the specified
number of columns, some columns will be of zero width.
@@ -912,13 +926,43 @@ void QDeclarativeGrid::reportConflictingAnchors()
/*!
\qmlclass Flow QDeclarativeFlow
- \ingroup qml-positioning-elements
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Flow item arranges its children side by side, wrapping as necessary.
\inherits Item
- The Flow item positions its child items so that they are side by side and are
- not overlapping.
+ The Flow item positions its child items like words on a page, wrapping them
+ to create rows or columns of items that do not overlap.
+
+ Spacing between items can be added using the \l spacing property.
+ Transitions can be used for cases where items managed by a Column are
+ added or moved. These are stored in the \l add and \l move properties
+ respectively.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example positions \l Text items within a parent item using
+ a Flow item.
+
+ \image qml-flow-snippet.png
+
+ \snippet doc/src/snippets/declarative/flow.qml flow item
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Flow item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Flow item.
+
+ The use of transitions with positioners is described in more detail in the
+ \l{Using QML Positioner and Repeater Items#Using Transitions}{Using QML
+ Positioner and Repeater Items} document.
+
+ \section1 Limitations
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
@@ -929,38 +973,46 @@ void QDeclarativeGrid::reportConflictingAnchors()
Items with a width or height of 0 will not be positioned.
- \sa Grid, {declarative/positioners}{Positioners example}
+ \sa Column, Row, Grid, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Flow::add
- This property holds the transition to apply when adding an item to the positioner.
- The transition will only be applied to the added item(s).
- Positioner transitions will only affect the position (x,y) of items.
-
- An object is considered to be added to the positioner if it has been
- created or reparented and thus is now a child or the positioner, or if the
- object has had its opacity increased from zero, and thus is now
- visible.
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
*/
/*!
\qmlproperty Transition Flow::move
- This property holds the transition to apply when moving an item within the positioner.
- Positioner transitions will only affect the position (x,y) of items.
- This can happen when other items are added or removed from the positioner, or when items resize themselves.
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
\qml
-Flow {
- id: positioner
- move: Transition {
- NumberAnimation {
- properties: "x,y"
- ease: "easeOutBounce"
+ Flow {
+ id: positioner
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ ease: "easeOutBounce"
+ }
}
}
-}
\endqml
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Flow::spacing
@@ -968,6 +1020,7 @@ Flow {
spacing is the amount in pixels left empty between each adjacent
item, and defaults to 0.
+ \sa Grid::spacing
*/
class QDeclarativeFlowPrivate : public QDeclarativeBasePositionerPrivate
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 97cf05c..00f2848 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -78,9 +78,9 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
The following Repeater creates three instances of a \l Rectangle item within
a \l Row:
- \snippet doc/src/snippets/declarative/repeater.qml import
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml import
\codeline
- \snippet doc/src/snippets/declarative/repeater.qml simple
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml simple
\image repeater-simple.png
@@ -92,7 +92,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
a Repeater to be used inside a layout. For example, the following Repeater's
items are stacked between a red rectangle and a blue rectangle:
- \snippet doc/src/snippets/declarative/repeater.qml layout
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml layout
\image repeater.png
@@ -106,7 +106,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
\table
\row
- \o \snippet doc/src/snippets/declarative/repeater.qml index
+ \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml index
\o \image repeater-index.png
\endtable
@@ -115,7 +115,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
\table
\row
- \o \snippet doc/src/snippets/declarative/repeater.qml modeldata
+ \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml modeldata
\o \image repeater-modeldata.png
\endtable
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index f16af88..fd3a1f7 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1205,7 +1205,7 @@ void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/*!
- \qmlsignal Text::onLinkActivated(link)
+ \qmlsignal Text::onLinkActivated(string link)
This handler is called when the user clicks on a link embedded in the text.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index b1c0fcd..3ac095c 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -555,7 +555,7 @@ QRectF QDeclarativeTextEdit::positionToRectangle(int pos) const
}
/*!
- \qmlmethod int TextEdit::positionAt(x,y)
+ \qmlmethod int TextEdit::positionAt(int x, int y)
Returns the text position closest to pixel position (\a x, \a y).
@@ -1018,7 +1018,7 @@ void QDeclarativeTextEdit::selectWord()
}
/*!
- \qmlmethod void TextEdit::select(start,end)
+ \qmlmethod void TextEdit::select(int start, int end)
Causes the text from \a start to \a end to be selected.
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 74de738..7f58166 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -573,7 +573,7 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
- \qmlmethod object Component::createObject(parent)
+ \qmlmethod object Component::createObject(Item parent)
Creates and returns an object instance of this component that will have the given
\a parent. Returns null if object creation fails.
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index e77a53e..9de5a77 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -272,8 +272,8 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
}
/*!
- \qmlmethod url Qt::resolvedUrl(url)
- Returns \c url resolved relative to the URL of the caller.
+ \qmlmethod url Qt::resolvedUrl(url url)
+ Returns \a url resolved relative to the URL of the caller.
*/
QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
{
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
index f26b54f..1e240d7 100644
--- a/src/declarative/qml/qdeclarativeinclude.cpp
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -173,7 +173,7 @@ void QDeclarativeInclude::callback(QScriptEngine *engine, QScriptValue &callback
}
/*!
-\qmlmethod object Qt::include(url, callback)
+\qmlmethod object Qt::include(string url, jsobject callback)
Include another JavaScript file. This method can only be used from within JavaScript files,
and not regular QML files.
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
index 8c291f2..9b42065 100644
--- a/src/declarative/qml/qdeclarativetypeloader.cpp
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -65,6 +65,9 @@ The QDeclarativeDataLoader invokes callbacks on the QDeclarativeDataBlob as data
/*!
\enum QDeclarativeDataBlob::Status
+This enum describes the status of the data blob.
+
+\list
\o Null The blob has not yet been loaded by a QDeclarativeDataLoader
\o Loading The blob is loading network data. The QDeclarativeDataBlob::setData() callback has not yet been
invoked or has not yet returned.
@@ -73,13 +76,19 @@ only occurs after the QDeclarativeDataBlob::setData() callback has been made, an
dependencies.
\o Complete The blob's data has been loaded and all dependencies are done.
\o Error An error has been set on this blob.
+\endlist
*/
/*!
\enum QDeclarativeDataBlob::Type
+
+This enum describes the type of the data blob.
+
+\list
\o QmlFile This is a QDeclarativeTypeData
\o JavaScriptFile This is a QDeclarativeScriptData
\o QmldirFile This is a QDeclarativeQmldirData
+\endlist
*/
/*!
@@ -215,7 +224,7 @@ void QDeclarativeDataBlob::setError(const QDeclarativeError &errors)
}
/*!
-\override
+\overload
*/
void QDeclarativeDataBlob::setError(const QList<QDeclarativeError> &errors)
{
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 7504c23..f290ab2 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -766,7 +766,7 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
}
/*!
- \qmlclass ListElement
+ \qmlclass ListElement QDeclarativeListElement
\ingroup qml-working-with-data
\since 4.7
\brief The ListElement element defines a data item in a ListModel.
@@ -1247,7 +1247,6 @@ void ModelNode::setObjectValue(const QScriptValue& valuemap) {
}
void ModelNode::setListValue(const QScriptValue& valuelist) {
- QScriptValueIterator it(valuelist);
values.clear();
int size = valuelist.property(QLatin1String("length")).toInt32();
for (int i=0; i<size; i++) {
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
index 498de6d..d9df169 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
@@ -232,7 +232,7 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
emit m_orig->itemsMoved(change.index, change.to, change.count);
break;
case Change::Changed:
- emit m_orig->itemsMoved(change.index, change.to, change.count);
+ emit m_orig->itemsChanged(change.index, change.to, orig->m_roles.keys());
break;
}
}
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index fce4097..e0fc45d 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -62,10 +62,12 @@ public:
struct SpringAnimation {
SpringAnimation()
- : currentValue(0), to(0), velocity(0){}
+ : currentValue(0), to(0), velocity(0), start(0), duration(0) {}
qreal currentValue;
qreal to;
qreal velocity;
+ int start;
+ int duration;
};
QHash<QDeclarativeProperty, SpringAnimation> activeAnimations;
@@ -135,7 +137,6 @@ void QDeclarativeSpringAnimationPrivate::tick(int time)
bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed)
{
-
qreal srcVal = animation.to;
bool stop = false;
@@ -192,18 +193,14 @@ bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &pro
animation.currentValue += moveBy;
if (haveModulus)
animation.currentValue = fmod(animation.currentValue, modulus);
- if (animation.currentValue > animation.to) {
- animation.currentValue = animation.to;
- stop = true;
- }
} else {
animation.currentValue -= moveBy;
if (haveModulus && animation.currentValue < 0.0)
animation.currentValue = fmod(animation.currentValue, modulus) + modulus;
- if (animation.currentValue < animation.to) {
- animation.currentValue = animation.to;
- stop = true;
- }
+ }
+ if (lastTime - animation.start >= animation.duration) {
+ animation.currentValue = animation.to;
+ stop = true;
}
}
@@ -222,8 +219,18 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
mode = Track;
else if (spring > 0.)
mode = Spring;
- else
+ else {
mode = Velocity;
+ QHash<QDeclarativeProperty, SpringAnimation>::iterator it;
+ for (it = activeAnimations.begin(); it != activeAnimations.end(); ++it) {
+ SpringAnimation &animation = *it;
+ animation.start = lastTime;
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (haveModulus && dist > modulus / 2)
+ dist = modulus - fmod(dist, modulus);
+ animation.duration = dist / velocityms;
+ }
+ }
}
/*!
@@ -378,6 +385,7 @@ void QDeclarativeSpringAnimation::setModulus(qreal modulus)
if (d->modulus != modulus) {
d->haveModulus = modulus != 0.0;
d->modulus = modulus;
+ d->updateMode();
emit modulusChanged();
}
}
@@ -429,10 +437,17 @@ void QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions,
QDeclarativeSpringAnimationPrivate::SpringAnimation &animation
= d->activeAnimations[property];
animation.to = d->actions->at(i).toValue.toReal();
+ animation.start = d->lastTime;
if (d->fromIsDefined)
animation.currentValue = d->actions->at(i).fromValue.toReal();
else
animation.currentValue = property.read().toReal();
+ if (d->mode == QDeclarativeSpringAnimationPrivate::Velocity) {
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (d->haveModulus && dist > d->modulus / 2)
+ dist = d->modulus - fmod(dist, d->modulus);
+ animation.duration = dist / d->velocityms;
+ }
}
}
}
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index fc122d2..7a5b8de 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -10900,8 +10900,8 @@ QVariant QGraphicsSimpleTextItem::extension(const QVariant &variant) const
/*!
\class QGraphicsItemGroup
- \brief The QGraphicsItemGroup class provides treating a group of items as
- one.
+ \brief The QGraphicsItemGroup class provides a container that treats
+ a group of items as a single item.
\since 4.2
\ingroup graphicsview-api
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index dbdf0bc..47249d9 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -66,9 +66,10 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
static bool cleanup_function_registered = false;
static QS60PixmapData *firstPixmap = 0;
-static void qt_symbian_register_pixmap(QS60PixmapData *pd)
+// static
+void QS60PixmapData::qt_symbian_register_pixmap(QS60PixmapData *pd)
{
- if(!cleanup_function_registered) {
+ if (!cleanup_function_registered) {
qAddPostRoutine(qt_symbian_release_pixmaps);
cleanup_function_registered = true;
}
@@ -80,7 +81,8 @@ static void qt_symbian_register_pixmap(QS60PixmapData *pd)
firstPixmap = pd;
}
-static void qt_symbian_unregister_pixmap(QS60PixmapData *pd)
+// static
+void QS60PixmapData::qt_symbian_unregister_pixmap(QS60PixmapData *pd)
{
if (pd->next)
pd->next->prev = pd->prev;
@@ -90,7 +92,8 @@ static void qt_symbian_unregister_pixmap(QS60PixmapData *pd)
firstPixmap = pd->next;
}
-static void qt_symbian_release_pixmaps()
+// static
+void QS60PixmapData::qt_symbian_release_pixmaps()
{
// Scan all QS60PixmapData objects in the system and destroy them.
QS60PixmapData *pd = firstPixmap;
@@ -828,7 +831,6 @@ void* QS60PixmapData::toNativeType(NativeType type)
bool convertToArgb32 = false;
bool needsCopy = false;
- QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion();
if (!(S60->supportsPremultipliedAlpha)) {
// Convert argb32_premultiplied to argb32 since Symbian 9.2 does
// not support premultipied format.
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index a82f5c2..42cc830 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -63,11 +63,6 @@ class CFbsBitGc;
class QSymbianBitmapDataAccess;
-class QS60PixmapData;
-void qt_symbian_register_pixmap(QS60PixmapData *pd);
-void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
-void qt_symbian_release_pixmaps();
-
class QSymbianFbsHeapLock
{
public:
@@ -128,9 +123,9 @@ private:
QS60PixmapData *next;
QS60PixmapData *prev;
- friend void qt_symbian_register_pixmap(QS60PixmapData *pd);
- friend void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
- friend void qt_symbian_release_pixmaps();
+ static void qt_symbian_register_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_release_pixmaps();
friend class QPixmap;
friend class QS60WindowSurface;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 3d3a749..82dd83a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -809,6 +809,12 @@ void QApplicationPrivate::construct(
if (testLib.load()) {
typedef void (*TasInitialize)(void);
TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
+#ifdef Q_OS_SYMBIAN
+ // resolving method by name does not work on Symbian OS so need to use ordinal
+ if(!initFunction) {
+ initFunction = (TasInitialize)testLib.resolve("1");
+ }
+#endif
if (initFunction) {
initFunction();
} else {
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index 6c38911..4983840 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -95,30 +95,61 @@ public:
/*!
\qmlclass FolderListModel QDeclarativeFolderListModel
\ingroup qml-working-with-data
- \brief The FolderListModel provides a model of the contents of a folder in a filesystem.
+ \brief The FolderListModel provides a model of the contents of a file system folder.
- FolderListModel provides access to the local filesystem. The \e folder property
- specifies the folder to list.
+ FolderListModel provides access to information about the contents of a folder
+ in the local file system, exposing a list of files to views and other data components.
- Qt uses "/" as a universal directory separator in the same way that "/" is
- used as a path separator in URLs. If you always use "/" as a directory
- separator, Qt will translate your paths to conform to the underlying
- operating system.
-
- This type is made available by importing the \c Qt.labs.folderlistmodel module.
- \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ \note This type is made available by importing the \c Qt.labs.folderlistmodel module.
+ \e{Elements in the Qt.labs module are not guaranteed to remain compatible
in future versions.}
\bold{import Qt.labs.folderlistmodel 1.0}
- The roles available are:
+ The \l folder property specifies the folder to access. Information about the
+ files and directories in the folder is supplied via the model's interface.
+ Components access names and paths via the following roles:
+
\list
\o fileName
\o filePath
\endlist
- Additionally a file entry can be differentiated from a folder entry
- via the \l isFolder() method.
+ Additionally a file entry can be differentiated from a folder entry via the
+ isFolder() method.
+
+ \section1 Filtering
+
+ Various properties can be set to filter the number of files and directories
+ exposed by the model.
+
+ The \l nameFilters property can be set to contain a list of wildcard filters
+ that are applied to names of files and directories, causing only those that
+ match the filters to be exposed.
+
+ Directories can be included or excluded using the \l showDirs property, and
+ navigation directories can also be excluded by setting the \l showDotAndDotDot
+ property to false.
+
+ It is sometimes useful to limit the files and directories exposed to those
+ that the user can access. The \l showOnlyReadable property can be set to
+ enable this feature.
+
+ \section1 Example Usage
+
+ The following example shows a FolderListModel being used to provide a list
+ of QML files in a \l ListView:
+
+ \snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+
+ \section1 Path Separators
+
+ Qt uses "/" as a universal directory separator in the same way that "/" is
+ used as a path separator in URLs. If you always use "/" as a directory
+ separator, Qt will translate your paths to conform to the underlying
+ operating system.
+
+ \sa {QML Data Models}
*/
QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
@@ -168,9 +199,13 @@ int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const
/*!
\qmlproperty string FolderListModel::folder
- The \a folder property holds the folder the model is currently providing.
+ The \a folder property holds a URL for the folder that the model is
+ currently providing.
- It is a URL, but must be a file: or qrc: URL (or relative to such a URL).
+ The value is a URL expressed as a string, and must be a \c file: or \c qrc:
+ URL, or a relative URL.
+
+ By default, the value is an invalid URL.
*/
QUrl QDeclarativeFolderListModel::folder() const
{
@@ -214,16 +249,18 @@ QUrl QDeclarativeFolderListModel::parentFolder() const
/*!
\qmlproperty list<string> FolderListModel::nameFilters
- The \a nameFilters property contains a list of filename filters.
+ The \a nameFilters property contains a list of file name filters.
The filters may include the ? and * wildcards.
The example below filters on PNG and JPEG files:
- \code
+ \qml
FolderListModel {
nameFilters: [ "*.png", "*.jpg" ]
}
- \endcode
+ \endqml
+
+ \note Directories are not excluded by filters.
*/
QStringList QDeclarativeFolderListModel::nameFilters() const
{
@@ -335,9 +372,14 @@ void QDeclarativeFolderListModel::dataChanged(const QModelIndex &start, const QM
/*!
\qmlproperty bool FolderListModel::showDirs
- If true (the default), directories are included in the model.
+ If true, directories are included in the model; otherwise only files
+ are included.
+
+ By default, this property is true.
- Note that the nameFilters are ignored for directories.
+ Note that the nameFilters are not applied to directories.
+
+ \sa showDotAndDotDot
*/
bool QDeclarativeFolderListModel::showDirs() const
{
@@ -357,9 +399,12 @@ void QDeclarativeFolderListModel::setShowDirs(bool on)
/*!
\qmlproperty bool FolderListModel::showDotAndDotDot
- If true, the "." and ".." directories are included in the model.
+ If true, the "." and ".." directories are included in the model; otherwise
+ they are excluded.
+
+ By default, this property is false.
- The default is false.
+ \sa showDirs
*/
bool QDeclarativeFolderListModel::showDotAndDotDot() const
{
@@ -379,9 +424,12 @@ void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on)
/*!
\qmlproperty bool FolderListModel::showOnlyReadable
- If true, only readable files and directories are shown.
+ If true, only readable files and directories are shown; otherwise all files
+ and directories are shown.
+
+ By default, this property is false.
- The default is false.
+ \sa showDirs
*/
bool QDeclarativeFolderListModel::showOnlyReadable() const
{
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 1f6e58f..0e3167d 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -544,8 +544,11 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
const QString filename = nodes.at(nodes.size()-1);
RCCFileInfo *s = new RCCFileInfo(file);
s->m_parent = parent;
- if (parent->m_children.contains(filename))
- qWarning("potential duplicate alias detected: '%s'", qPrintable(filename));
+ if (parent->m_children.contains(filename)) {
+ foreach (const QString &fileName, m_fileNames)
+ qWarning("%s: Warning: potential duplicate alias detected: '%s'",
+ qPrintable(fileName), qPrintable(filename));
+ }
parent->m_children.insertMulti(filename, s);
return true;
}
diff --git a/src/tools/uic/cpp/cppextractimages.cpp b/src/tools/uic/cpp/cppextractimages.cpp
index 52c1b9d..5809724 100644
--- a/src/tools/uic/cpp/cppextractimages.cpp
+++ b/src/tools/uic/cpp/cppextractimages.cpp
@@ -76,14 +76,14 @@ void ExtractImages::acceptUI(DomUI *node)
if (m_option.qrcOutputFile.size()) {
f.setFileName(m_option.qrcOutputFile);
if (!f.open(QIODevice::WriteOnly | QFile::Text)) {
- fprintf(stderr, "Could not create resource file\n");
+ fprintf(stderr, "%s: Error: Could not create resource file\n", qPrintable(m_option.messagePrefix()));
return;
}
QFileInfo fi(m_option.qrcOutputFile);
QDir dir = fi.absoluteDir();
if (!dir.exists(QLatin1String("images")) && !dir.mkdir(QLatin1String("images"))) {
- fprintf(stderr, "Could not create image dir\n");
+ fprintf(stderr, "%s: Error: Could not create image dir\n", qPrintable(m_option.messagePrefix()));
return;
}
dir.cd(QLatin1String("images"));
@@ -126,7 +126,9 @@ void ExtractImages::acceptImage(DomImage *image)
if (isXPM_GZ)
openMode |= QIODevice::Text;
if (!f.open(openMode)) {
- fprintf(stderr, "Could not create image file %s: %s", qPrintable(fname), qPrintable(f.errorString()));
+ fprintf(stderr, "%s: Error: Could not create image file %s: %s",
+ qPrintable(m_option.messagePrefix()),
+ qPrintable(fname), qPrintable(f.errorString()));
return;
}
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index 4e0ee4a..7b9d03a 100644
--- a/src/tools/uic/cpp/cppwriteincludes.cpp
+++ b/src/tools/uic/cpp/cppwriteincludes.cpp
@@ -126,8 +126,9 @@ void WriteIncludes::acceptUI(DomUI *node)
if (m_uic->hasExternalPixmap() && m_uic->pixmapFunction() == QLatin1String("qPixmapFromMimeSource")) {
#ifdef QT_NO_QT3_SUPPORT
- qWarning("Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. "
- "This requires Qt 3 support, which is disabled. The resulting code will not compile.");
+ qWarning("%s: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. "
+ "This requires Qt 3 support, which is disabled. The resulting code will not compile.",
+ qPrintable(m_uic->option().messagePrefix()));
#endif
add(QLatin1String("Q3MimeSourceFactory"));
}
@@ -212,8 +213,9 @@ void WriteIncludes::insertIncludeForClass(const QString &className, QString head
header = lowerClassName;
header += QLatin1String(".h");
if (warnHeaderGeneration) {
- qWarning("Warning: generated header '%s' for class '%s'.", qPrintable(header),
- qPrintable(className));
+ qWarning("%s: Warning: generated header '%s' for class '%s'.",
+ qPrintable(m_uic->option().messagePrefix()),
+ qPrintable(header), qPrintable(className));
}
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index dc1d181..b06eb7a 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -155,7 +155,7 @@ namespace {
if (const DomResourceIcon *dri = p->elementIconSet()) {
if (!isIconFormat44(dri)) {
if (dri->text().isEmpty()) {
- const QString msg = QString::fromUtf8("%1: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+ const QString msg = QString::fromUtf8("%1: Warning: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
qWarning("%s", qPrintable(msg));
return false;
}
@@ -165,7 +165,7 @@ namespace {
case DomProperty::Pixmap:
if (const DomResourcePixmap *drp = p->elementPixmap())
if (drp->text().isEmpty()) {
- const QString msg = QString::fromUtf8("%1: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+ const QString msg = QString::fromUtf8("%1: Warning: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
qWarning("%s", qPrintable(msg));
return false;
}
@@ -539,10 +539,14 @@ void WriteInitialization::acceptUI(DomUI *node)
const Buddy &b = m_buddies.at(i);
if (!m_registeredWidgets.contains(b.objName)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", b.objName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ b.objName.toLatin1().data());
continue;
} else if (!m_registeredWidgets.contains(b.buddy)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", b.buddy.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ b.buddy.toLatin1().data());
continue;
}
@@ -867,7 +871,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
const QString name = zOrder.at(i);
if (!m_registeredWidgets.contains(name)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Z-order assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ name.toLatin1().data());
continue;
}
@@ -895,7 +901,9 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr
DomButtonGroup *newGroup = new DomButtonGroup;
newGroup->setAttributeName(attributeName);
group = newGroup;
- fprintf(stderr, "Warning: Creating button group `%s'\n", attributeName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Creating button group `%s'\n",
+ qPrintable(m_option.messagePrefix()),
+ attributeName.toLatin1().data());
}
const QString groupName = m_driver->findOrInsertButtonGroup(group);
// Create on demand
@@ -1163,7 +1171,9 @@ void WriteInitialization::acceptActionRef(DomActionRef *node)
return;
}
} else if (!(m_driver->actionByName(actionName) || isSeparator)) {
- fprintf(stderr, "Warning: action `%s' not declared\n", actionName.toLatin1().data());
+ fprintf(stderr, "%s: Warning: action `%s' not declared\n",
+ qPrintable(m_option.messagePrefix()),
+ actionName.toLatin1().data());
return;
}
@@ -1853,7 +1863,9 @@ void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
const QString name = l.at(i);
if (!m_registeredWidgets.contains(name)) {
- fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+ fprintf(stderr, "%s: Warning: Tab-stop assignment: '%s' is not a valid widget.\n",
+ qPrintable(m_option.messagePrefix()),
+ name.toLatin1().data());
continue;
}
@@ -2083,7 +2095,8 @@ QString WriteInitialization::pixCall(const DomProperty *p) const
s = p->elementPixmap()->text();
break;
default:
- qWarning() << "Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.";
+ qWarning("%s: Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.",
+ qPrintable(m_option.messagePrefix()));
return QLatin1String("QIcon()");
break;
}
@@ -2573,7 +2586,7 @@ void WriteInitialization::initializeQ3SqlDataTable(DomWidget *w)
}
if (table.isEmpty() || connection.isEmpty()) {
- fprintf(stderr, "invalid database connection\n");
+ fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix()));
return;
}
@@ -2613,7 +2626,7 @@ void WriteInitialization::initializeQ3SqlDataBrowser(DomWidget *w)
}
if (table.isEmpty() || connection.isEmpty()) {
- fprintf(stderr, "invalid database connection\n");
+ fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix()));
return;
}
diff --git a/src/tools/uic/driver.cpp b/src/tools/uic/driver.cpp
index 676388f..65d63e0 100644
--- a/src/tools/uic/driver.cpp
+++ b/src/tools/uic/driver.cpp
@@ -178,7 +178,10 @@ QString Driver::unique(const QString &instanceName, const QString &className)
}
if (alreadyUsed && className.size()) {
- fprintf(stderr, "Warning: name %s is already used\n", qPrintable(instanceName));
+ fprintf(stderr, "%s: Warning: The name '%s' (%s) is already in use, defaulting to '%s'.\n",
+ qPrintable(m_option.messagePrefix()),
+ qPrintable(instanceName), qPrintable(className),
+ qPrintable(name));
}
m_nameRepository.insert(name, true);
diff --git a/src/tools/uic/option.h b/src/tools/uic/option.h
index 8556728..011a8f8 100644
--- a/src/tools/uic/option.h
+++ b/src/tools/uic/option.h
@@ -43,6 +43,7 @@
#define OPTION_H
#include <QtCore/QString>
+#include <QtCore/QDir>
QT_BEGIN_NAMESPACE
@@ -91,6 +92,13 @@ struct Option
generator(CppGenerator),
prefix(QLatin1String("Ui_"))
{ indent.fill(QLatin1Char(' '), 4); }
+
+ QString messagePrefix() const
+ {
+ return inputFile.isEmpty() ?
+ QString(QLatin1String("stdin")) :
+ QDir::toNativeSeparators(inputFile);
+ }
};
QT_END_NAMESPACE
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 70d419e..c4f09a4 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -713,7 +713,7 @@ void PaintCommands::runCommands()
QPainter pt(&pm);
pt.fillRect(0, 0, 10, 10, QColor::fromRgba(0xffdfdfdf));
pt.fillRect(10, 10, 10, 10, QColor::fromRgba(0xffdfdfdf));
-
+ pt.end();
m_painter->drawTiledPixmap(0, 0, width, height, pm);
} else {
m_painter->fillRect(0, 0, width, height, Qt::white);
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index c8c835f..fb83a5a 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -167,6 +167,8 @@ private slots:
void longFileName();
void updateFileLists();
+
+ void detachingOperations();
};
// Testing get/set functions
@@ -1541,6 +1543,103 @@ void tst_QDir::updateFileLists()
QCOMPARE(dir.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt");
}
+void tst_QDir::detachingOperations()
+{
+ QString const defaultPath(".");
+ QStringList const defaultNameFilters = QStringList("*");
+ QDir::SortFlags const defaultSorting = QDir::Name | QDir::IgnoreCase;
+ QDir::Filters const defaultFilter = QDir::AllEntries;
+
+ QString const path1("..");
+ QString const path2("./foo");
+ QStringList const nameFilters = QStringList(QString("*.txt"));
+ QDir::SortFlags const sorting = QDir::Name | QDir::DirsLast | QDir::Reversed;
+ QDir::Filters const filter = QDir::Writable;
+
+ QDir dir1;
+
+ QCOMPARE(dir1.path(), defaultPath);
+ QCOMPARE(dir1.filter(), defaultFilter);
+ QCOMPARE(dir1.nameFilters(), defaultNameFilters);
+ QCOMPARE(dir1.sorting(), defaultSorting);
+
+ dir1.setPath(path1);
+ QCOMPARE(dir1.path(), path1);
+ QCOMPARE(dir1.filter(), defaultFilter);
+ QCOMPARE(dir1.nameFilters(), defaultNameFilters);
+ QCOMPARE(dir1.sorting(), defaultSorting);
+
+ dir1.setFilter(filter);
+ QCOMPARE(dir1.path(), path1);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), defaultNameFilters);
+ QCOMPARE(dir1.sorting(), defaultSorting);
+
+ dir1.setNameFilters(nameFilters);
+ QCOMPARE(dir1.path(), path1);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), defaultSorting);
+
+ dir1.setSorting(sorting);
+ QCOMPARE(dir1.path(), path1);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), sorting);
+
+ dir1.setPath(path2);
+ QCOMPARE(dir1.path(), path2);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), sorting);
+
+ {
+ QDir dir2(dir1);
+ QCOMPARE(dir2.path(), path2);
+ QCOMPARE(dir2.filter(), filter);
+ QCOMPARE(dir2.nameFilters(), nameFilters);
+ QCOMPARE(dir2.sorting(), sorting);
+ }
+
+ {
+ QDir dir2;
+ QCOMPARE(dir2.path(), defaultPath);
+ QCOMPARE(dir2.filter(), defaultFilter);
+ QCOMPARE(dir2.nameFilters(), defaultNameFilters);
+ QCOMPARE(dir2.sorting(), defaultSorting);
+
+ dir2 = dir1;
+ QCOMPARE(dir2.path(), path2);
+ QCOMPARE(dir2.filter(), filter);
+ QCOMPARE(dir2.nameFilters(), nameFilters);
+ QCOMPARE(dir2.sorting(), sorting);
+
+ dir2 = path1;
+ QCOMPARE(dir2.path(), path1);
+ QCOMPARE(dir2.filter(), filter);
+ QCOMPARE(dir2.nameFilters(), nameFilters);
+ QCOMPARE(dir2.sorting(), sorting);
+ }
+
+ dir1.refresh();
+ QCOMPARE(dir1.path(), path2);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), sorting);
+
+ QString const currentPath = QDir::currentPath();
+ QVERIFY(dir1.cd(currentPath));
+ QCOMPARE(dir1.path(), currentPath);
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), sorting);
+
+ QVERIFY(dir1.cdUp());
+ QCOMPARE(dir1.filter(), filter);
+ QCOMPARE(dir1.nameFilters(), nameFilters);
+ QCOMPARE(dir1.sorting(), sorting);
+}
+
QTEST_MAIN(tst_QDir)
#include "tst_qdir.moc"
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 93b1891..208110a 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -172,6 +172,8 @@ private slots:
void equalOperator() const;
void equalOperatorWithDifferentSlashes() const;
void notEqualOperator() const;
+
+ void detachingOperations();
};
tst_QFileInfo::tst_QFileInfo()
@@ -228,13 +230,13 @@ void tst_QFileInfo::copy()
QFileInfo info2(info);
QFileInfoPrivate *privateInfo = getPrivate(info);
QFileInfoPrivate *privateInfo2 = getPrivate(info2);
- QCOMPARE(privateInfo->data, privateInfo2->data);
+ QCOMPARE(privateInfo, privateInfo2);
//operator =
QFileInfo info3 = info;
QFileInfoPrivate *privateInfo3 = getPrivate(info3);
- QCOMPARE(privateInfo->data, privateInfo3->data);
- QCOMPARE(privateInfo2->data, privateInfo3->data);
+ QCOMPARE(privateInfo, privateInfo3);
+ QCOMPARE(privateInfo2, privateInfo3);
//refreshing info3 will detach it
QFile file(info.absoluteFilePath());
@@ -256,9 +258,10 @@ void tst_QFileInfo::copy()
QTest::qWait(5000);
#endif
info3.refresh();
- QVERIFY(privateInfo->data != privateInfo3->data);
- QVERIFY(privateInfo2->data != privateInfo3->data);
- QCOMPARE(privateInfo->data, privateInfo2->data);
+ privateInfo3 = getPrivate(info3);
+ QVERIFY(privateInfo != privateInfo3);
+ QVERIFY(privateInfo2 != privateInfo3);
+ QCOMPARE(privateInfo, privateInfo2);
}
void tst_QFileInfo::isFile_data()
@@ -1182,8 +1185,8 @@ void tst_QFileInfo::isLocalFs()
QFileInfo info(path);
QFileInfoPrivate *privateInfo = getPrivate(info);
- QVERIFY(privateInfo->data->fileEngine);
- QCOMPARE(bool(privateInfo->data->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag)
+ QVERIFY(privateInfo->fileEngine);
+ QCOMPARE(bool(privateInfo->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag)
& QAbstractFileEngine::LocalDiskFlag), isLocalFs);
}
@@ -1376,5 +1379,51 @@ void tst_QFileInfo::notEqualOperator() const
QVERIFY(QFileInfo() != QFileInfo());
}
+void tst_QFileInfo::detachingOperations()
+{
+ QFileInfo info1;
+ QVERIFY(info1.caching());
+ info1.setCaching(false);
+
+ {
+ QFileInfo info2 = info1;
+
+ QVERIFY(!info1.caching());
+ QVERIFY(!info2.caching());
+
+ info2.setCaching(true);
+ QVERIFY(info2.caching());
+
+ info1.setFile("foo");
+ QVERIFY(!info1.caching());
+ }
+
+ {
+ QFile file("foo");
+ info1.setFile(file);
+ QVERIFY(!info1.caching());
+ }
+
+ info1.setFile(QDir(), "foo");
+ QVERIFY(!info1.caching());
+
+ {
+ QFileInfo info3;
+ QVERIFY(info3.caching());
+
+ info3 = info1;
+ QVERIFY(!info3.caching());
+ }
+
+ info1.refresh();
+ QVERIFY(!info1.caching());
+
+ QVERIFY(info1.makeAbsolute());
+ QVERIFY(!info1.caching());
+
+ info1.detach();
+ QVERIFY(!info1.caching());
+}
+
QTEST_MAIN(tst_QFileInfo)
#include "tst_qfileinfo.moc"
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 370bd13..b5236e5 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -2266,7 +2266,9 @@ void tst_QUrl::ipv6()
QCOMPARE(url.isValid(), isValid);
if (url.isValid()) {
- QCOMPARE(url.toString(), ipv6Auth);
+ QCOMPARE(url.toString(), ipv6Auth);
+ url.setHost(url.host());
+ QCOMPARE(url.toString(), ipv6Auth);
}
};
@@ -2290,6 +2292,8 @@ void tst_QUrl::ipv6_2()
QUrl url(input);
QCOMPARE(url.toString(), output);
+ url.setHost(url.host());
+ QCOMPARE(url.toString(), output);
}
void tst_QUrl::moreIpv6()
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 0d0729b..6e66742 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2681,11 +2681,11 @@ void Configure::generateOutputVars()
qtConfig += "audio-backend";
}
+ QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri";
+ QFile::remove(dst);
if (dictionary["WEBKIT"] == "yes") {
// This include takes care of adding "webkit" to QT_CONFIG.
QString src = sourcePath + "/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri";
- QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri";
- QFile::remove(dst);
QFile::copy(src, dst);
}
diff --git a/tools/designer/src/components/formeditor/formeditor.qrc b/tools/designer/src/components/formeditor/formeditor.qrc
index 6510814..42724dd 100644
--- a/tools/designer/src/components/formeditor/formeditor.qrc
+++ b/tools/designer/src/components/formeditor/formeditor.qrc
@@ -113,7 +113,6 @@
<file>images/widgets/vslider.png</file>
<file>images/widgets/vspacer.png</file>
<file>images/widgets/widget.png</file>
- <file>images/widgets/widget.png</file>
<file>images/widgets/widgetstack.png</file>
<file>images/widgets/wizard.png</file>
<file>images/win/adjustsize.png</file>