summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@nokia.com>2010-06-03 11:59:18 +0200
committerAndy Shaw <andy.shaw@nokia.com>2010-06-03 11:59:18 +0200
commit8d33b335e9cc198a95bf0d180f4daefd57134bd3 (patch)
treeb053d5cd7539c6401abe5f7cb969d4114b6af235
parent41f57bd5eba433676b52d4f8dfebe5e671ba48e5 (diff)
parenta8829a52d65a9759d5dffe98fb07b384c54db1c8 (diff)
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
-rw-r--r--doc/src/declarative/basictypes.qdoc476
-rw-r--r--doc/src/declarative/elements.qdoc14
-rw-r--r--doc/src/declarative/pics/gridview-highlight.pngbin0 -> 11806 bytes
-rw-r--r--doc/src/declarative/pics/gridview-simple.pngbin0 -> 10149 bytes
-rw-r--r--doc/src/declarative/pics/gridview.pngbin10564 -> 0 bytes
-rw-r--r--doc/src/declarative/pics/translate.pngbin0 -> 398 bytes
-rw-r--r--doc/src/declarative/pics/visualitemmodel.pngbin0 -> 347 bytes
-rw-r--r--doc/src/snippets/declarative/drag.qml59
-rw-r--r--doc/src/snippets/declarative/gridview/ContactModel.qml (renamed from doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml)14
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml110
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml104
-rw-r--r--doc/src/snippets/declarative/mousearea.qml (renamed from doc/src/snippets/declarative/mouseregion.qml)54
-rw-r--r--doc/src/snippets/declarative/pathview/ContactModel.qml (renamed from doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml)9
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml13
-rw-r--r--doc/src/snippets/declarative/pathview/pathview.qml22
-rw-r--r--doc/src/snippets/declarative/pathview/pics/qtlogo.png (renamed from doc/src/snippets/declarative/pathview/pics/qtlogo-64.png)bin2991 -> 2991 bytes
-rw-r--r--mkspecs/common/symbian/symbian-mmp.conf16
-rw-r--r--mkspecs/common/symbian/symbian.conf3
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/declarative/QmlChanges.txt1
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp25
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp185
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp31
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp50
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp59
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp101
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp109
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h12
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp136
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp6
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h2
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp6
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp23
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp31
-rw-r--r--src/declarative/util/qdeclarativepackage_p.h2
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp2
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp2
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p_p.h2
-rw-r--r--src/declarative/util/qdeclarativestate_p.h2
-rw-r--r--src/declarative/util/qdeclarativetimeline_p_p.h8
-rw-r--r--src/declarative/util/qdeclarativetimer.cpp23
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager_p_p.h2
-rw-r--r--src/s60installs/qt.iby15
-rw-r--r--src/s60installs/s60installs.pro74
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp83
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp83
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/data/orientation.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp4
-rw-r--r--tools/qml/deviceorientation.cpp2
-rw-r--r--tools/qml/deviceorientation.h9
-rw-r--r--tools/qml/deviceorientation_maemo.cpp12
-rw-r--r--tools/qml/qmlruntime.cpp82
-rw-r--r--tools/qml/qmlruntime.h9
68 files changed, 1221 insertions, 969 deletions
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 43ae214101..87dab81077 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -40,363 +40,377 @@
****************************************************************************/
/*!
- \page qdeclarativebasictypes.html
- \title QML Basic Types
+ \page qdeclarativebasictypes.html
+ \title QML Basic Types
- QML has a set of primitive types, as listed below, that are used throughout
- the \l {QML Elements}.
+ QML has a set of primitive types, as listed below, that are used throughout
+ the \l {QML Elements}.
- Some of these types can also be used for defining
- \c property values in QML. See \l{Extending types from QML} for the
- list of types that can be used for \c property values.
+ Some of these types can also be used for defining
+ \c property values in QML. See \l{Extending types from QML} for the
+ list of types that can be used for \c property values.
- \annotatedlist qmlbasictypes
+ \annotatedlist qmlbasictypes
*/
/*!
- \qmlbasictype int
- \ingroup qmlbasictypes
+ \qmlbasictype int
+ \ingroup qmlbasictypes
- \brief An integer is a whole number, e.g. 0, 10, or -20.
+ \brief An integer is a whole number, e.g. 0, 10, or -20.
- An integer is a whole number, e.g. 0, 10, or -20. The possible \c
- int values range from around -2000000000 to around 2000000000,
- although most elements will only accept a reduced range (which they
- mention in their documentation).
+ An integer is a whole number, e.g. 0, 10, or -20. The possible \c
+ int values range from around -2000000000 to around 2000000000,
+ although most elements will only accept a reduced range (which they
+ mention in their documentation).
- Example:
- \qml
- Item { width: 100; height: 200 }
- \endqml
+ Example:
+ \qml
+ Item { width: 100; height: 200 }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype bool
- \ingroup qmlbasictypes
+ \qmlbasictype bool
+ \ingroup qmlbasictypes
- \brief A boolean is a binary true/false value.
+ \brief A boolean is a binary true/false value.
- A boolean is a binary true/false value.
+ A boolean is a binary true/false value.
- Example:
- \qml
- Item { focus: true; clip: false }
- \endqml
+ Example:
+ \qml
+ Item { focus: true; clip: false }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype real
- \ingroup qmlbasictypes
+ \qmlbasictype real
+ \ingroup qmlbasictypes
- \brief A real number has a decimal point, e.g. 1.2 or -29.8.
+ \brief A real number has a decimal point, e.g. 1.2 or -29.8.
- A real number has a decimal point, e.g. 1.2 or -29.8.
+ A real number has a decimal point, e.g. 1.2 or -29.8.
- Example:
- \qml
- Item { width: 100.45; height: 150.82 }
- \endqml
+ Example:
+ \qml
+ Item { width: 100.45; height: 150.82 }
+ \endqml
- \note In QML all reals are stored in single precision, \l
- {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
- format.
+ \note In QML all reals are stored in single precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
+ format.
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype string
- \ingroup qmlbasictypes
+ \qmlbasictype string
+ \ingroup qmlbasictypes
- \brief A string is a free form text in quotes, e.g. "Hello world!".
+ \brief A string is a free form text in quotes, e.g. "Hello world!".
- A string is a free form text in quotes, e.g. "Hello world!".
+ A string is a free form text in quotes, e.g. "Hello world!".
- Example:
- \qml
- Text { text: "Hello world!" }
- \endqml
+ Example:
+ \qml
+ Text { text: "Hello world!" }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype url
- \ingroup qmlbasictypes
+ \qmlbasictype url
+ \ingroup qmlbasictypes
- \brief A URL is a resource locator, like a file name.
+ \brief A URL is a resource locator, like a file name.
- A URL is a resource locator, like a file name. It can be either
- absolute, e.g. "http://qt.nokia.com", or relative, e.g.
- "pics/logo.png". A relative URL is resolved relative to the URL of
- the component where the URL is converted from a JavaScript string
- expression to a url property value.
+ A URL is a resource locator, like a file name. It can be either
+ absolute, e.g. "http://qt.nokia.com", or relative, e.g.
+ "pics/logo.png". A relative URL is resolved relative to the URL of
+ the component where the URL is converted from a JavaScript string
+ expression to a url property value.
- Example:
- \qml
- Image { source: "pics/logo.png" }
- \endqml
+ Example:
+ \qml
+ Image { source: "pics/logo.png" }
+ \endqml
- \raw HTML
- \endraw
+ \raw HTML
+ \endraw
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype color
- \ingroup qmlbasictypes
+ \qmlbasictype color
+ \ingroup qmlbasictypes
- \brief A color is a standard color name in quotes.
+ \brief A color is a standard color name in quotes.
- A color is a standard color name in quotes. It is normally specified
- as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords} {SVG
- color name}. These names include colors like "red", "green" and
- "lightsteelblue".
+ A color is a standard color name in quotes. It is normally specified
+ as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords} {SVG
+ color name}. These names include colors like "red", "green" and
+ "lightsteelblue".
- If the color you want isn't part of this list, colors can also be
- specified in hexidecimal triplets or quads that take the form \c
- "#RRGGBB" and \c "#AARRGGBB" respectively. For example, the color
- red corresponds to a triplet of \c "#FF0000" and a slightly
- transparent blue to a quad of \c "#800000FF".
+ If the color you want isn't part of this list, colors can also be
+ specified in hexidecimal triplets or quads that take the form \c
+ "#RRGGBB" and \c "#AARRGGBB" respectively. For example, the color
+ red corresponds to a triplet of \c "#FF0000" and a slightly
+ transparent blue to a quad of \c "#800000FF".
- Example:
- \qml
- Rectangle { color: "steelblue" }
- Rectangle { color: "#FF0000" }
- Rectangle { color: "#800000FF" }
- \endqml
+ Example:
+ \qml
+ Rectangle { color: "steelblue" }
+ Rectangle { color: "#FF0000" }
+ Rectangle { color: "#800000FF" }
+ \endqml
- Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
- \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
+ Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
+ \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
- \qml
- Rectangle { color: Qt.rgba(255, 0, 0, 1) }
- \endqml
+ \qml
+ Rectangle { color: Qt.rgba(255, 0, 0, 1) }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype point
- \ingroup qmlbasictypes
+ \qmlbasictype point
+ \ingroup qmlbasictypes
- \brief A point is specified as "x,y".
+ \brief A point type has x and y attributes.
- A point is specified as "x,y".
+ A \c point type has \c x and \c y attributes.
- Example:
- \qml
- MyItem { position: "0,20" }
- \endqml
+ To create a \c point value, specify it as a "x,y" string:
- Or with the \l{Qt::point()}{Qt.point()} function:
+ \qml
+ CustomObject { myPointProperty: "0,20" }
+ \endqml
- \qml
- MyItem { position: Qt.point(0, 20) }
- \endqml
+ Or use the \l{Qt::point()}{Qt.point()} function:
- A point object has \c x and \c y attributes that contain the \c x and \c y values.
+ \qml
+ CustomObject { myPointProperty: Qt.point(0, 20) }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype size
- \ingroup qmlbasictypes
+ \qmlbasictype size
+ \ingroup qmlbasictypes
+
+ \brief A size type has width and height attributes
- \brief A size is specified as "width x height".
+ A \c size type has \c width and \c height attributes.
- A size is specified as "width x height".
+ For example, to read the \l {Image::sourceSize} \c size property:
- Example:
- \qml
- LayoutItem { preferredSize: "150x50" }
- \endqml
+ \qml
+ Column {
+ Image { id: image; source: "logo.png" }
+ Text { text: image.sourceSize.width + "," + image.sourceSize.height }
+ }
+ \endqml
- Or with the \l{Qt::size()}{Qt.size()} function:
+ To create a \c size value, specify it as a "width x height" string:
- \qml
- MyItem { position: Qt.size(150, 50) }
- \endqml
+ \qml
+ LayoutItem { preferredSize: "150x50" }
+ \endqml
- A size object has \c width and \c height attributes that contain the \c width and \c height values.
+ Or use the \l{Qt::size()}{Qt.size()} function:
- \sa {QML Basic Types}
+ \qml
+ LayoutItem { preferredSize: Qt.size(150, 50) }
+ \endqml
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype rect
- \ingroup qmlbasictypes
+ \qmlbasictype rect
+ \ingroup qmlbasictypes
+
+ \brief A rect type has x, y, width and height attributes.
+
+ A \c rect type has \c x, \c y, \c width and \c height attributes.
- \brief A rect is specified as "x, y, width x height".
+ For example, to read the \l {Item::childrenRect.x}{Item::childrenRect} \c rect property:
+ \qml
+ Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
- A rect is specified as "x, y, width x height".
+ Rectangle { width: 100; height: 100 }
+ }
+ \endqml
- Example:
- \qml
- MyItem { geometry: "50,50,100x100" }
- \endqml
+ To create a \c rect value, specify it as a "x, y, width x height" string:
- Or with the \l{Qt::rect()}{Qt.rect()} function:
+ \qml
+ CustomObject { myRectProperty: "50,50,100x100" }
+ \endqml
- \qml
- MyItem { position: Qt.rect(50, 50, 100, 100) }
- \endqml
+ Or use the \l{Qt::rect()}{Qt.rect()} function:
- A rect object has \c x, \c, y, \c width and \c height attributes that contain the
- \c x, \c y, \c width and \c height values.
+ \qml
+ CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype date
- \ingroup qmlbasictypes
+ \qmlbasictype date
+ \ingroup qmlbasictypes
- \brief A date is specified as "YYYY-MM-DD".
+ \brief A date is specified as "YYYY-MM-DD".
- A date is specified as "YYYY-MM-DD".
+ To create a \c date value, specify it as a "YYYY-MM-DD" string:
- Example:
- \qml
- MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
- \endqml
+ Example:
+ \qml
+ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
+ \endqml
- To read a date value returned from a C++ extension class, use
- \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ To read a date value returned from a C++ extension class, use
+ \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype time
- \ingroup qmlbasictypes
+ \qmlbasictype time
+ \ingroup qmlbasictypes
- \brief A time is specified as "hh:mm:ss".
+ \brief A time is specified as "hh:mm:ss".
- A time is specified as "hh:mm:ss".
+ A time is specified as "hh:mm:ss".
- Example:
- \qml
- MyTimePicker { time: "14:22:15" }
- \endqml
+ Example:
+ \qml
+ MyTimePicker { time: "14:22:15" }
+ \endqml
- To read a time value returned from a C++ extension class, use
- \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ To read a time value returned from a C++ extension class, use
+ \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype font
- \ingroup qmlbasictypes
+ \qmlbasictype font
+ \ingroup qmlbasictypes
- \brief A font type has the properties of a QFont.
+ \brief A font type has the properties of a QFont.
- A font type has the properties of a QFont. The properties are:
+ A font type has the properties of a QFont. The properties are:
- \list
- \o \c string font.family
- \o \c bool font.bold
- \o \c bool font.italic
- \o \c bool font.underline
- \o \c real font.pointSize
- \o \c int font.pixelSize
- \endlist
+ \list
+ \o \c string font.family
+ \o \c bool font.bold
+ \o \c bool font.italic
+ \o \c bool font.underline
+ \o \c real font.pointSize
+ \o \c int font.pixelSize
+ \endlist
- Example:
- \qml
- Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
- \endqml
+ Example:
+ \qml
+ Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype action
- \ingroup qmlbasictypes
+ \qmlbasictype action
+ \ingroup qmlbasictypes
- \brief The action type has all the properties of QAction.
+ \brief The action type has all the properties of QAction.
- The action type has all the properties of QAction. The properties
- are:
+ The action type has all the properties of QAction. The properties
+ are:
- \list
- \o \c slot action.trigger - invoke the action
- \o \c bool action.enabled - true if the action is enabled
- \o \c string action.text - the text associated with the action
- \endlist
+ \list
+ \o \c slot action.trigger - invoke the action
+ \o \c bool action.enabled - true if the action is enabled
+ \o \c string action.text - the text associated with the action
+ \endlist
- Actions are used like this:
+ Actions are used like this:
- \qml
- MouseArea { onClicked: myaction.trigger() }
- State { name: "enabled"; when: myaction.enabled == true }
- Text { text: someaction.text }
- \endqml
+ \qml
+ MouseArea { onClicked: myaction.trigger() }
+ State { name: "enabled"; when: myaction.enabled == true }
+ Text { text: someaction.text }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype list
- \ingroup qmlbasictypes
-
- \brief A list of objects.
-
- A list of objects. While not technically a basic type, QML also
- supports lists of object types. When used from QML, the engine
- automatically appends each value to the list.
-
- For example, the \l Item class contains a list property named
- children that can be used like this:
-
- \qml
- Item {
- children: [
- Item { id: child1 },
- Rectangle { id: child2 },
- Text { id: child3 }
- ]
- }
- \endqml
- \c child1, \c child2 and \c child3 will all be added to the children list
- in the order in which they appear.
-
- \sa {QML Basic Types}
+ \qmlbasictype list
+ \ingroup qmlbasictypes
+
+ \brief A list of objects.
+
+ A list of objects. While not technically a basic type, QML also
+ supports lists of object types. When used from QML, the engine
+ automatically appends each value to the list.
+
+ For example, the \l Item class contains a list property named
+ children that can be used like this:
+
+ \qml
+ Item {
+ children: [
+ Item { id: child1 },
+ Rectangle { id: child2 },
+ Text { id: child3 }
+ ]
+ }
+ \endqml
+ \c child1, \c child2 and \c child3 will all be added to the children list
+ in the order in which they appear.
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype vector3d
- \ingroup qmlbasictypes
+ \qmlbasictype vector3d
+ \ingroup qmlbasictypes
- \brief A vector3d is specified as "x,y,z".
+ \brief A vector3d type has x, y, and z attributes.
- A vector3d is specified as "x,y,z".
+ A \c vector3d type has \c x, \c y, and \c z attributes.
- \qml
- Rotation { angle: 60; axis: "0,1,0" }
- \endqml
+ To create a \c vector3d value, specify it as a "x,y,z" string:
- or with the \c{Qt.vector3d()} function:
+ \qml
+ Rotation { angle: 60; axis: "0,1,0" }
+ \endqml
- \qml
- Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
- \endqml
+ or with the \l{Qt::vector3d()}{Qt.vector3d()} function:
- or as separate \c x, \c y, and \c z components:
+ \qml
+ Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
+ \endqml
- \qml
- Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
- \endqml
+ or as separate \c x, \c y, and \c z components:
- A vector3d object has \c x, \c, y, and \c z attributes that contain the
- \c x, \c y, \c z values.
+ \qml
+ Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 574a187b72..aa48bcbc83 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -59,8 +59,8 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l State
\o \l PropertyChanges
\o \l StateGroup
+\o \l StateChangeScript
\o \l ParentChange (Item-specific)
-\o \l StateChangeScript (Item-specific)
\o \l AnchorChanges (Item-specific)
\endlist
@@ -76,6 +76,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l ParentAnimation
\o \l AnchorAnimation
\o \l SmoothedAnimation
+\o \l Vector3dAnimation
\o \l PropertyAction
\o \l ScriptAction
\o \l Transition
@@ -167,8 +168,8 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\header
\o \bold {Views}
\o \bold {Positioners}
-\o \bold {Media}
\o \bold {Effects}
+\o
\row
\o
@@ -201,13 +202,6 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o
\list
-\o \l SoundEffect
-\o \l Audio
-\o \l Video
-\endlist
-
-\o
-\list
\o \l Particles (experimental)
\list
\o \l ParticleMotionLinear
@@ -217,4 +211,6 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\endlist
\endtable
+\o
+
*/
diff --git a/doc/src/declarative/pics/gridview-highlight.png b/doc/src/declarative/pics/gridview-highlight.png
new file mode 100644
index 0000000000..b54af37f93
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-highlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview-simple.png b/doc/src/declarative/pics/gridview-simple.png
new file mode 100644
index 0000000000..a102939f2b
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview.png b/doc/src/declarative/pics/gridview.png
deleted file mode 100644
index 37268932d3..0000000000
--- a/doc/src/declarative/pics/gridview.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/declarative/pics/translate.png b/doc/src/declarative/pics/translate.png
new file mode 100644
index 0000000000..baf58b0eb6
--- /dev/null
+++ b/doc/src/declarative/pics/translate.png
Binary files differ
diff --git a/doc/src/declarative/pics/visualitemmodel.png b/doc/src/declarative/pics/visualitemmodel.png
new file mode 100644
index 0000000000..5e6d1325b2
--- /dev/null
+++ b/doc/src/declarative/pics/visualitemmodel.png
Binary files differ
diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml
deleted file mode 100644
index 0a69574589..0000000000
--- a/doc/src/snippets/declarative/drag.qml
+++ /dev/null
@@ -1,59 +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$
-**
-****************************************************************************/
-
-import Qt 4.7
-
-//! [0]
-Rectangle {
- id: blurtest; width: 600; height: 200; color: "white"
- Image {
- id: pic; source: "qtlogo-64.png"; anchors.verticalCenter: parent.verticalCenter
- opacity: (600.0-pic.x) / 600;
- MouseArea {
- anchors.fill: parent
- drag.target: pic
- drag.axis: Drag.XAxis
- drag.minimumX: 0
- drag.maximumX: blurtest.width-pic.width
- }
- }
-}
-//! [0]
diff --git a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/gridview/ContactModel.qml
index 1e790301d6..2da4660bb2 100644
--- a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
+++ b/doc/src/snippets/declarative/gridview/ContactModel.qml
@@ -39,28 +39,26 @@
**
****************************************************************************/
+//![0]
import Qt 4.7
ListModel {
- id: contactModel
+
ListElement {
- name: "Bill Smith"
- number: "555 3264"
+ name: "Jim Williams"
portrait: "pics/portrait.png"
}
ListElement {
- name: "Jim Williams"
- number: "555 5673"
+ name: "John Brown"
portrait: "pics/portrait.png"
}
ListElement {
- name: "John Brown"
- number: "555 8426"
+ name: "Bill Smyth"
portrait: "pics/portrait.png"
}
ListElement {
name: "Sam Wise"
- number: "555 0473"
portrait: "pics/portrait.png"
}
}
+//![0]
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index 3c205bcf3c..0b3bbf33a9 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -39,50 +39,98 @@
**
****************************************************************************/
+//![import]
import Qt 4.7
+//![import]
-//! [3]
Rectangle {
- width: 240; height: 180; color: "white"
- // ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
-
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
-//! [0]
+ width: childrenRect.width; height: childrenRect.height
+
+Row {
+
+//![classdocs simple]
+GridView {
+ width: 300; height: 200
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+}
+//![classdocs simple]
+
+
+//![classdocs advanced]
+Rectangle {
+ width: 300; height: 200
+
Component {
- id: delegate
+ id: contactDelegate
Item {
- id: wrapper
- width: 80; height: 78
+ width: grid.cellWidth; height: grid.cellHeight
Column {
+ anchors.fill: parent
Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
}
}
}
-//! [0]
- // Define a highlight component. Just one of these will be instantiated
- // by each ListView and placed behind the current item.
-//! [1]
- Component {
- id: highlight
- Rectangle {
- color: "lightsteelblue"
- radius: 5
- }
- }
-//! [1]
- // The actual grid
-//! [2]
+
GridView {
- width: parent.width; height: parent.height
- model: ContactModel; delegate: delegate
+ id: grid
+ anchors.fill: parent
cellWidth: 80; cellHeight: 80
- highlight: highlight
+
+ model: ContactModel {}
+ delegate: contactDelegate
+ highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
}
-//! [2]
}
-//! [3]
+//![classdocs advanced]
+
+//![delayRemove]
+Component {
+ id: delegate
+ Item {
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
+ }
+ }
+}
+//![delayRemove]
+
+//![highlightFollowsCurrentItem]
+Component {
+ id: highlight
+ Rectangle {
+ width: view.cellWidth; height: view.cellHeight
+ color: "lightsteelblue"; radius: 5
+ SpringFollow on x { to: view.currentItem.x; spring: 3; damping: 0.2 }
+ SpringFollow on y { to: view.currentItem.y; spring: 3; damping: 0.2 }
+ }
+}
+
+GridView {
+ id: view
+ width: 300; height: 200
+ cellWidth: 80; cellHeight: 80
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+}
+//![highlightFollowsCurrentItem]
+
+}
+
+}
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
deleted file mode 100644
index af9e95f03c..0000000000
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ /dev/null
@@ -1,104 +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$
-**
-****************************************************************************/
-
-import Qt 4.7
-
-Rectangle {
- width: 180; height: 200; color: "white"
-
- // ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
-
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
-//! [0]
- Component {
- id: delegate
- Item {
- id: wrapper
- width: 180; height: 40
- Column {
- x: 5; y: 5
- Text { text: '<b>Name:</b> ' + name }
- Text { text: '<b>Number:</b> ' + number }
- }
- // Use the ListView.isCurrentItem attached property to
- // indent the item if it is the current item.
- states: [
- State {
- name: "Current"
- when: wrapper.ListView.isCurrentItem
- PropertyChanges { target: wrapper; x: 10 }
- }
- ]
- transitions: [
- Transition { NumberAnimation { properties: "x"; duration: 200 } }
- ]
- }
- }
-//! [0]
- // Specify a highlight with custom movement. Note that autoHighlight
- // is set to false in the ListView so that we can control how the
- // highlight moves to the current item.
-//! [1]
- Component {
- id: highlight
- Rectangle {
- width: 180; height: 40
- color: "lightsteelblue"; radius: 5
- SpringFollow on y {
- to: list.currentItem.y
- spring: 3
- damping: 0.2
- }
- }
- }
- ListView {
- id: list
- width: parent.height; height: parent.height
- model: ContactModel; delegate: delegate
- highlight: highlight
- highlightFollowsCurrentItem: false
- focus: true
- }
-//! [1]
-}
diff --git a/doc/src/snippets/declarative/mouseregion.qml b/doc/src/snippets/declarative/mousearea.qml
index a162854d5f..c6071c7729 100644
--- a/doc/src/snippets/declarative/mouseregion.qml
+++ b/doc/src/snippets/declarative/mousearea.qml
@@ -39,11 +39,17 @@
**
****************************************************************************/
+//! [import]
import Qt 4.7
+//! [import]
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
-Rectangle { width: 200; height: 100
Row {
-//! [0]
+
+//! [intro]
Rectangle {
width: 100; height: 100
color: "green"
@@ -53,8 +59,9 @@ Rectangle {
onClicked: { parent.color = 'red' }
}
}
-//! [0]
-//! [1]
+//! [intro]
+
+//! [intro-extended]
Rectangle {
width: 100; height: 100
color: "green"
@@ -70,6 +77,43 @@ Rectangle {
}
}
}
-//! [1]
+//! [intro-extended]
+
+//! [drag]
+Rectangle {
+ id: container
+ width: 600; height: 200
+
+ Image {
+ id: pic
+ source: "pics/qt.png"
+ opacity: (600.0 - pic.x) / 600
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: pic
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: container.width - pic.width
+ }
+ }
+}
+//! [drag]
+
+//! [mousebuttons]
+Text {
+ text: mouseArea.pressedButtons & Qt.RightButton ? "right" : ""
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ }
+}
+//! [mousebuttons]
+
}
+
}
diff --git a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml b/doc/src/snippets/declarative/pathview/ContactModel.qml
index a52b60afaa..1a042a378f 100644
--- a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml
+++ b/doc/src/snippets/declarative/pathview/ContactModel.qml
@@ -39,20 +39,21 @@
**
****************************************************************************/
+//![0]
import Qt 4.7
ListModel {
- id: menuModel
ListElement {
name: "Bill Jones"
- icon: "pics/qtlogo-64.png"
+ icon: "pics/qtlogo.png"
}
ListElement {
name: "Jane Doe"
- icon: "pics/qtlogo-64.png"
+ icon: "pics/qtlogo.png"
}
ListElement {
name: "John Smith"
- icon: "pics/qtlogo-64.png"
+ icon: "pics/qtlogo.png"
}
}
+//![0]
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
index e8d2509020..3ba3b952a0 100644
--- a/doc/src/snippets/declarative/pathview/pathattributes.qml
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -39,16 +39,16 @@
**
****************************************************************************/
+//! [0]
import Qt 4.7
Rectangle {
- width: 240; height: 200; color: 'white'
-//! [0]
+ width: 240; height: 200
+
//! [1]
Component {
id: delegate
Item {
- id: wrapper
width: 80; height: 80
scale: PathView.scale
opacity: PathView.opacity
@@ -59,9 +59,12 @@ Rectangle {
}
}
//! [1]
+
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: delegate
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
path: Path {
startX: 120; startY: 100
PathAttribute { name: "scale"; value: 1.0 }
@@ -73,5 +76,5 @@ Rectangle {
}
}
//! [2]
-//! [0]
}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pathview.qml b/doc/src/snippets/declarative/pathview/pathview.qml
index 31b793dd0f..1669847359 100644
--- a/doc/src/snippets/declarative/pathview/pathview.qml
+++ b/doc/src/snippets/declarative/pathview/pathview.qml
@@ -39,27 +39,27 @@
**
****************************************************************************/
+//! [0]
import Qt 4.7
Rectangle {
- width: 240; height: 200; color: 'white'
-//! [0]
+ width: 240; height: 200
+
//! [1]
Component {
id: delegate
- Item {
- id: wrapper
- width: 80; height: 80
- Column {
- Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
- Text { text: name; font.pointSize: 16}
- }
+ Column {
+ Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { text: name; font.pointSize: 16 }
}
}
//! [1]
+
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: delegate
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
path: Path {
startX: 120; startY: 100
PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
@@ -67,5 +67,5 @@ Rectangle {
}
}
//! [2]
-//! [0]
}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
index 4f68e162de..4f68e162de 100644
--- a/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png
+++ b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
Binary files differ
diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf
index 1ab228f184..b0d17be771 100644
--- a/mkspecs/common/symbian/symbian-mmp.conf
+++ b/mkspecs/common/symbian/symbian-mmp.conf
@@ -38,15 +38,17 @@ INCLUDEPATH = \
# RVCT seems to do this automatically, but WINSCW compiler does not, so add it here.
MMP_RULES += "USERINCLUDE ."
-exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) {
+exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.2.sis)|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.2.sis) {
+ S60_VERSION = 5.2 symbian3
+} else:exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.1.sis)|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.1.sis) {
+ S60_VERSION = 5.1 symbian2
+} else:exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis)|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) {
S60_VERSION = 5.0
+} else:exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis)|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) {
+ S60_VERSION = 3.2
} else {
- exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) {
- S60_VERSION = 3.2
- } else {
- S60_VERSION = 3.1
- MMP_RULES -= PAGED BYTEPAIRCOMPRESSTARGET
- }
+ S60_VERSION = 3.1
+ MMP_RULES -= PAGED BYTEPAIRCOMPRESSTARGET
}
QMAKE_CXXFLAGS_FAST_VFP.ARMCC = --fpmode fast
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 89034ca2d3..b8bfd7c511 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -119,13 +119,14 @@ load(symbian/platform_paths)
default_deployment.pkg_prerules += pkg_depends_webkit pkg_depends_qt pkg_platform_dependencies
-# Supports S60 3.0, 3.1, 3.2 and 5.0 by default
+# Supports S60 3.0, 3.1, 3.2, 5.0 and Symbian^3 by default
pkg_platform_dependencies = \
"; Default HW/platform dependencies" \
"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
"[0x102032BE],0,0,0,{\"S60ProductID\"}" \
"[0x102752AE],0,0,0,{\"S60ProductID\"}" \
"[0x1028315F],0,0,0,{\"S60ProductID\"}" \
+ "[0x20022e6d],0,0,0,{\"S60ProductID\"}" \
" "
DEPLOYMENT += default_deployment
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 8e76e9e0a0..ce9c57ecea 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
#define QT_USE_MMAP
#endif
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index ca54c6cd8c..1321b14356 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -56,7 +56,7 @@
#include "qhash.h"
#include "qtranslator_p.h"
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
#define QT_USE_MMAP
#include "private/qcore_unix_p.h"
#endif
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 0df5f10d43..5735b1ebe5 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -2,7 +2,6 @@
The changes below are pre Qt 4.7.0 RC
TextInput and TextEdit:
- - showInputPanelOnFocus property added
- openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
Flickable:
- overShoot is replaced by boundsBehavior enumeration
diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h
index 5ba49a85ca..704c49a3c1 100644
--- a/src/declarative/debugger/qdeclarativedebugtrace_p.h
+++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h
@@ -50,7 +50,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QUrl;
-class QDeclarativeDebugTrace : public QDeclarativeDebugService
+class Q_AUTOTEST_EXPORT QDeclarativeDebugTrace : public QDeclarativeDebugService
{
public:
enum EventType {
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index a05e4264a5..261cc5cf40 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -72,13 +72,22 @@ QT_BEGIN_NAMESPACE
\o \image animatedimageitem.gif
\o
\qml
-Item {
- width: anim.width; height: anim.height+8
- AnimatedImage { id: anim; source: "pics/games-anim.gif" }
- Rectangle { color: "red"; width: 4; height: 8; y: anim.height
- x: (anim.width-width)*anim.currentFrame/(anim.frameCount-1)
+ 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"
+ }
}
-}
\endqml
\endtable
*/
@@ -96,7 +105,7 @@ QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage()
/*!
\qmlproperty bool AnimatedImage::paused
- This property holds whether the animated image is paused or not
+ This property holds whether the animated image is paused.
Defaults to false, and can be set to true when you want to pause.
*/
@@ -120,7 +129,7 @@ void QDeclarativeAnimatedImage::setPaused(bool pause)
}
/*!
\qmlproperty bool AnimatedImage::playing
- This property holds whether the animated image is playing or not
+ This property holds whether the animated image is playing.
Defaults to true, so as to start playing immediately.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index d926119317..8c9d2dd218 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -74,7 +74,7 @@ public:
\inherits Item
Flipable is an item that can be visibly "flipped" between its front and
- back sides. It is used together with Rotation and State/Transition to
+ back sides. It is used together with \l Rotation and \l {State}/\l {Transition} to
produce a flipping effect.
Here is a Flipable that flips whenever it is clicked:
@@ -83,10 +83,12 @@ public:
\image flipable.gif
- The Rotation element is used to specify the angle and axis of the flip,
- and the State defines the changes in angle which produce the flipping
- effect. Finally, the Transition creates the animation that changes the
+ The \l Rotation element is used to specify the angle and axis of the flip,
+ and the \l State defines the changes in angle which produce the flipping
+ effect. Finally, the \l Transition creates the animation that changes the
angle over one second.
+
+ \sa {declarative/ui-components/flipable}{Flipable example}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 906f1fc6bb..ffffc2f117 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -904,28 +904,43 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
\inherits Flickable
\brief The GridView item provides a grid view of items provided by a model.
- The model is typically provided by a QAbstractListModel "C++ model object",
- but can also be created directly in QML.
+ A GridView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
- The items are laid out top to bottom (vertically) or left to right (horizontally)
- and may be flicked to scroll.
+ A GridView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed. Items in a
+ GridView are laid out horizontally or vertically. Grid views are inherently flickable
+ as GridView inherits from \l Flickable.
- The below example creates a very simple grid, using a QML model.
+ For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
- \image gridview.png
+ \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 3
+ Another component can display this model data in a GridView, like this:
- The model is defined as a ListModel using QML:
- \quotefile doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple
+ \image gridview-simple.png
- In this case ListModel is a handy way for us to test our UI. In practice
- the model would be implemented in C++, or perhaps via a SQL data source.
+ Here, the GridView creates a \c ContactModel component for its model, and a \l Column element
+ (containing \l Image and \ Text elements) for its delegate. The view will create a new delegate
+ for each item in the model. Notice the delegate is able to access the model's \c name and
+ \c portrait data directly.
+
+ An improved grid view is shown below. The delegate is visually improved and is moved
+ into a separate \c contactDelegate component. Also, the currently selected item is highlighted
+ with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true
+ to enable keyboard navigation for the grid view.
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs advanced
+ \image gridview-highlight.png
Delegates are instantiated as needed and may be destroyed at any time.
State should \e never be stored in a delegate.
- \bold Note that views do not enable \e clip automatically. If the view
+ \note Views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
nicely.
@@ -971,19 +986,7 @@ QDeclarativeGridView::~QDeclarativeGridView()
The example below ensures that the animation completes before
the item is removed from the grid.
- \code
- Component {
- id: myDelegate
- Item {
- id: wrapper
- GridView.onRemove: SequentialAnimation {
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
- }
- }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml delayRemove
*/
/*!
@@ -1001,10 +1004,10 @@ QDeclarativeGridView::~QDeclarativeGridView()
\qmlproperty model GridView::model
This property holds the model providing data for the grid.
- The model provides a set of data that is used to create the items
- for the view. For large or dynamic datasets the model is usually
- provided by a C++ model object. The C++ model object must be a \l
- {QAbstractItemModel} subclass, a VisualModel, or a simple list.
+ The model provides the set of data that is used to create the items
+ in the view. Models can be created directly in QML using \l ListModel, \l XmlListModel
+ or \l VisualItemModel, or provided by C++ model classes. If a C++ model class is
+ used, it must be a subclass of \l QAbstractItemModel or a simple list.
\sa {qmlmodels}{Data Models}
*/
@@ -1079,11 +1082,11 @@ void QDeclarativeGridView::setModel(const QVariant &model)
that is not needed for the normal display of the delegate in a \l Loader which
can load additional elements when needed.
- Note that the GridView will layout the items based on the size of the root item
+ The GridView will layout the items based on the size of the root item
in the delegate.
- Here is an example delegate:
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 0
+ \note Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
*/
QDeclarativeComponent *QDeclarativeGridView::delegate() const
{
@@ -1157,8 +1160,7 @@ QDeclarativeItem *QDeclarativeGridView::currentItem()
/*!
\qmlproperty Item GridView::highlightItem
- \c highlightItem holds the highlight item, which was created
- from the \l highlight component.
+ This holds the highlight item created from the \l highlight component.
The highlightItem is managed by the view unless
\l highlightFollowsCurrentItem is set to false.
@@ -1189,13 +1191,10 @@ int QDeclarativeGridView::count() const
\qmlproperty Component GridView::highlight
This property holds the component to use as the highlight.
- An instance of the highlight component will be created for each view.
- The geometry of the resultant component instance will be managed by the view
+ An instance of the highlight component is created for each view.
+ The geometry of the resulting component instance will be managed by the view
so as to stay with the current item, unless the highlightFollowsCurrentItem property is false.
- The below example demonstrates how to make a simple highlight:
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 1
-
\sa highlightItem, highlightFollowsCurrentItem
*/
QDeclarativeComponent *QDeclarativeGridView::highlight() const
@@ -1218,21 +1217,14 @@ void QDeclarativeGridView::setHighlight(QDeclarativeComponent *highlight)
\qmlproperty bool GridView::highlightFollowsCurrentItem
This property sets whether the highlight is managed by the view.
- If highlightFollowsCurrentItem is true, the highlight will be moved smoothly
- to follow the current item. If highlightFollowsCurrentItem is false, the
- highlight will not be moved by the view, and must be implemented
- by the highlight component, for example:
-
- \code
- Component {
- id: myHighlight
- Rectangle {
- id: wrapper; color: "lightsteelblue"; radius: 4; width: 320; height: 60
- SpringFollow on y { source: wrapper.GridView.view.currentItem.y; spring: 3; damping: 0.2 }
- SpringFollow on x { source: wrapper.GridView.view.currentItem.x; spring: 3; damping: 0.2 }
- }
- }
- \endcode
+ If this property is true, the highlight is moved smoothly
+ to follow the current item. Otherwise, the
+ highlight is not moved by the view, and any movement must be implemented
+ by the highlight.
+
+ Here is a highlight with its motion defined by a \l {SpringFollow} item:
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml highlightFollowsCurrentItem
*/
bool QDeclarativeGridView::highlightFollowsCurrentItem() const
{
@@ -1290,32 +1282,30 @@ void QDeclarativeGridView::setHighlightMoveDuration(int duration)
\qmlproperty real GridView::preferredHighlightEnd
\qmlproperty enumeration GridView::highlightRangeMode
- These properties set the preferred range of the highlight (current item)
- within the view.
+ These properties define the preferred range of the highlight (for the current item)
+ within the view. The \c preferredHighlightBegin value must be less than the
+ \c preferredHighlightEnd value.
- Note that this is the correct way to influence where the
- current item ends up when the view scrolls. For example, if you want the
- currently selected item to be in the middle of the list, then set the
- highlight range to be where the middle item would go. Then, when the view scrolls,
- the currently selected item will be the item at that spot. This also applies to
- when the currently selected item changes - it will scroll to within the preferred
- highlight range. Furthermore, the behaviour of the current item index will occur
- whether or not a highlight exists.
+ These properties affect the position of the current item when the view is scrolled.
+ For example, if the currently selected item should stay in the middle of the
+ view when it is scrolled, set the \c preferredHighlightBegin and
+ \c preferredHighlightEnd values to the top and bottom coordinates of where the middle
+ item would be. If the \c currentItem is changed programmatically, the view will
+ automatically scroll so that the current item is in the middle of the view.
+ Furthermore, the behavior of the current item index will occur whether or not a
+ highlight exists.
- If highlightRangeMode is set to \e GridView.ApplyRange the view will
- attempt to maintain the highlight within the range, however
- the highlight can move outside of the range at the ends of the list
- or due to a mouse interaction.
+ Valid values for \c highlightRangeMode are:
- If highlightRangeMode is set to \e GridView.StrictlyEnforceRange the highlight will never
- move outside of the range. This means that the current item will change
- if a keyboard or mouse action would cause the highlight to move
- outside of the range.
-
- The default value is \e GridView.NoHighlightRange.
-
- Note that a valid range requires preferredHighlightEnd to be greater
- than or equal to preferredHighlightBegin.
+ \list
+ \o GridView.ApplyRange - the view attempts to maintain the highlight within the range.
+ However, the highlight can move outside of the range at the ends of the view or due
+ to mouse interaction.
+ \o GridView.StrictlyEnforceRange - the highlight never moves outside of the range.
+ The current item changes if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+ \o GridView.NoHighlightRange - this is the default value.
+ \endlist
*/
qreal QDeclarativeGridView::preferredHighlightBegin() const
{
@@ -1370,10 +1360,12 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
\qmlproperty enumeration GridView::flow
This property holds the flow of the grid.
- Possible values are \c GridView.LeftToRight (default) and \c GridView.TopToBottom.
+ Possible values:
- If \a flow is \c GridView.LeftToRight, the view will scroll vertically.
- If \a flow is \c GridView.TopToBottom, the view will scroll horizontally.
+ \list
+ \o GridView.LeftToRight (default) - Items are laid out from left to right, and the view scrolls vertically
+ \o GridView.TopToBottom - Items are laid out from top to bottom, and the view scrolls horizontally
+ \endlist
*/
QDeclarativeGridView::Flow QDeclarativeGridView::flow() const
{
@@ -1405,8 +1397,9 @@ void QDeclarativeGridView::setFlow(Flow flow)
\qmlproperty bool GridView::keyNavigationWraps
This property holds whether the grid wraps key navigation
- If this property is true then key presses to move off of one end of the grid will cause the
- selection to jump to the other side.
+ If this is true, key navigation that would move the current item selection
+ past one end of the view instead wraps around and moves the selection to
+ the other end of the view.
*/
bool QDeclarativeGridView::isWrapEnabled() const
{
@@ -1463,7 +1456,7 @@ void QDeclarativeGridView::setCacheBuffer(int buffer)
\qmlproperty int GridView::cellWidth
\qmlproperty int GridView::cellHeight
- These properties holds the width and height of each cell in the grid
+ These properties holds the width and height of each cell in the grid.
The default cell size is 100x100.
*/
@@ -1503,14 +1496,14 @@ void QDeclarativeGridView::setCellHeight(int cellHeight)
/*!
\qmlproperty enumeration GridView::snapMode
- This property determines where the view will settle following a drag or flick.
- The allowed values are:
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
\list
- \o GridView.NoSnap (default) - the view will stop anywhere within the visible area.
- \o GridView.SnapToRow - the view will settle with a row (or column for TopToBottom flow)
+ \o GridView.NoSnap (default) - the view stops anywhere within the visible area.
+ \o GridView.SnapToRow - the view settles with a row (or column for \c GridView.TopToBottom flow)
aligned with the start of the view.
- \o GridView.SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow)
+ \o GridView.SnapOneRow - the view will settle no more than one row (or column for \c GridView.TopToBottom flow)
away from the first visible row at the time the mouse button is released.
This mode is particularly useful for moving one page at a time.
\endlist
@@ -1789,22 +1782,22 @@ void QDeclarativeGridView::moveCurrentIndexRight()
\a mode:
\list
- \o Beginning - position item at the top (or left for TopToBottom flow) of the view.
- \o Center- position item in the center of the view.
- \o End - position item at bottom (or right for horizontal orientation) of the view.
- \o Visible - if any part of the item is visible then take no action, otherwise
+ \o GridView.Beginning - position item at the top (or left for \c GridView.TopToBottom flow) of the view.
+ \o GridView.Center - position item in the center of the view.
+ \o GridView.End - position item at bottom (or right for horizontal orientation) of the view.
+ \o GridView.Visible - if any part of the item is visible then take no action, otherwise
bring the item into view.
- \o Contain - ensure the entire item is visible. If the item is larger than
- the view the item is positioned at the top (or left for TopToBottom flow) of the view.
+ \o GridView.Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for \c GridView.TopToBottom flow) of the view.
\endlist
If positioning the view at the index would cause empty space to be displayed at
the beginning or end of the view, the view will be positioned at the boundary.
- It is not recommended to use contentX or contentY to position the view
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
at a particular index. This is unreliable since removing items from the start
of the view does not cause all other items to be repositioned.
- The correct way to bring an item into view is with positionViewAtIndex.
+ The correct way to bring an item into view is with \c positionViewAtIndex.
*/
void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 4593cf870c..94240c2f23 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -275,11 +275,6 @@ qreal QDeclarativeImage::paintedHeight() const
\o Image.Error - an error occurred while loading the image
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened with the image internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
-
Use this status to provide an update or respond to the status change in some way.
For example, you could:
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
index 5ea700d70b..fa5b2a91b6 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -87,8 +87,6 @@ protected:
QDeclarativeImage(QDeclarativeImagePrivate &dd, QDeclarativeItem *parent);
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
void pixmapChange();
-
-protected Q_SLOTS:
void updatePaintedGeometry();
private:
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 134bd6d97c..9949e6528d 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -97,9 +97,11 @@ QT_BEGIN_NAMESPACE
The Translate object provides independent control over position in addition to the Item's x and y properties.
- The following example moves the Y axis of the Rectangles while still allowing the Row element
+ The following example moves the Y axis of the \l Rectangle elements while still allowing the \l Row element
to lay the items out as if they had not been transformed:
\qml
+ import Qt 4.7
+
Row {
Rectangle {
width: 100; height: 100
@@ -113,6 +115,8 @@ QT_BEGIN_NAMESPACE
}
}
\endqml
+
+ \image translate.png
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
index 4add66daf8..38d5f597a4 100644
--- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
@@ -58,7 +58,10 @@ QT_BEGIN_NAMESPACE
taking its size hints into account, and you can propagate this to the other elements in your UI via anchors and bindings.
This is a QGraphicsLayoutItem subclass, and its properties merely expose the QGraphicsLayoutItem functionality to QML.
- See the QGraphicsLayoutItem documentation for further details.
+
+ The \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem example}
+ demonstrates how a LayoutItem can be used within a \l{Graphics View Framework}{Graphics View}
+ scene.
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 01928a1f74..dbd19768cf 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -427,6 +427,8 @@ public:
scheduleLayout();
}
}
+ if (currentItem && currentItem->item == item)
+ updateHighlight();
if (trackedItem && trackedItem->item == item)
q->trackedPositionChanged();
}
@@ -1103,7 +1105,9 @@ void QDeclarativeListViewPrivate::updateHeader()
void QDeclarativeListViewPrivate::fixupPosition()
{
- moveReason = Other;
+ if ((haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange)
+ || snapMode != QDeclarativeListView::NoSnap)
+ moveReason = Other;
if (orient == QDeclarativeListView::Vertical)
fixupY();
else
@@ -1325,13 +1329,11 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
Another component can display this model data in a ListView, like this:
- \table
- \row
- \o \snippet doc/src/snippets/declarative/listview/listview.qml import
+ \snippet doc/src/snippets/declarative/listview/listview.qml import
\codeline
\snippet doc/src/snippets/declarative/listview/listview.qml classdocs simple
- \o \image listview-simple.png
- \endtable
+
+ \image listview-simple.png
Here, the ListView creates a \c ContactModel component for its model, and a \l Text element
for its delegate. The view will create a new \l Text component for each item in the model. Notice
@@ -1342,13 +1344,10 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true
to enable keyboard navigation for the list view.
- \table
- \row
- \o \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced
- \o \image listview-highlight.png
- \endtable
+ \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced
+ \image listview-highlight.png
- In a ListView, delegates are instantiated as needed and may be destroyed at any time.
+ In a GridView, delegates are instantiated as needed and may be destroyed at any time.
State should \e never be stored in a delegate.
\note Views do not enable \e clip automatically. If the view
@@ -1634,7 +1633,7 @@ int QDeclarativeListView::count() const
This property holds the component to use as the highlight.
An instance of the highlight component is created for each list.
- The geometry of the resultant component instance is managed by the list
+ The geometry of the resulting component instance is managed by the list
so as to stay with the current item, unless the highlightFollowsCurrentItem
property is false.
@@ -1667,7 +1666,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
highlight is not moved by the view, and any movement must be implemented
by the highlight.
- Here is a highlight with its motion defined by the a \l {SpringFollow} item:
+ Here is a highlight with its motion defined by a \l {SpringFollow} item:
\snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem
@@ -2042,8 +2041,8 @@ void QDeclarativeListView::setHighlightResizeDuration(int duration)
/*!
\qmlproperty enumeration ListView::snapMode
- This property determines where the view's scrolling behavior stops following a drag or flick.
- The allowed values are:
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
\list
\o ListView.NoSnap (default) - the view stops anywhere within the visible area.
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 4995bafc81..898c5a564e 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -115,27 +115,37 @@ void QDeclarativeLoaderPrivate::initResize()
subtree from a QML URL or Component.
Loader instantiates an item from a component. The component to
- instantiate may be specified directly by the \c sourceComponent
- property, or loaded from a URL via the \c source property.
+ instantiate may be specified directly by the \l sourceComponent
+ property, or loaded from a URL via the \l source property.
It is also an effective means of delaying the creation of a component
until it is required:
\code
+ import Qt 4.7
+
Loader { id: pageLoader }
+
Rectangle {
- MouseArea { anchors.fill: parent; onClicked: pageLoader.source = "Page1.qml" }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: pageLoader.source = "Page1.qml"
+ }
}
\endcode
If the Loader source is changed, any previous items instantiated
- will be destroyed. Setting \c source to an empty string, or setting
+ will be destroyed. Setting \l source to an empty string, or setting
sourceComponent to \e undefined
will destroy the currently instantiated items, freeing resources
and leaving the Loader empty. For example:
\code
pageLoader.source = ""
+ \endcode
+
or
+
+ \code
pageLoader.sourceComponent = undefined
\endcode
@@ -340,19 +350,31 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
\o Loader.Error - an error occurred while loading the QML source
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened to the loader internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
- \list
- \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = Loader.Ready;}
- \o Do something inside the onLoaded signal handler, e.g. Loader{id: loader; onLoaded: console.log('Loaded');}
- \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=Loader.Ready){'Not Loaded';}else{'Loaded';}}
- \endlist
- \sa progress
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \e {Trigger a state change:}
+ \qml
+ State { name: 'loaded'; when: loader.status = Loader.Ready }
+ \endqml
+
+ \e {Implement an \c onStatusChanged signal handler:}
+ \qml
+ Loader {
+ id: loader
+ onStatusChanged: if (loader.status == Loader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \e {Bind to the status value:}
+ \qml
+ Text { text: loader.status != Loader.Ready ? 'Not Loaded' : 'Loaded' }
+ \endqml
Note that if the source is a local file, the status will initially be Ready (or Error). While
there will be no onStatusChanged signal in that case, the onLoaded will still be invoked.
+
+ \sa progress
*/
QDeclarativeLoader::Status QDeclarativeLoader::status() const
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 1947c0026f..6fca283b76 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -172,17 +172,21 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
A MouseArea is typically used in conjunction with a visible item,
where the MouseArea effectively 'proxies' mouse handling for that
- item. For example, we can put a MouseArea in a Rectangle that changes
- the Rectangle color to red when clicked:
- \snippet doc/src/snippets/declarative/mouseregion.qml 0
+ item. For example, we can put a MouseArea in a \l Rectangle that changes
+ the \l Rectangle color to red when clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/mousearea.qml intro
Many MouseArea signals pass a \l {MouseEvent}{mouse} parameter that contains
additional information about the mouse event, such as the position, button,
and any key modifiers.
- Below we have the previous
- example extended so as to give a different color when you right click.
- \snippet doc/src/snippets/declarative/mouseregion.qml 1
+ Here is an extension of the previous example that produces a different
+ color when the area is right clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea.qml intro-extended
For basic key handling, see the \l {Keys}{Keys attached property}.
@@ -238,7 +242,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
releasing is also considered a click).
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -262,7 +266,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
This handler is called when there is a release.
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -282,7 +286,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
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
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -328,10 +332,10 @@ QDeclarativeMouseArea::~QDeclarativeMouseArea()
while a button is pressed, and will remain valid as long as the button is held
even if the mouse is moved outside the area.
- If hoverEnabled is true then these properties will be valid:
+ If hoverEnabled is true then these properties will be valid when:
\list
- \i when no button is pressed, but the mouse is within the MouseArea (containsMouse is true).
- \i if a button is pressed and held, even if it has since moved out of the area.
+ \i no button is pressed, but the mouse is within the MouseArea (containsMouse is true).
+ \i a button is pressed and held, even if it has since moved out of the area.
\endlist
The coordinates are relative to the MouseArea.
@@ -378,18 +382,7 @@ void QDeclarativeMouseArea::setEnabled(bool a)
\endlist
The code below displays "right" when the right mouse buttons is pressed:
- \code
- Text {
- text: mr.pressedButtons & Qt.RightButton ? "right" : ""
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- MouseArea {
- id: mr
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- anchors.fill: parent
- }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/mousearea.qml mousebuttons
\sa acceptedButtons
*/
@@ -705,7 +698,7 @@ void QDeclarativeMouseArea::setHovered(bool h)
MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton }
\endcode
- The default is to accept the Left button.
+ The default value is \c Qt.LeftButton.
*/
Qt::MouseButtons QDeclarativeMouseArea::acceptedButtons() const
{
@@ -765,17 +758,19 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
\qmlproperty real MouseArea::drag.minimumY
\qmlproperty real MouseArea::drag.maximumY
- drag provides a convenient way to make an item draggable.
+ \c drag provides a convenient way to make an item draggable.
\list
- \i \c target specifies the item to drag.
- \i \c active specifies if the target item is being currently dragged.
- \i \c axis specifies whether dragging can be done horizontally (Drag.XAxis), vertically (Drag.YAxis), or both (Drag.XandYAxis)
- \i the minimum and maximum properties limit how far the target can be dragged along the corresponding axes.
+ \i \c drag.target specifies the item to drag.
+ \i \c drag.active specifies if the target item is currently being dragged.
+ \i \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XandYAxis)
+ \i \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes.
\endlist
- The following example uses drag to reduce the opacity of an image as it moves to the right:
- \snippet doc/src/snippets/declarative/drag.qml 0
+ The following example displays an image that can be dragged along the X-axis. The opacity
+ of the image is reduced when it is dragged to the right.
+
+ \snippet doc/src/snippets/declarative/mousearea.qml drag
*/
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index 141a938a37..a904869532 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -628,7 +628,7 @@ void QDeclarativePathLine::addToPath(QPainterPath &path)
\qml
Path {
startX: 0; startY: 0
- PathQuad x: 200; y: 0; controlX: 100; controlY: 150 }
+ PathQuad { x: 200; y: 0; controlX: 100; controlY: 150 }
}
\endqml
\endtable
@@ -713,8 +713,9 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path)
Path {
startX: 20; startY: 0
PathCubic {
- x: 180; y: 0; control1X: -10; control1Y: 90
- control2X: 210; control2Y: 90
+ x: 180; y: 0
+ control1X: -10; control1Y: 90
+ control2X: 210; control2Y: 90
}
}
\endqml
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 448ec069f8..f58b054b73 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -310,11 +310,21 @@ void QDeclarativePathViewPrivate::regenerate()
\brief The PathView element lays out model-provided items on a path.
\inherits Item
- The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML.
+ A PathView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
+ A ListView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed.
The \l delegate is instantiated for each item on the \l path.
The items may be flicked to move them along the path.
+ For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
+
+ \snippet doc/src/snippets/declarative/pathview/ContactModel.qml 0
+
+ This data can be represented as a PathView, like this:
+
\snippet doc/src/snippets/declarative/pathview/pathview.qml 0
\image pathview.gif
@@ -885,6 +895,7 @@ void QDeclarativePathView::setPathItemCount(int i)
if (i < 1)
i = 1;
d->pathItems = i;
+ d->updateMappedRange();
if (d->isValid() && isComponentComplete()) {
d->regenerate();
}
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 8796e63819..20cc46b035 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -302,7 +302,7 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
/*!
\qmlclass Column QDeclarativeColumn
\since 4.7
- \brief The Column item lines up its children vertically.
+ \brief The Column item arranges its children vertically.
\inherits Item
The Column item positions its child items so that they are vertically
@@ -346,7 +346,8 @@ Column {
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.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Column.
*/
/*!
@@ -396,7 +397,7 @@ Column {
spacing is the amount in pixels left empty between each adjacent
item, and defaults to 0.
- The below example places a Grid containing a red, a blue and a
+ 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.
@@ -468,17 +469,15 @@ void QDeclarativeColumn::reportConflictingAnchors()
/*!
\qmlclass Row QDeclarativeRow
\since 4.7
- \brief The Row item lines up its children horizontally.
+ \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. Spacing can be added between the
- items, and a margin around all items can also be added. 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.
+ 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
@@ -495,8 +494,8 @@ Row {
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
width of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
-
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Row.
*/
/*!
\qmlproperty Transition Row::add
@@ -504,12 +503,10 @@ Row {
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
+ 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.
-
-
*/
/*!
\qmlproperty Transition Row::move
@@ -540,7 +537,7 @@ Row {
spacing is the amount in pixels left empty between each adjacent
item, and defaults to 0.
- The below example places a Grid containing a red, a blue and a
+ 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.
@@ -610,18 +607,20 @@ void QDeclarativeRow::reportConflictingAnchors()
\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 the items. It also provides for transitions to be set when items 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.
- The Grid defaults to using four columns, and as many rows as
- are necessary to fit all the child items. The number of rows
- and/or the number of columns can be constrained by setting the rows
- or columns properties. The grid positioner calculates a grid with
+ 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
@@ -648,7 +647,8 @@ Grid {
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
width or height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Grid.
*/
/*!
\qmlproperty Transition Grid::add
@@ -658,12 +658,10 @@ Grid {
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.
- Added can mean that either the object has been created or
- reparented, and thus is now a child or the positioner, or that the
+ 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.
-
-
*/
/*!
\qmlproperty Transition Grid::move
@@ -714,18 +712,16 @@ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
\qmlproperty int Grid::columns
This property holds the number of columns in the grid.
- When the columns property is set the Grid will always have
- that many columns. Note that if you do not have enough items to
- fill this many columns some columns will be of zero width.
+ If the grid does not have enough items to fill the specified
+ number of columns, some columns will be of zero width.
*/
/*!
\qmlproperty int Grid::rows
This property holds the number of rows in the grid.
- When the rows property is set the Grid will always have that
- many rows. Note that if you do not have enough items to fill this
- many rows some rows will be of zero width.
+ If the grid does not have enough items to fill the specified
+ number of rows, some rows will be of zero width.
*/
void QDeclarativeGrid::setColumns(const int columns)
@@ -750,12 +746,14 @@ void QDeclarativeGrid::setRows(const int rows)
\qmlproperty enumeration Grid::flow
This property holds the flow of the layout.
- Possible values are \c Grid.LeftToRight (default) and \c Grid.TopToBottom.
+ Possible values are:
- If \a flow is \c Grid.LeftToRight, the items are positioned next to
- to each other from left to right, then wrapped to the next line.
- If \a flow is \c Grid.TopToBottom, the items are positioned next to each
- other from top to bottom, then wrapped to the next column.
+ \list
+ \o Grid.LeftToRight (default) - Items are positioned next to
+ to each other from left to right, then wrapped to the next line.
+ \o Grid.TopToBottom - Items are positioned next to each
+ other from top to bottom, then wrapped to the next column.
+ \endlist
*/
QDeclarativeGrid::Flow QDeclarativeGrid::flow() const
{
@@ -893,14 +891,18 @@ void QDeclarativeGrid::reportConflictingAnchors()
/*!
\qmlclass Flow QDeclarativeFlow
\since 4.7
- \brief The Flow item lines up its children side by side, wrapping as necessary.
+ \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.
+
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
width or height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Flow.
*/
/*!
@@ -909,9 +911,10 @@ void QDeclarativeGrid::reportConflictingAnchors()
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.
-
-
+ 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.
*/
/*!
\qmlproperty Transition Flow::move
@@ -965,14 +968,16 @@ QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
\qmlproperty enumeration Flow::flow
This property holds the flow of the layout.
- Possible values are \c Flow.LeftToRight (default) and \c Flow.TopToBottom.
+ Possible values are:
- If \a flow is \c Flow.LeftToRight, the items are positioned next to
+ \list
+ \o Flow.LeftToRight (default) - Items are positioned next to
to each other from left to right until the width of the Flow
is exceeded, then wrapped to the next line.
- If \a flow is \c Flow.TopToBottom, the items are positioned next to each
+ \o Flow.TopToBottom - Items are positioned next to each
other from top to bottom until the height of the Flow is exceeded,
then wrapped to the next column.
+ \endlist
*/
QDeclarativeFlow::Flow QDeclarativeFlow::flow() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index de3dbcd19e..2756877004 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -160,6 +160,8 @@ void QDeclarativeGradient::doUpdate()
You can also create rounded rectangles using the \l radius property.
\qml
+ import Qt 4.7
+
Rectangle {
width: 100
height: 100
@@ -206,7 +208,7 @@ void QDeclarativeRectangle::doUpdate()
border smoothness. Also, the border is rendered evenly on either side of the
rectangle's boundaries, and the spare pixel is rendered to the right and below the
rectangle (as documented for QRect rendering). This can cause unintended effects if
- \c border.width is 1 and the rectangle is \l{clip}{clipped} by a parent item:
+ \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item:
\table
\row
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 55cef8bf8c..f4722c3513 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -119,6 +119,8 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
A Text item can display both plain and rich text. For example:
\qml
+ import Qt 4.7
+
Text { text: "Hello World!"; font.family: "Helvetica"; font.pointSize: 24; color: "red" }
Text { text: "<b>Hello</b> <i>World!</i>" }
\endqml
@@ -477,6 +479,7 @@ void QDeclarativeText::setHAlign(HAlignment align)
return;
d->hAlign = align;
+ update();
emit horizontalAlignmentChanged(align);
}
@@ -493,6 +496,7 @@ void QDeclarativeText::setVAlign(VAlignment align)
return;
d->vAlign = align;
+ update();
emit verticalAlignmentChanged(align);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index ffb7dfef14..48826ffa85 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1106,9 +1106,15 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
- if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
- // re-open input panel on press if already focused
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (hasFocus() && hadFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasFocus() && !hadFocus) {
+ d->clickCausedFocus = true;
+ }
}
}
if (event->type() != QEvent::GraphicsSceneMouseDoubleClick || d->selectByMouse)
@@ -1125,6 +1131,17 @@ void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
+
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
}
@@ -1372,10 +1389,14 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextEdit element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextEdit element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
@@ -1384,12 +1405,19 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
TextEdit {
id: textEdit
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textEdit.openSoftwareInputPanel()
+ onClicked: {
+ if (!textEdit.focus) {
+ textEdit.focus = true;
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ textEdit.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputpanel()
}
\endcode
*/
@@ -1412,10 +1440,14 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextEdit element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextEdit element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
@@ -1424,12 +1456,19 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
TextEdit {
id: textEdit
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textEdit.openSoftwareInputPanel()
+ onClicked: {
+ if (!textEdit.focus) {
+ textEdit.focus = true;
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ textEdit.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputpanel()
}
\endcode
*/
@@ -1445,35 +1484,13 @@ void QDeclarativeTextEdit::closeSoftwareInputPanel()
}
}
-/*!
- \qmlproperty bool TextEdit::showInputPanelOnFocus
- Whether input panels are automatically shown when TextEdit element gains
- focus and hidden when focus is lost. By default this is set to true.
-
- Only relevant on platforms, which provide virtual keyboards.
-*/
-bool QDeclarativeTextEdit::showInputPanelOnFocus() const
-{
- Q_D(const QDeclarativeTextEdit);
- return d->showInputPanelOnFocus;
-}
-
-void QDeclarativeTextEdit::setShowInputPanelOnFocus(bool showOnFocus)
-{
- Q_D(QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus == showOnFocus)
- return;
-
- d->showInputPanelOnFocus = showOnFocus;
-
- emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
-}
-
void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusInEvent(event);
}
@@ -1481,8 +1498,10 @@ void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
- closeSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusOutEvent(event);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 3abfc352cf..3846d4962b 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -86,7 +86,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
- Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
@@ -167,9 +166,6 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool on);
- bool showInputPanelOnFocus() const;
- void setShowInputPanelOnFocus(bool showOnFocus);
-
bool persistentSelection() const;
void setPersistentSelection(bool on);
@@ -222,7 +218,6 @@ Q_SIGNALS:
void persistentSelectionChanged(bool isPersistentSelection);
void textMarginChanged(qreal textMargin);
void selectByMouseChanged(bool selectByMouse);
- void showInputPanelOnFocusChanged(bool showOnFocus);
public Q_SLOTS:
void selectAll();
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 8e1d63055f..4092e657f4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -70,12 +70,17 @@ public:
QDeclarativeTextEditPrivate()
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
- showInputPanelOnFocus(true), persistentSelection(true), textMargin(0.0), lastSelectionStart(0),
- lastSelectionEnd(0), cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText),
- document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
+ showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), textMargin(0.0),
+ lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0),
+ format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
selectByMouse(false),
yoff(0)
{
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
+ showInputPanelOnFocus = false;
+ }
+#endif
}
void init();
@@ -102,6 +107,7 @@ public:
bool cursorVisible : 1;
bool focusOnPress : 1;
bool showInputPanelOnFocus : 1;
+ bool clickCausedFocus : 1;
bool persistentSelection : 1;
qreal textMargin;
int lastSelectionStart;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 7b96c0cb89..1202101d24 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -891,6 +891,22 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
QDeclarativePaintedItem::keyPressEvent(ev);
}
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->selectByMouse) {
+ int cursor = d->xToPos(event->pos().x());
+ d->control->selectWordAtPos(cursor);
+ event->setAccepted(true);
+ } else {
+ QDeclarativePaintedItem::mouseDoubleClickEvent(event);
+ }
+}
+
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
@@ -903,12 +919,17 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
- if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
- // re-open input panel on press w already focused
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (hasFocus() && hadFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasFocus() && !hadFocus) {
+ d->clickCausedFocus = true;
+ }
}
}
-
bool mark = event->modifiers() & Qt::ShiftModifier;
int cursor = d->xToPos(event->pos().x());
d->control->moveCursor(cursor, mark);
@@ -933,6 +954,16 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
d->control->processEvent(event);
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
@@ -949,10 +980,9 @@ bool QDeclarativeTextInput::event(QEvent* ev)
case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMouseRelease:
+ case QEvent::GraphicsSceneMouseDoubleClick:
break;
default:
- if (ev->type() == QEvent::GraphicsSceneMouseDoubleClick && !d->selectByMouse)
- break;
handled = d->control->processEvent(ev);
if (ev->type() == QEvent::InputMethod)
updateSize();
@@ -1203,26 +1233,37 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextInput element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextInput element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
- \code
+ \qml
import Qt 4.7
TextInput {
id: textInput
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textInput.openSoftwareInputPanel()
+ onClicked: {
+ if (!textInput.focus) {
+ textInput.focus = true;
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ textInput.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputPanel()
}
- \endcode
+ \endqml
*/
void QDeclarativeTextInput::openSoftwareInputPanel()
{
@@ -1243,26 +1284,37 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextInput element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextInput element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
- \code
+ \qml
import Qt 4.7
TextInput {
id: textInput
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textInput.openSoftwareInputPanel()
+ onClicked: {
+ if (!textInput.focus) {
+ textInput.focus = true;
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ textInput.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputPanel()
}
- \endcode
+ \endqml
*/
void QDeclarativeTextInput::closeSoftwareInputPanel()
{
@@ -1277,35 +1329,13 @@ void QDeclarativeTextInput::closeSoftwareInputPanel()
}
}
-/*!
- \qmlproperty bool TextInput::showInputPanelOnFocus
- Whether input panels are automatically shown when TextInput element gains
- focus and hidden when focus is lost. By default this is set to true.
-
- Only relevant on platforms, which provide virtual keyboards.
-*/
-bool QDeclarativeTextInput::showInputPanelOnFocus() const
-{
- Q_D(const QDeclarativeTextInput);
- return d->showInputPanelOnFocus;
-}
-
-void QDeclarativeTextInput::setShowInputPanelOnFocus(bool showOnFocus)
-{
- Q_D(QDeclarativeTextInput);
- if (d->showInputPanelOnFocus == showOnFocus)
- return;
-
- d->showInputPanelOnFocus = showOnFocus;
-
- emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
-}
-
void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusInEvent(event);
}
@@ -1313,8 +1343,10 @@ void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
void QDeclarativeTextInput::focusOutEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
- closeSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusOutEvent(event);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 6bc6fc476b..e34634a42a 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -88,7 +88,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
- Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
@@ -177,9 +176,6 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool);
- bool showInputPanelOnFocus() const;
- void setShowInputPanelOnFocus(bool showOnFocus);
-
bool autoScroll() const;
void setAutoScroll(bool);
@@ -216,7 +212,6 @@ Q_SIGNALS:
void focusOnPressChanged(bool focusOnPress);
void autoScrollChanged(bool autoScroll);
void selectByMouseChanged(bool selectByMouse);
- void showInputPanelOnFocusChanged(bool showOnFocus);
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -225,6 +220,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent(QKeyEvent* ev);
bool event(QEvent *e);
void focusInEvent(QFocusEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index f44d014e3a..68651479c4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -72,9 +72,15 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
- showInputPanelOnFocus(true), cursorVisible(false), autoScroll(true),
- selectByMouse(false)
+ showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
+ autoScroll(true), selectByMouse(false)
{
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
+ showInputPanelOnFocus = false;
+ }
+#endif
+
}
~QDeclarativeTextInputPrivate()
@@ -116,6 +122,7 @@ public:
bool focused;
bool focusOnPress;
bool showInputPanelOnFocus;
+ bool clickCausedFocus;
bool cursorVisible;
bool autoScroll;
bool selectByMouse;
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index c6ee46f387..2a88a80ce0 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -119,11 +119,11 @@ public:
visual delegate (items).
An item can determine its index within the
- model via the VisualItemModel.index attached property.
+ model via the \c VisualItemModel.index attached property.
The example below places three colored rectangles in a ListView.
\code
- Item {
+ Rectangle {
VisualItemModel {
id: itemModel
Rectangle { height: 30; width: 80; color: "red" }
@@ -137,6 +137,8 @@ public:
}
}
\endcode
+
+ \image visualitemmodel.png
*/
QDeclarativeVisualItemModel::QDeclarativeVisualItemModel(QObject *parent)
: QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate), parent)
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 6b6cd0abcb..1f5aaf1cae 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -108,7 +108,7 @@ public:
class QDeclarativeComponentAttached;
class QDeclarativeGuardedContextData;
-class QDeclarativeContextData
+class Q_AUTOTEST_EXPORT QDeclarativeContextData
{
public:
QDeclarativeContextData();
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index b01e5cc182..72cfebaf88 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
class QMetaProperty;
-class QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+class Q_AUTOTEST_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
QDeclarativePropertyCache(QDeclarativeEngine *);
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 2ca030e2c4..e0ee84f84b 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -521,7 +521,7 @@ void QDeclarativeWorkerScriptEngine::run()
that the main GUI thread is not blocked.
Messages can be passed between the new thread and the parent thread
- using sendMessage() and the onMessage() handler.
+ using \l sendMessage() and the \l {WorkerScript::onMessage}{onMessage()} handler.
Here is an example:
@@ -555,7 +555,7 @@ QDeclarativeWorkerScript::~QDeclarativeWorkerScript()
/*!
\qmlproperty url WorkerScript::source
- This holds the url of the javascript file that implements the
+ This holds the url of the JavaScript file that implements the
\tt WorkerScript.onMessage() handler for threaded operations.
*/
QUrl QDeclarativeWorkerScript::source() const
@@ -576,7 +576,7 @@ void QDeclarativeWorkerScript::setSource(const QUrl &source)
emit sourceChanged();
}
-/*
+/*!
\qmlmethod WorkerScript::sendMessage(jsobject message)
Sends the given \a message to a worker script handler in another
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index de1c0cbddc..0eae136030 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -557,6 +557,8 @@ void QDeclarativeAbstractAnimation::timelineComplete()
NumberAnimation { ... duration: 200 }
}
\endcode
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -627,6 +629,8 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
When used in a transition, ColorAnimation will by default animate
all properties of type color that are changing. If a property or properties
are explicitly set for the animation, then those will be used instead.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -1082,11 +1086,13 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
\inherits PropertyAnimation
\brief The NumberAnimation element allows you to animate changes in properties of type qreal.
- Animate a set of properties over 200ms, from their values in the start state to
+ For example, to animate a set of properties over 200ms, from their values in the start state to
their values in the end state of the transition:
\code
NumberAnimation { properties: "x,y,scale"; duration: 200 }
\endcode
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1156,6 +1162,8 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
\since 4.7
\inherits PropertyAnimation
\brief The Vector3dAnimation element allows you to animate changes in properties of type QVector3d.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1224,7 +1232,8 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
When used in a transition RotationAnimation will rotate all
properties named "rotation" or "angle". You can override this by providing
- your own properties via \c properties or \c property.
+ your own properties via \l {PropertyAnimation::properties}{properties} or
+ \l {PropertyAnimation::property}{property}.
In the following example we use RotationAnimation to animate the rotation
between states via the shortest path.
@@ -1238,6 +1247,8 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
RotationAnimation { direction: RotationAnimation.Shortest }
}
\endqml
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1446,7 +1457,7 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
}
\endcode
- \sa ParallelAnimation
+ \sa ParallelAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativeSequentialAnimation::QDeclarativeSequentialAnimation(QObject *parent) :
@@ -1508,7 +1519,7 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
}
\endcode
- \sa SequentialAnimation
+ \sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -1657,6 +1668,8 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
Depending on how the animation is used, the set of properties normally used will be
different. For more information see the individual property documentation, as well
as the \l{QML Animation} introduction.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QObject *parent)
@@ -2319,6 +2332,8 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
When used in a transition, ParentAnimation will by default animate
all ParentChanges.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index c73f827f0d..3c2e2394a0 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -83,6 +83,8 @@ public:
Example:
\qml
+ import Qt 4.7
+
FontLoader { id: fixedFont; name: "Courier" }
FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
@@ -183,15 +185,26 @@ void QDeclarativeFontLoader::setName(const QString &name)
\o FontLoader.Error - an error occurred while loading the font
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened to the font loader internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
- \list
- \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = FontLoader.Ready;}
- \o Do something inside the onStatusChanged signal handler, e.g. FontLoader{id: loader; onStatusChanged: if(loader.status == FontLoader.Ready) console.log('Loaded');}
- \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=FontLoader.Ready){'Not Loaded';}else{'Loaded';}}
- \endlist
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \e {Trigger a state change:}
+ \qml
+ State { name: 'loaded'; when: loader.status = FontLoader.Ready }
+ \endqml
+
+ \e {Implement an \c onStatusChanged signal handler:}
+ \qml
+ FontLoader {
+ id: loader
+ onStatusChanged: if (loader.status == FontLoader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \e {Bind to the status value:}
+ \qml
+ Text { text: loader.status != FontLoader.Ready ? 'Not Loaded' : 'Loaded' }
+ \endqml
*/
QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const
{
diff --git a/src/declarative/util/qdeclarativepackage_p.h b/src/declarative/util/qdeclarativepackage_p.h
index 87d9b80240..57d9c2211d 100644
--- a/src/declarative/util/qdeclarativepackage_p.h
+++ b/src/declarative/util/qdeclarativepackage_p.h
@@ -58,7 +58,7 @@ QT_MODULE(Declarative)
class QDeclarativePackagePrivate;
class QDeclarativePackageAttached;
-class QDeclarativePackage : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativePackage : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePackage)
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 08f47509d9..e98afeba7b 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
PropertyChanges provides a state change that modifies the properties of an item.
- Here is a property change that modifies the text and color of a Text element
+ Here is a property change that modifies the text and color of a \l Text element
when it is clicked:
\qml
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index bd48ef0112..6b6df4d5b3 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -307,7 +307,7 @@ Rectangle {
set to a value such as 0.5 units/second. Animating from 0 to 1.0 with a velocity
of 0.5 will take 2000 ms to complete.
- \sa SpringFollow
+ \sa SpringFollow, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent)
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
index 81cd22938c..8cdbea2696 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
@@ -65,7 +65,7 @@
QT_BEGIN_NAMESPACE
-class QSmoothedAnimation : public QAbstractAnimation
+class Q_AUTOTEST_EXPORT QSmoothedAnimation : public QAbstractAnimation
{
public:
QSmoothedAnimation(QObject *parent=0);
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
index 25715c601f..37b24cb2f0 100644
--- a/src/declarative/util/qdeclarativestate_p.h
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -84,7 +84,7 @@ public:
void deleteFromBinding();
};
-class QDeclarativeActionEvent
+class Q_AUTOTEST_EXPORT QDeclarativeActionEvent
{
public:
virtual ~QDeclarativeActionEvent();
diff --git a/src/declarative/util/qdeclarativetimeline_p_p.h b/src/declarative/util/qdeclarativetimeline_p_p.h
index 598c897f9f..61f6bcdf95 100644
--- a/src/declarative/util/qdeclarativetimeline_p_p.h
+++ b/src/declarative/util/qdeclarativetimeline_p_p.h
@@ -63,7 +63,7 @@ class QDeclarativeTimeLineValue;
class QDeclarativeTimeLineCallback;
struct QDeclarativeTimeLinePrivate;
class QDeclarativeTimeLineObject;
-class QDeclarativeTimeLine : public QAbstractAnimation
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLine : public QAbstractAnimation
{
Q_OBJECT
public:
@@ -117,7 +117,7 @@ private:
QDeclarativeTimeLinePrivate *d;
};
-class QDeclarativeTimeLineObject
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineObject
{
public:
QDeclarativeTimeLineObject();
@@ -129,7 +129,7 @@ protected:
QDeclarativeTimeLine *_t;
};
-class QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject
{
public:
QDeclarativeTimeLineValue(qreal v = 0.) : _v(v) {}
@@ -147,7 +147,7 @@ private:
qreal _v;
};
-class QDeclarativeTimeLineCallback
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineCallback
{
public:
typedef void (*Callback)(void *);
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
index 53a9d83e06..9e18eb54a6 100644
--- a/src/declarative/util/qdeclarativetimer.cpp
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -80,17 +80,22 @@ public:
the text every 500 milliseconds:
\qml
- Timer {
- interval: 500; running: true; repeat: true
- onTriggered: time.text = Date().toString()
- }
- Text {
- id: time
+ import Qt 4.7
+
+ Item {
+ Timer {
+ interval: 500; running: true; repeat: true
+ onTriggered: time.text = Date().toString()
+ }
+
+ Text {
+ id: time
+ }
}
\endqml
- QDeclarativeTimer is synchronized with the animation timer. Since the animation
- timer is usually set to 60fps, the resolution of QDeclarativeTimer will be
+ The Timer element is synchronized with the animation timer. Since the animation
+ timer is usually set to 60fps, the resolution of Timer will be
at best 16ms.
If the Timer is running and one of its properties is changed, the
@@ -98,8 +103,6 @@ public:
1000ms has its \e repeat property changed 500ms after starting, the
elapsed time will be reset to 0, and the Timer will be triggered
1000ms later.
-
- \sa {QtDeclarative}
*/
QDeclarativeTimer::QDeclarativeTimer(QObject *parent)
diff --git a/src/declarative/util/qdeclarativetransitionmanager_p_p.h b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
index 2e23898339..75d11a9376 100644
--- a/src/declarative/util/qdeclarativetransitionmanager_p_p.h
+++ b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeStatePrivate;
class QDeclarativeTransitionManagerPrivate;
-class QDeclarativeTransitionManager
+class Q_AUTOTEST_EXPORT QDeclarativeTransitionManager
{
public:
QDeclarativeTransitionManager();
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index ec019e2d73..f43f344c1b 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -74,6 +74,21 @@ data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resou
// iconengines stubs
data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+// qml import plugins
+file=ABI_DIR\BUILD_DIR\qmlwebkitplugin.dll SHARED_LIB_DIR\qmlwebkitplugin.dll
+file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll
+file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll
+file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll
+
+data=\epoc32\data\z\resource\qt\imports\org\webkit\qmlwebkitplugin.qtplugin resource\qt\imports\org\webkit\qmlwebkitplugin.qtplugin
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin
+
+data=\epoc32\data\z\resource\qt\imports\org\webkit\qmldir resource\qt\imports\org\webkit\qmldir
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir
+data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir
// QtMultimedia audio backend
data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio\qaudio.qtplugin
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 90c362b1d3..532269d19a 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -11,21 +11,24 @@ symbian: {
isEmpty(QT_LIBINFIX) {
TARGET.UID3 = 0x2001E61C
-
- # sqlite3 is expected to be already found on phone if infixed configuration is built.
- BLD_INF_RULES.prj_exports += \
- "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
- "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
- symbian-abld|symbian-sbsv2 {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
- } else {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${PWD}/sqlite3.sis\", (0x2002af5f)"
+
+ # Sqlite3 is expected to be already found on phone if infixed configuration is built.
+ # It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ BLD_INF_RULES.prj_exports += \
+ "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
+ "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
+ symbian-abld|symbian-sbsv2 {
+ sqlitedeployment = \
+ "; Deploy sqlite onto phone that does not have it already" \
+ "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
+ } else {
+ sqlitedeployment = \
+ "; Deploy sqlite onto phone that does not have it already" \
+ "@\"$${PWD}/sqlite3.sis\", (0x2002af5f)"
+ }
+ qtlibraries.pkg_postrules += sqlitedeployment
}
- qtlibraries.pkg_postrules += sqlitedeployment
} else {
# Always use experimental UID for infixed configuration to avoid UID clash
TARGET.UID3 = 0xE001E61C
@@ -81,12 +84,16 @@ symbian: {
qtlibraries.pkg_prerules = vendorinfo
qtlibraries.pkg_prerules += "; Dependencies of Qt libraries"
- qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
- contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
- }
- contains(CONFIG, stl) {
- qtlibraries.pkg_prerules += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
+
+ # It is expected that Symbian^3 and newer phones will have sufficiently new OpenC already installed
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
+ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
+ qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
+ }
+ contains(CONFIG, stl) {
+ qtlibraries.pkg_prerules += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
+ }
}
qtlibraries.pkg_prerules += "(0x2002af5f), 0, 5, 0, {\"sqlite3\"}"
@@ -143,12 +150,39 @@ symbian: {
contains(QT_CONFIG, declarative): {
qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtDeclarative$${QT_LIBINFIX}.dll
+
+ folderlistmodelImport.sources = $$QMAKE_LIBDIR_QT/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll
+ gesturesImport.sources = $$QMAKE_LIBDIR_QT/qmlgesturesplugin$${QT_LIBINFIX}.dll
+ particlesImport.sources = $$QMAKE_LIBDIR_QT/qmlparticlesplugin$${QT_LIBINFIX}.dll
+
+ folderlistmodelImport.sources += $$QT_SOURCE_TREE/src/imports/folderlistmodel/qmldir
+ gesturesImport.sources += $$QT_SOURCE_TREE/src/imports/gestures/qmldir
+ particlesImport.sources += $$QT_SOURCE_TREE/src/imports/particles/qmldir
+
+ folderlistmodelImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/folderlistmodel
+ gesturesImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/gestures
+ particlesImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/particles
+
+ DEPLOYMENT += folderlistmodelImport gesturesImport particlesImport
+
+ contains(QT_CONFIG, webkit): {
+ webkitImport.sources = $$QMAKE_LIBDIR_QT/qmlwebkitplugin$${QT_LIBINFIX}.dll
+ webkitImport.sources += $$QT_SOURCE_TREE/src/imports/webkit/qmldir
+ webkitImport.path = $$QT_IMPORTS_BASE_DIR/org/webkit
+ DEPLOYMENT += webkitImport
+ }
}
graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
contains(QT_CONFIG, openvg) {
qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenVG$${QT_LIBINFIX}.dll
graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qvggraphicssystem$${QT_LIBINFIX}.dll
+ # OpenVG requires Symbian^3 or later
+ pkg_platform_dependencies -= \
+ "[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+ "[0x102032BE],0,0,0,{\"S60ProductID\"}" \
+ "[0x102752AE],0,0,0,{\"S60ProductID\"}" \
+ "[0x1028315F],0,0,0,{\"S60ProductID\"}"
}
contains(QT_CONFIG, multimedia){
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 47c5b6377e..fbab30e7cf 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -50,6 +50,7 @@
#include <QtDeclarative/qdeclarativeexpression.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativetextedit_p.h>
+#include <private/qdeclarativetextedit_p_p.h>
#include <QFontMetrics>
#include <QDeclarativeView>
#include <QStyle>
@@ -86,7 +87,8 @@ private slots:
void delegateLoading();
void navigation();
void readOnly();
- void sendRequestSoftwareInputPanelEvent();
+ void openInputPanelOnClick();
+ void openInputPanelOnFocus();
void geometrySignals();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -817,14 +819,14 @@ public:
bool closeInputPanelReceived;
};
-void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
+void tst_qdeclarativetextedit::openInputPanelOnClick()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
QDeclarativeTextEdit edit;
- QSignalSpy inputPanelonFocusSpy(&edit, SIGNAL(showInputPanelOnFocusChanged(bool)));
+ QSignalSpy focusOnPressSpy(&edit, SIGNAL(focusOnPressChanged(bool)));
edit.setText("Hello world");
edit.setPos(0, 0);
scene.addItem(&edit);
@@ -834,7 +836,58 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
- QVERIFY(edit.showInputPanelOnFocus());
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+
+ // input panel on click
+ editPrivate->showInputPanelOnFocus = false;
+
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.openInputPanelReceived, true);
+ }
+ ic.openInputPanelReceived = false;
+
+ // focus should not cause input panels to open or close
+ edit.setFocus(false);
+ edit.setFocus(true);
+ edit.setFocus(false);
+ edit.setFocus(true);
+ edit.setFocus(false);
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+}
+
+void tst_qdeclarativetextedit::openInputPanelOnFocus()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ QSignalSpy focusOnPressSpy(&edit, SIGNAL(focusOnPressChanged(bool)));
+ edit.setText("Hello world");
+ edit.setPos(0, 0);
+ scene.addItem(&edit);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ editPrivate->showInputPanelOnFocus = true;
+
+ QVERIFY(edit.focusOnPress());
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
@@ -867,9 +920,9 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.closeInputPanelReceived, true);
ic.closeInputPanelReceived = false;
- // no input panel events if showInputPanelOnFocus is false
- edit.setShowInputPanelOnFocus(false);
- QCOMPARE(inputPanelonFocusSpy.count(),1);
+ // no automatic input panel events if focusOnPress is false
+ edit.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
edit.setFocus(false);
@@ -877,8 +930,8 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
- edit.setShowInputPanelOnFocus(false);
- QCOMPARE(inputPanelonFocusSpy.count(),1);
+ edit.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
// one show input panel event when openSoftwareInputPanel is called
edit.openSoftwareInputPanel();
@@ -892,14 +945,17 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.closeInputPanelReceived, true);
ic.openInputPanelReceived = false;
- // set showInputPanelOnFocus back to true
- edit.setShowInputPanelOnFocus(true);
- QCOMPARE(inputPanelonFocusSpy.count(),2);
+ // set focusOnPress back to true
+ edit.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
edit.setFocus(false);
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, true);
ic.closeInputPanelReceived = false;
+ edit.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+
// active window focus reason should not cause input panel to open
QGraphicsObject * editObject = qobject_cast<QGraphicsObject*>(&edit);
editObject->setFocus(Qt::ActiveWindowFocusReason);
@@ -910,9 +966,6 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
edit.setFocus(true);
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
-
- edit.setShowInputPanelOnFocus(true);
- QCOMPARE(inputPanelonFocusSpy.count(),2);
}
void tst_qdeclarativetextedit::geometrySignals()
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index c943c89ae2..3cb4da0052 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -45,6 +45,7 @@
#include <QFile>
#include <QtDeclarative/qdeclarativeview.h>
#include <private/qdeclarativetextinput_p.h>
+#include <private/qdeclarativetextinput_p_p.h>
#include <QDebug>
#include <QStyle>
#include <QInputContext>
@@ -74,7 +75,8 @@ private slots:
void navigation();
void readOnly();
- void sendRequestSoftwareInputPanelEvent();
+ void openInputPanelOnClick();
+ void openInputPanelOnFocus();
void setHAlignClearCache();
void focusOutClearSelection();
@@ -763,14 +765,14 @@ public:
bool closeInputPanelReceived;
};
-void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
+void tst_qdeclarativetextinput::openInputPanelOnClick()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
QDeclarativeTextInput input;
- QSignalSpy inputPanelonFocusSpy(&input, SIGNAL(showInputPanelOnFocusChanged(bool)));
+ QSignalSpy focusOnPressSpy(&input, SIGNAL(focusOnPressChanged(bool)));
input.setText("Hello world");
input.setPos(0, 0);
scene.addItem(&input);
@@ -780,7 +782,58 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
- QVERIFY(input.showInputPanelOnFocus());
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
+ QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+
+ // input panel on click
+ inputPrivate->showInputPanelOnFocus = false;
+
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.openInputPanelReceived, true);
+ }
+ ic.openInputPanelReceived = false;
+
+ // focus should not cause input panels to open or close
+ input.setFocus(false);
+ input.setFocus(true);
+ input.setFocus(false);
+ input.setFocus(true);
+ input.setFocus(false);
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+}
+
+void tst_qdeclarativetextinput::openInputPanelOnFocus()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ QSignalSpy focusOnPressSpy(&input, SIGNAL(focusOnPressChanged(bool)));
+ input.setText("Hello world");
+ input.setPos(0, 0);
+ scene.addItem(&input);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
+ QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+ inputPrivate->showInputPanelOnFocus = true;
+
+ QVERIFY(input.focusOnPress());
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
@@ -813,9 +866,9 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.closeInputPanelReceived, true);
ic.closeInputPanelReceived = false;
- // no input panel events if showInputPanelOnFocus is false
- input.setShowInputPanelOnFocus(false);
- QCOMPARE(inputPanelonFocusSpy.count(),1);
+ // no automatic input panel events if focusOnPress is false
+ input.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
input.setFocus(false);
@@ -823,8 +876,8 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
- input.setShowInputPanelOnFocus(false);
- QCOMPARE(inputPanelonFocusSpy.count(),1);
+ input.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
// one show input panel event when openSoftwareInputPanel is called
input.openSoftwareInputPanel();
@@ -838,14 +891,17 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.closeInputPanelReceived, true);
ic.openInputPanelReceived = false;
- // set showInputPanelOnFocus back to true
- input.setShowInputPanelOnFocus(true);
- QCOMPARE(inputPanelonFocusSpy.count(),2);
+ // set focusOnPress back to true
+ input.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
input.setFocus(false);
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, true);
ic.closeInputPanelReceived = false;
+ input.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+
// active window focus reason should not cause input panel to open
QGraphicsObject * inputObject = qobject_cast<QGraphicsObject*>(&input);
inputObject->setFocus(Qt::ActiveWindowFocusReason);
@@ -856,9 +912,6 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
input.setFocus(true);
QCOMPARE(ic.openInputPanelReceived, false);
QCOMPARE(ic.closeInputPanelReceived, false);
-
- input.setShowInputPanelOnFocus(true);
- QCOMPARE(inputPanelonFocusSpy.count(),2);
}
class MyTextInput : public QDeclarativeTextInput
diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
index 687fac64fa..be911a3698 100644
--- a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
+++ b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
@@ -1,10 +1,19 @@
import Qt 4.7
Rectangle {
color: "black"
- width: (runtime.orientation == Orientation.Landscape) ? 300 : 200
- height: (runtime.orientation == Orientation.Landscape) ? 200 : 300
+ width: (runtime.orientation == Orientation.RightUp || runtime.orientation == Orientation.LeftUp) ? 300 : 200
+ height: (runtime.orientation == Orientation.RightUp || runtime.orientation == Orientation.LeftUp) ? 200 : 300
Text {
- text: runtime.orientation == Orientation.Landscape ? "Landscape" : "Portrait"
+ text: {
+ if (runtime.orientation == Orientation.TopUp)
+ return "TopUp"
+ if (runtime.orientation == Orientation.TopDown)
+ return "TopDown"
+ if (runtime.orientation == Orientation.LeftUp)
+ return "LeftUp"
+ if (runtime.orientation == Orientation.RightUp)
+ return "RightUp"
+ }
color: "white"
}
-} \ No newline at end of file
+}
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 9429dc9fdc..f296d9eff6 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -82,7 +82,7 @@ void tst_QDeclarativeViewer::orientation()
QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
QCOMPARE(viewer->size(), viewer->sizeHint());
- viewer->toggleOrientation();
+ viewer->rotateOrientation();
qApp->processEvents();
QCOMPARE(rootItem->width(), 300.0);
@@ -92,7 +92,7 @@ void tst_QDeclarativeViewer::orientation()
QCOMPARE(viewer->size(), QSize(300, 200+viewer->menuBar()->height()));
QCOMPARE(viewer->size(), viewer->sizeHint());
- viewer->toggleOrientation();
+ viewer->rotateOrientation();
qApp->processEvents();
QCOMPARE(rootItem->width(), 200.0);
diff --git a/tools/qml/deviceorientation.cpp b/tools/qml/deviceorientation.cpp
index e7c70d5fde..a13b912a34 100644
--- a/tools/qml/deviceorientation.cpp
+++ b/tools/qml/deviceorientation.cpp
@@ -47,7 +47,7 @@ class DefaultDeviceOrientation : public DeviceOrientation
{
Q_OBJECT
public:
- DefaultDeviceOrientation() : DeviceOrientation(), m_orientation(DeviceOrientation::Portrait) {}
+ DefaultDeviceOrientation() : DeviceOrientation(), m_orientation(DeviceOrientation::TopUp) {}
Orientation orientation() const {
return m_orientation;
diff --git a/tools/qml/deviceorientation.h b/tools/qml/deviceorientation.h
index d209005b4d..fe73868486 100644
--- a/tools/qml/deviceorientation.h
+++ b/tools/qml/deviceorientation.h
@@ -52,7 +52,14 @@ class DeviceOrientation : public QObject
Q_OBJECT
Q_ENUMS(Orientation)
public:
- enum Orientation { UnknownOrientation, Portrait, Landscape };
+ enum Orientation {
+ UnknownOrientation,
+ TopUp,
+ TopDown,
+ LeftUp,
+ RightUp
+ };
+
virtual Orientation orientation() const = 0;
virtual void setOrientation(Orientation) = 0;
diff --git a/tools/qml/deviceorientation_maemo.cpp b/tools/qml/deviceorientation_maemo.cpp
index 9f12f3d509..501ff79ef4 100644
--- a/tools/qml/deviceorientation_maemo.cpp
+++ b/tools/qml/deviceorientation_maemo.cpp
@@ -48,11 +48,11 @@ class MaemoOrientation : public DeviceOrientation
Q_OBJECT
public:
MaemoOrientation()
- : DeviceOrientation(),m_current(Portrait), m_lastSeen(Portrait), m_lastSeenCount(0)
+ : DeviceOrientation(),m_current(TopUp), m_lastSeen(TopUp), m_lastSeenCount(0)
{
m_current = get();
if (m_current == UnknownOrientation)
- m_current = Portrait;
+ m_current = TopUp;
startTimer(100);
}
@@ -101,9 +101,13 @@ private:
if (abs(az) > 850) {
o = UnknownOrientation;
} else if (ax < -750) {
- o = Portrait;
+ o = LeftUp;
+ } else if (ax > 750) {
+ o = RightUp;
} else if (ay < -750) {
- o = Landscape;
+ o = TopUp;
+ } else if (ay > 750) {
+ o = TopDown;
}
return o;
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index fe323c147c..f68130332d 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -367,7 +367,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
#endif
, loggerWindow(new LoggerWidget())
, frame_stream(0), mb(0)
- , portraitOrientation(0), landscapeOrientation(0)
+ , orientation(0)
, showWarningsWindow(0)
, m_scriptOptions(0)
, tester(0)
@@ -418,7 +418,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
if (!(flags & Qt::FramelessWindowHint)) {
createMenu(menuBar(),0);
- setPortrait();
+ changeOrientation(orientation->actions().value(0));
}
#if !defined(Q_OS_SYMBIAN)
@@ -571,26 +571,25 @@ void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
- QActionGroup *orientation = new QActionGroup(parent);
+ orientation = new QActionGroup(parent);
- QAction *toggleOrientation = new QAction(tr("&Toggle Orientation"), parent);
- toggleOrientation->setCheckable(true);
- toggleOrientation->setShortcut(QKeySequence("Ctrl+T"));
- settingsMenu->addAction(toggleOrientation);
- connect(toggleOrientation, SIGNAL(triggered()), this, SLOT(toggleOrientation()));
+ QAction *rotateOrientation = new QAction(tr("Rotate orientation"), parent);
+ rotateOrientation->setShortcut(QKeySequence("Ctrl+T"));
+ settingsMenu->addAction(rotateOrientation);
+ connect(rotateOrientation, SIGNAL(triggered()), this, SLOT(rotateOrientation()));
orientation->setExclusive(true);
- portraitOrientation = new QAction(tr("orientation: Portrait"), parent);
- portraitOrientation->setCheckable(true);
- connect(portraitOrientation, SIGNAL(triggered()), this, SLOT(setPortrait()));
- orientation->addAction(portraitOrientation);
- propertiesMenu->addAction(portraitOrientation);
-
- landscapeOrientation = new QAction(tr("orientation: Landscape"), parent);
- landscapeOrientation->setCheckable(true);
- connect(landscapeOrientation, SIGNAL(triggered()), this, SLOT(setLandscape()));
- orientation->addAction(landscapeOrientation);
- propertiesMenu->addAction(landscapeOrientation);
+ connect(orientation, SIGNAL(triggered(QAction*)), this, SLOT(changeOrientation(QAction*)));
+
+ orientation->addAction(tr("orientation: TopUp"));
+ orientation->addAction(tr("orientation: LeftUp"));
+ orientation->addAction(tr("orientation: TopDown"));
+ orientation->addAction(tr("orientation: RightUp"));
+ QList<QAction *> actions = orientation->actions();
+ for (int i=0; i<actions.count(); i++) {
+ propertiesMenu->addAction(actions[i]);
+ actions[i]->setCheckable(true);
+ }
if (flatmenu) flatmenu->addSeparator();
@@ -624,21 +623,16 @@ void QDeclarativeViewer::proxySettingsChanged()
reload ();
}
-void QDeclarativeViewer::setPortrait()
-{
- DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait);
- portraitOrientation->setChecked(true);
-}
-
-void QDeclarativeViewer::setLandscape()
+void QDeclarativeViewer::rotateOrientation()
{
- DeviceOrientation::instance()->setOrientation(DeviceOrientation::Landscape);
- landscapeOrientation->setChecked(true);
-}
+ QAction *current = orientation->checkedAction();
+ QList<QAction *> actions = orientation->actions();
+ int index = actions.indexOf(current);
+ if (index < 0)
+ return;
-void QDeclarativeViewer::toggleOrientation()
-{
- DeviceOrientation::instance()->setOrientation(DeviceOrientation::instance()->orientation()==DeviceOrientation::Portrait?DeviceOrientation::Landscape:DeviceOrientation::Portrait);
+ QAction *newOrientation = actions[(index + 1) % actions.count()];
+ changeOrientation(newOrientation);
}
void QDeclarativeViewer::toggleFullScreen()
@@ -971,12 +965,7 @@ void QDeclarativeViewer::keyPressEvent(QKeyEvent *event)
} else if (event->key() == Qt::Key_F9 || (event->key() == Qt::Key_9 && devicemode)) {
toggleRecording();
} else if (event->key() == Qt::Key_F10) {
- if (portraitOrientation) {
- if (portraitOrientation->isChecked())
- setLandscape();
- else
- setPortrait();
- }
+ rotateOrientation();
}
QWidget::keyPressEvent(event);
@@ -1181,6 +1170,23 @@ void QDeclarativeViewer::recordFrame()
}
}
+void QDeclarativeViewer::changeOrientation(QAction *action)
+{
+ if (!action)
+ return;
+ action->setChecked(true);
+
+ QString o = action->text().split(QLatin1Char(':')).value(1).trimmed();
+ if (o == QLatin1String("TopUp"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::TopUp);
+ else if (o == QLatin1String("TopDown"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::TopDown);
+ else if (o == QLatin1String("LeftUp"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::LeftUp);
+ else if (o == QLatin1String("RightUp"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::RightUp);
+}
+
void QDeclarativeViewer::orientationChanged()
{
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 5086e02e24..27bd217f52 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -124,7 +124,7 @@ public slots:
void ffmpegFinished(int code);
void showProxySettings ();
void proxySettingsChanged ();
- void toggleOrientation();
+ void rotateOrientation();
void statusChanged();
void setSlowMode(bool);
void launch(const QString &);
@@ -140,9 +140,8 @@ private slots:
void recordFrame();
void chooseRecordingOptions();
void pickRecordingFile();
- void setPortrait();
- void setLandscape();
void toggleFullScreen();
+ void changeOrientation(QAction*);
void orientationChanged();
void showWarnings(bool show);
@@ -183,9 +182,7 @@ private:
bool ffmpegAvailable;
bool convertAvailable;
- QAction *portraitOrientation;
- QAction *landscapeOrientation;
-
+ QActionGroup *orientation;
QAction *showWarningsWindow;
QString m_script;