summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-23 19:04:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-23 19:04:14 (GMT)
commit0727c544915427372951b1c30715a09e473ec494 (patch)
treef91fa94a5a3f693470e37235f60df66afb454968 /src
parent7df48c278ed8a8e589ef674f95f8b1098d067789 (diff)
parentbe7edc40324bb135548888853df28bf94eb2aa79 (diff)
downloadQt-0727c544915427372951b1c30715a09e473ec494.zip
Qt-0727c544915427372951b1c30715a09e473ec494.tar.gz
Qt-0727c544915427372951b1c30715a09e473ec494.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (42 commits) Update QtDeclarative def files Fix crash in MouseArea Compile Fixes undeleted timers (and endless warning from the event loop about Remove unneeded member variable. Fix test. Generalize qml "registration" Fix compiler warning Fix TextInput echoMode autotest on Linux Reuse QML lexer to simplify .pragma script logic Fix TextEdit text attribute and text stored in the internal QTextDocument having different contents Remove QDeclarativeItem::childrenChanged() signal overload Update QtGui and QtDeclarative def files Make rootContext and engine pointers in QDeclarativeView API const Add additional QVariant benchmarks. Allow MouseArea dragging to filter mouse events from descendants Expand QDeclarativeExtensionPlugin docs Add missing snippet files Expand QtObject doc Indicate default values ...
Diffstat (limited to 'src')
-rw-r--r--src/declarative/QmlChanges.txt12
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp110
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h9
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp18
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp101
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp97
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp50
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp47
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp8
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp10
-rw-r--r--src/declarative/qml/qdeclarative.h14
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp66
-rw-r--r--src/declarative/qml/qdeclarativeengine.h2
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp77
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp25
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h8
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h30
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp97
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp4
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp264
-rw-r--r--src/declarative/util/qdeclarativeanimation_p_p.h2
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp41
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp57
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp31
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp39
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp8
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp2
-rw-r--r--src/declarative/util/qdeclarativeview.cpp19
-rw-r--r--src/declarative/util/qdeclarativeview.h4
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp12
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h1
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def28
-rw-r--r--src/s60installs/bwins/QtGuiu.def4
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def27
-rw-r--r--src/s60installs/eabi/QtGuiu.def4
44 files changed, 888 insertions, 509 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 872f6cb..6e07330 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,9 +1,19 @@
=============================================================================
-The changes below are pre Qt 4.7.0 tech preview
+The changes below are pre Qt 4.7.0 RC1
TextInput
- copy(), cut() and paste() functions added
+Font.letterSpacing
+ - was percentage based. Now specified in pixels.
+Item
+ - wantsFocus renamed to activeFocus
+ - forceFocus() renamed to forceActiveFocus()
+ - focus now returns the scoped focus (i.e. focus read/write now manipulate
+ the same value)
+TextInput and TextEdit:
+ - focusOnPress renamed to activeFocusOnPress
+=============================================================================
The changes below are pre Qt 4.7.0 beta 2
QDeclarativeView
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 9af5f56..b286e11 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1214,6 +1214,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
d->handleMousePressEvent(&mouseEvent);
d->captureDelayedPress(event);
+ stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
break;
case QEvent::GraphicsSceneMouseRelease:
if (d->delayedPressEvent) {
@@ -1234,7 +1235,6 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
default:
break;
}
- stealThisEvent = d->stealMouse; // Update stealThisEvent and grabber in case changed by function calls above
grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) {
d->clearDelayedPress();
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 14a4f08..89b3958 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1293,9 +1293,15 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
\qmlproperty int GridView::currentIndex
\qmlproperty Item GridView::currentItem
- \c currentIndex holds the index of the current item.
- \c currentItem is the current item. Note that the position of the current item
- may only be approximate until it becomes visible in the view.
+ The \c currentIndex property holds the index of the current item, and
+ \c currentItem holds the current item.
+
+ If highlightFollowsCurrentItem is \c true, setting either of these
+ properties will smoothly scroll the GridView so that the current
+ item becomes visible.
+
+ Note that the position of the current item
+ may only be approximate until it becomes visible in the view.
*/
int QDeclarativeGridView::currentIndex() const
{
@@ -1385,7 +1391,7 @@ void QDeclarativeGridView::setHighlight(QDeclarativeComponent *highlight)
\qmlproperty bool GridView::highlightFollowsCurrentItem
This property sets whether the highlight is managed by the view.
- If this property is true, the highlight is moved smoothly
+ If this property is true (the default value), 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.
@@ -1568,6 +1574,8 @@ void QDeclarativeGridView::setFlow(Flow flow)
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.
+
+ By default, key navigation is not wrapped.
*/
bool QDeclarativeGridView::isWrapEnabled() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 36081f7..83f9b20 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -63,11 +63,9 @@
#include <QtGui/qgraphicstransform.h>
#include <qlistmodelinterface_p.h>
-QT_BEGIN_NAMESPACE
+#include <float.h>
-#ifndef FLT_MAX
-#define FLT_MAX 1E+37
-#endif
+QT_BEGIN_NAMESPACE
/*!
\qmlclass Transform QGraphicsTransform
@@ -1432,7 +1430,7 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
*/
/*!
- \fn void QDeclarativeItem::wantsFocusChanged(bool)
+ \fn void QDeclarativeItem::activeFocusChanged(bool)
\internal
*/
@@ -1514,6 +1512,9 @@ QDeclarativeItem::~QDeclarativeItem()
\endqml
The default transform origin is \c Item.Center.
+
+ To set an arbitrary transform origin point use the \l Scale or \l Rotation
+ transform elements.
*/
/*!
@@ -2178,6 +2179,8 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
}
\endqml
\endtable
+
+ \sa transform, Rotation
*/
/*!
@@ -2214,6 +2217,8 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
}
\endqml
\endtable
+
+ \sa transform, Scale
*/
/*!
@@ -2351,12 +2356,12 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qrea
}
/*!
- \qmlmethod Item::forceFocus()
+ \qmlmethod Item::forceActiveFocus()
- Force the focus on the item.
- This method sets the focus on the item and makes sure that all the focus scopes higher in the object hierarchy are given focus.
+ Force active focus on the item.
+ This method sets focus on the item and makes sure that all the focus scopes higher in the object hierarchy are also given focus.
*/
-void QDeclarativeItem::forceFocus()
+void QDeclarativeItem::forceActiveFocus()
{
setFocus(true);
QGraphicsItem *parent = parentItem();
@@ -2393,8 +2398,19 @@ void QDeclarativeItemPrivate::focusChanged(bool flag)
{
Q_Q(QDeclarativeItem);
if (!(flags & QGraphicsItem::ItemIsFocusScope) && parent)
- emit q->wantsFocusChanged(flag); //see also QDeclarativeItemPrivate::subFocusItemChange()
- emit q->focusChanged(flag);
+ emit q->activeFocusChanged(flag); //see also QDeclarativeItemPrivate::subFocusItemChange()
+
+ bool inScope = false;
+ QGraphicsItem *p = parent;
+ while (p) {
+ if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ inScope = true;
+ break;
+ }
+ p = p->parentItem();
+ }
+ if (!inScope)
+ emit q->focusChanged(flag);
}
/*! \internal */
@@ -2671,7 +2687,7 @@ bool QDeclarativeItem::sceneEvent(QEvent *event)
if (event->type() == QEvent::FocusIn ||
event->type() == QEvent::FocusOut) {
- d->focusChanged(hasFocus());
+ d->focusChanged(hasActiveFocus());
}
return rv;
}
@@ -2842,7 +2858,7 @@ void QDeclarativeItem::setSmooth(bool smooth)
*/
/*!
- \property QDeclarativeItem::wantsFocus
+ \property QDeclarativeItem::activeFocus
\internal
*/
@@ -3085,15 +3101,32 @@ void QDeclarativeItem::setSize(const QSizeF &size)
}
/*!
- \qmlproperty bool Item::wantsFocus
+ \qmlproperty bool Item::activeFocus
+
+ This property indicates whether the item has active focus.
- This property indicates whether the item has has an active focus request.
+ An item with active focus will receive keyboard input,
+ or is a FocusScope ancestor of the item that will receive keyboard input.
- \sa {qmlfocus}{Keyboard Focus}
+ Usually, activeFocus is gained by setting focus on an item and its enclosing
+ FocusScopes. In the following example \c input will have activeFocus.
+ \qml
+ Rectangle {
+ FocusScope {
+ focus: true
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ }
+ \endqml
+
+ \sa focus, {qmlfocus}{Keyboard Focus}
*/
/*! \internal */
-bool QDeclarativeItem::wantsFocus() const
+bool QDeclarativeItem::hasActiveFocus() const
{
Q_D(const QDeclarativeItem);
return focusItem() == this ||
@@ -3103,16 +3136,51 @@ bool QDeclarativeItem::wantsFocus() const
/*!
\qmlproperty bool Item::focus
- This property indicates whether the item has keyboard input focus. Set this
- property to true to request focus.
+ This property indicates whether the item has focus within the enclosing focus scope. If true, this item
+ will gain active focus when the enclosing focus scope gains active focus.
+ In the following example, \c input will be given active focus when \c scope gains active focus.
+ \qml
+ Rectangle {
+ FocusScope {
+ id: scope
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ }
+ \endqml
+
+ For the purposes of this property, the top level item in the scene
+ is assumed to act like a focus scope, and to always have active focus
+ when the scene has focus. On a practical level, that means the following
+ QML will give active focus to \c input on startup.
+
+ \qml
+ Rectangle {
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ \endqml
- \sa {qmlfocus}{Keyboard Focus}
+ \sa activeFocus, {qmlfocus}{Keyboard Focus}
*/
/*! \internal */
bool QDeclarativeItem::hasFocus() const
{
- return QGraphicsItem::hasFocus();
+ Q_D(const QDeclarativeItem);
+ QGraphicsItem *p = d->parent;
+ while (p) {
+ if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ return p->focusScopeItem() == this;
+ }
+ p = p->parentItem();
+ }
+
+ return hasActiveFocus() ? true : (!QGraphicsItem::parentItem() ? true : false);
}
/*! \internal */
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index 4f420f8..afb1f2e 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -87,9 +87,10 @@ class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDe
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
- Q_PROPERTY(bool wantsFocus READ wantsFocus NOTIFY wantsFocusChanged)
+ Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged)
Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform> transform READ transform DESIGNABLE false FINAL)
Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
+ Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // transformOriginPoint is read-only for Item
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
Q_ENUMS(TransformOrigin)
Q_CLASSINFO("DefaultProperty", "data")
@@ -138,7 +139,7 @@ public:
QRectF boundingRect() const;
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
- bool wantsFocus() const;
+ bool hasActiveFocus() const;
bool hasFocus() const;
void setFocus(bool);
@@ -147,16 +148,15 @@ public:
Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const;
Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
- Q_INVOKABLE void forceFocus();
+ Q_INVOKABLE void forceActiveFocus();
Q_INVOKABLE QDeclarativeItem *childAt(qreal x, qreal y) const;
Q_SIGNALS:
- void childrenChanged();
void childrenRectChanged(const QRectF &);
void baselineOffsetChanged(qreal);
void stateChanged(const QString &);
void focusChanged(bool);
- void wantsFocusChanged(bool);
+ void activeFocusChanged(bool);
void parentChanged(QDeclarativeItem *);
void transformOriginChanged(TransformOrigin);
void smoothChanged(bool);
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index bc5d809..8c3e084 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -285,11 +285,18 @@ public:
virtual void subFocusItemChange()
{
if (flags & QGraphicsItem::ItemIsFocusScope || !parent)
- emit q_func()->wantsFocusChanged(subFocusItem != 0);
+ emit q_func()->activeFocusChanged(subFocusItem != 0);
//see also QDeclarativeItemPrivate::focusChanged
}
// Reimplemented from QGraphicsItemPrivate
+ virtual void focusScopeItemChange(bool isSubFocusItem)
+ {
+ emit q_func()->focusChanged(isSubFocusItem);
+ }
+
+
+ // Reimplemented from QGraphicsItemPrivate
virtual void siblingOrderChange()
{
Q_Q(QDeclarativeItem);
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index b198077..5d623dc 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -95,7 +95,8 @@ static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject
void QDeclarativeItemModule::defineModule()
{
- QDeclarativePrivate::registerAutoParentFunction(qgraphicsobject_autoParent);
+ QDeclarativePrivate::RegisterAutoParent autoparent = { 0, &qgraphicsobject_autoParent };
+ QDeclarativePrivate::qmlregister(QDeclarativePrivate::AutoParentRegistration, &autoparent);
#ifdef QT_NO_MOVIE
qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage",
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 38bc6f5..8b616ce 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1632,8 +1632,14 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
\qmlproperty int ListView::currentIndex
\qmlproperty Item ListView::currentItem
- \c currentIndex holds the index of the current item.
- \c currentItem is the current item. Note that the position of the current item
+ The \c currentIndex property holds the index of the current item, and
+ \c currentItem holds the current item.
+
+ If highlightFollowsCurrentItem is \c true, setting either of these
+ properties will smoothly scroll the ListView so that the current
+ item becomes visible.
+
+ Note that the position of the current item
may only be approximate until it becomes visible in the view.
*/
int QDeclarativeListView::currentIndex() const
@@ -1727,7 +1733,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
\qmlproperty bool ListView::highlightFollowsCurrentItem
This property holds whether the highlight is managed by the view.
- If this property is true, the highlight is moved smoothly
+ If this property is true (the default value), 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.
@@ -1848,6 +1854,8 @@ void QDeclarativeListView::setHighlightRangeMode(HighlightRangeMode mode)
\qmlproperty real ListView::spacing
This property holds the spacing between items.
+
+ The default value is 0.
*/
qreal QDeclarativeListView::spacing() const
{
@@ -1914,11 +1922,13 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
/*!
\qmlproperty bool ListView::keyNavigationWraps
- This property holds whether the list wraps key navigation.
+ This property holds whether the list wraps key navigation.
If this is true, key navigation that would move the current item selection
past the end of the list instead wraps around and moves the selection to
the start of the list, and vice-versa.
+
+ By default, key navigation is not wrapped.
*/
bool QDeclarativeListView::isWrapEnabled() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index b7b0c9e..dcdb9f6 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -46,12 +46,14 @@
#include <QGraphicsSceneMouseEvent>
+#include <float.h>
+
QT_BEGIN_NAMESPACE
static const int PressAndHoldDelay = 800;
QDeclarativeDrag::QDeclarativeDrag(QObject *parent)
-: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0),
-_active(false)
+: QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX),
+_active(false), _filterChildren(false)
{
}
@@ -158,12 +160,24 @@ void QDeclarativeDrag::setActive(bool drag)
emit activeChanged();
}
+bool QDeclarativeDrag::filterChildren() const
+{
+ return _filterChildren;
+}
+
+void QDeclarativeDrag::setFilterChildren(bool filter)
+{
+ if (_filterChildren == filter)
+ return;
+ _filterChildren = filter;
+ emit filterChildrenChanged();
+}
+
QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
{
delete drag;
}
-
/*!
\qmlclass MouseArea QDeclarativeMouseArea
\since 4.7
@@ -396,6 +410,7 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeMouseArea);
d->moved = false;
+ d->stealMouse = false;
if (!d->absorb)
QDeclarativeItem::mousePressEvent(event);
else {
@@ -454,8 +469,10 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
const int dragThreshold = QApplication::startDragDistance();
qreal dx = qAbs(curLocalPos.x() - startLocalPos.x());
qreal dy = qAbs(curLocalPos.y() - startLocalPos.y());
- if ((d->dragX && !(dx < dragThreshold)) || (d->dragY && !(dy < dragThreshold)))
+ if ((d->dragX && !(dx < dragThreshold)) || (d->dragY && !(dy < dragThreshold))) {
d->drag->setActive(true);
+ d->stealMouse = true;
+ }
if (!keepMouseGrab()) {
if ((!d->dragY && dy < dragThreshold && d->dragX && dx > dragThreshold)
|| (!d->dragX && dx < dragThreshold && d->dragY && dy > dragThreshold)
@@ -493,6 +510,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeMouseArea);
+ d->stealMouse = false;
if (!d->absorb) {
QDeclarativeItem::mouseReleaseEvent(event);
} else {
@@ -503,6 +521,9 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
// If we don't accept hover, we need to reset containsMouse.
if (!acceptHoverEvents())
setHovered(false);
+ QGraphicsScene *s = scene();
+ if (s && s->mouseGrabberItem() == this)
+ ungrabMouse();
setKeepMouseGrab(false);
}
}
@@ -577,6 +598,71 @@ bool QDeclarativeMouseArea::sceneEvent(QEvent *event)
return rv;
}
+bool QDeclarativeMouseArea::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ QGraphicsSceneMouseEvent mouseEvent(event->type());
+ QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+
+ QGraphicsScene *s = scene();
+ QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ mouseEvent.setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+ }
+ }
+ mouseEvent.setScenePos(event->scenePos());
+ mouseEvent.setLastScenePos(event->lastScenePos());
+ mouseEvent.setPos(mapFromScene(event->scenePos()));
+ mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+ switch(mouseEvent.type()) {
+ case QEvent::GraphicsSceneMouseMove:
+ mouseMoveEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ mousePressEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMouseRelease:
+ mouseReleaseEvent(&mouseEvent);
+ break;
+ default:
+ break;
+ }
+ grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+ if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
+ grabMouse();
+
+ return stealThisEvent;
+ }
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
+ d->stealMouse = false;
+ ungrabMouse();
+ }
+ return false;
+}
+
+bool QDeclarativeMouseArea::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb || !isVisible() || !d->drag || !d->drag->filterChildren())
+ return QDeclarativeItem::sceneEventFilter(i, e);
+ switch (e->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
void QDeclarativeMouseArea::timerEvent(QTimerEvent *event)
{
Q_D(QDeclarativeMouseArea);
@@ -757,6 +843,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
\qmlproperty real MouseArea::drag.maximumX
\qmlproperty real MouseArea::drag.minimumY
\qmlproperty real MouseArea::drag.maximumY
+ \qmlproperty bool MouseArea::drag.filterChildren
\c drag provides a convenient way to make an item draggable.
@@ -777,6 +864,12 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
for \c rect in the above example, it cannot be dragged along the X-axis.
This can be avoided by settng the anchor value to \c undefined in
an \l onPressed handler.
+
+ If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas. This
+ enables a parent MouseArea to handle drags, for example, while descendants handle clicks:
+
+ \snippet doc/src/snippets/declarative/mouseareadragfilter.qml dragfilter
+
*/
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 4fe3fcb..0da7515 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -62,6 +62,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeDrag : public QObject
Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
Q_PROPERTY(bool active READ active NOTIFY activeChanged)
+ Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged)
//### consider drag and drop
public:
@@ -88,6 +89,9 @@ public:
bool active() const;
void setActive(bool);
+ bool filterChildren() const;
+ void setFilterChildren(bool);
+
Q_SIGNALS:
void targetChanged();
void axisChanged();
@@ -96,6 +100,7 @@ Q_SIGNALS:
void minimumYChanged();
void maximumYChanged();
void activeChanged();
+ void filterChildrenChanged();
private:
QGraphicsObject *_target;
@@ -104,7 +109,8 @@ private:
qreal _xmax;
qreal _ymin;
qreal _ymax;
- bool _active;
+ bool _active : 1;
+ bool _filterChildren: 1;
Q_DISABLE_COPY(QDeclarativeDrag)
};
@@ -177,6 +183,8 @@ protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
bool sceneEvent(QEvent *);
+ bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEventFilter(QGraphicsItem *i, QEvent *e);
void timerEvent(QTimerEvent *event);
virtual void geometryChanged(const QRectF &newGeometry,
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 3d7bd1e..cf9dc18 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -68,7 +68,7 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
public:
QDeclarativeMouseAreaPrivate()
: absorb(true), hovered(false), pressed(false), longPress(false),
- moved(false), drag(0)
+ moved(false), stealMouse(false), drag(0)
{
}
@@ -78,6 +78,7 @@ public:
{
Q_Q(QDeclarativeMouseArea);
q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFiltersChildEvents(true);
}
void saveEvent(QGraphicsSceneMouseEvent *event) {
@@ -101,6 +102,7 @@ public:
bool moved : 1;
bool dragX : 1;
bool dragY : 1;
+ bool stealMouse : 1;
QDeclarativeDrag *drag;
QPointF startScene;
qreal startX;
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index 3b9b8df..a6db1fa 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -90,6 +90,8 @@ QT_BEGIN_NAMESPACE
static int inpaint=0;
static int inpaint_clearcache=0;
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
/*!
Marks areas of the cache that intersect with the given \a rect as dirty and
in need of being refreshed.
@@ -287,7 +289,14 @@ void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem
QRectF target(area.x(), area.y(), area.width(), area.height());
if (!d->cachefrozen) {
if (!d->imagecache[i]->dirty.isNull() && topaint.contains(d->imagecache[i]->dirty)) {
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
QPainter qp(&d->imagecache[i]->image);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
qp.translate(-area.x(), -area.y());
qp.scale(d->contentsScale,d->contentsScale);
@@ -349,7 +358,14 @@ void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem
if (d->fillColor.isValid())
img.fill(d->fillColor);
{
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
QPainter qp(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
qp.translate(-r.x(),-r.y());
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index ba4fa21..ab2be9c 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -57,6 +57,8 @@
QT_BEGIN_NAMESPACE
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
class QTextDocumentWithImageResources : public QTextDocument {
Q_OBJECT
@@ -301,8 +303,7 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
Sets the letter spacing for the font.
Letter spacing changes the default spacing between individual letters in the font.
- A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
- the width of the character itself.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
*/
/*!
@@ -711,61 +712,37 @@ QRectF QDeclarativeText::boundingRect() const
int x = 0;
int y = 0;
- // Could include font max left/right bearings to either side of rectangle.
-
- if (d->cache || d->style != Normal) {
- switch (d->hAlign) {
- case AlignLeft:
- x = 0;
- break;
- case AlignRight:
- x = w - d->imgCache.width();
- break;
- case AlignHCenter:
- x = (w - d->imgCache.width()) / 2;
- break;
- }
-
- switch (d->vAlign) {
- case AlignTop:
- y = 0;
- break;
- case AlignBottom:
- y = h - d->imgCache.height();
- break;
- case AlignVCenter:
- y = (h - d->imgCache.height()) / 2;
- break;
- }
+ QSize size = d->cachedLayoutSize;
+ if (d->style != Normal)
+ size += QSize(2,2);
- return QRectF(x,y,d->imgCache.width(),d->imgCache.height());
- } else {
- switch (d->hAlign) {
- case AlignLeft:
- x = 0;
- break;
- case AlignRight:
- x = w - d->cachedLayoutSize.width();
- break;
- case AlignHCenter:
- x = (w - d->cachedLayoutSize.width()) / 2;
- break;
- }
+ // Could include font max left/right bearings to either side of rectangle.
- switch (d->vAlign) {
- case AlignTop:
- y = 0;
- break;
- case AlignBottom:
- y = h - d->cachedLayoutSize.height();
- break;
- case AlignVCenter:
- y = (h - d->cachedLayoutSize.height()) / 2;
- break;
- }
+ switch (d->hAlign) {
+ case AlignLeft:
+ x = 0;
+ break;
+ case AlignRight:
+ x = w - size.width();
+ break;
+ case AlignHCenter:
+ x = (w - size.width()) / 2;
+ break;
+ }
- return QRectF(x,y,d->cachedLayoutSize.width(),d->cachedLayoutSize.height());
+ switch (d->vAlign) {
+ case AlignTop:
+ y = 0;
+ break;
+ case AlignBottom:
+ y = h - size.height();
+ break;
+ case AlignVCenter:
+ y = (h - size.height()) / 2;
+ break;
}
+
+ return QRectF(x,y,size.width(),size.height());
}
void QDeclarativeText::geometryChanged(const QRectF &newGeometry,
@@ -1028,7 +1005,14 @@ QPixmap QDeclarativeTextPrivate::wrappedTextImage(bool drawStyle)
QPixmap img(size);
if (!size.isEmpty()) {
img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
QPainter p(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
drawWrappedText(&p, QPointF(0,0), drawStyle);
}
return img;
@@ -1051,7 +1035,14 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
//paint text
QPixmap img(size);
img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
QPainter p(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
QAbstractTextDocumentLayout::PaintContext context;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index d13e139..8117676 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -213,8 +213,7 @@ QString QDeclarativeTextEdit::text() const
Sets the letter spacing for the font.
Letter spacing changes the default spacing between individual letters in the font.
- A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
- the width of the character itself.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
*/
/*!
@@ -257,7 +256,6 @@ void QDeclarativeTextEdit::setText(const QString &text)
Q_D(QDeclarativeTextEdit);
if (QDeclarativeTextEdit::text() == text)
return;
- d->text = text;
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
#ifndef QT_NO_TEXTHTMLPARSER
@@ -625,7 +623,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos)
\qmlproperty bool TextEdit::cursorVisible
If true the text edit shows a cursor.
- This property is set and unset when the text edit gets focus, but it can also
+ This property is set and unset when the text edit gets active focus, but it can also
be set directly (useful, for example, if a KeyProxy might forward keys to it).
*/
bool QDeclarativeTextEdit::isCursorVisible() const
@@ -784,9 +782,9 @@ QString QDeclarativeTextEdit::selectedText() const
}
/*!
- \qmlproperty bool TextEdit::focusOnPress
+ \qmlproperty bool TextEdit::activeFocusOnPress
- Whether the TextEdit should gain focus on a mouse press. By default this is
+ Whether the TextEdit should gain active focus on a mouse press. By default this is
set to true.
*/
bool QDeclarativeTextEdit::focusOnPress() const
@@ -801,13 +799,13 @@ void QDeclarativeTextEdit::setFocusOnPress(bool on)
if (d->focusOnPress == on)
return;
d->focusOnPress = on;
- emit focusOnPressChanged(d->focusOnPress);
+ emit activeFocusOnPressChanged(d->focusOnPress);
}
/*!
\qmlproperty bool TextEdit::persistentSelection
- Whether the TextEdit should keep the selection visible when it loses focus to another
+ Whether the TextEdit should keep the selection visible when it loses active focus to another
item in the scene. By default this is set to true;
*/
bool QDeclarativeTextEdit::persistentSelection() const
@@ -1107,15 +1105,15 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
if (d->focusOnPress){
- bool hadFocus = hasFocus();
- forceFocus();
+ bool hadActiveFocus = hasActiveFocus();
+ forceActiveFocus();
if (d->showInputPanelOnFocus) {
- if (hasFocus() && hadFocus && !isReadOnly()) {
+ if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
// re-open input panel on press if already focused
openSoftwareInputPanel();
}
} else { // show input panel on click
- if (hasFocus() && !hadFocus) {
+ if (hasActiveFocus() && !hadActiveFocus) {
d->clickCausedFocus = true;
}
}
@@ -1292,9 +1290,11 @@ void QDeclarativeTextEditPrivate::init()
void QDeclarativeTextEdit::q_textChanged()
{
+ Q_D(QDeclarativeTextEdit);
+ d->text = text();
updateSize();
updateMicroFocus();
- emit textChanged(text());
+ emit textChanged(d->text);
}
void QDeclarativeTextEdit::moveCursorDelegate()
@@ -1428,10 +1428,10 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
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. On other platforms
- the panels are automatically opened when TextEdit element gains focus. Input panels are
- always closed if no editor owns focus.
+ the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ always closed if no editor has active focus.
- You can disable the automatic behavior by setting the property \c focusOnPress to false
+ You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
the behavior you want.
@@ -1442,12 +1442,12 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
TextEdit {
id: textEdit
text: "Hello world!"
- focusOnPress: false
+ activeFocusOnPress: false
MouseArea {
anchors.fill: parent
onClicked: {
- if (!textEdit.focus) {
- textEdit.focus = true;
+ if (!textEdit.activeFocus) {
+ textEdit.forceActiveFocus();
textEdit.openSoftwareInputPanel();
} else {
textEdit.focus = false;
@@ -1479,10 +1479,10 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
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. On other platforms
- the panels are automatically opened when TextEdit element gains focus. Input panels are
- always closed if no editor owns focus.
+ the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ always closed if no editor has active focus.
- You can disable the automatic behavior by setting the property \c focusOnPress to false
+ You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
the behavior you want.
@@ -1493,12 +1493,12 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
TextEdit {
id: textEdit
text: "Hello world!"
- focusOnPress: false
+ activeFocusOnPress: false
MouseArea {
anchors.fill: parent
onClicked: {
- if (!textEdit.focus) {
- textEdit.focus = true;
+ if (!textEdit.activeFocus) {
+ textEdit.forceActiveFocus();
textEdit.openSoftwareInputPanel();
} else {
textEdit.focus = false;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 279af78..68fde3d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -85,7 +85,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
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 activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
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)
@@ -216,7 +216,7 @@ Q_SIGNALS:
void readOnlyChanged(bool isReadOnly);
void cursorVisibleChanged(bool isCursorVisible);
void cursorDelegateChanged();
- void focusOnPressChanged(bool focusIsPressed);
+ void activeFocusOnPressChanged(bool activeFocusOnPressed);
void persistentSelectionChanged(bool isPersistentSelection);
void textMarginChanged(qreal textMargin);
void selectByMouseChanged(bool selectByMouse);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2a5d73d..34f5897 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -176,8 +176,7 @@ void QDeclarativeTextInput::setText(const QString &s)
Sets the letter spacing for the font.
Letter spacing changes the default spacing between individual letters in the font.
- A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
- the width of the character itself.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
*/
/*!
@@ -376,14 +375,14 @@ void QDeclarativeTextInput::setMaxLength(int ml)
\qmlproperty bool TextInput::cursorVisible
Set to true when the TextInput shows a cursor.
- This property is set and unset when the TextInput gets focus, so that other
+ This property is set and unset when the TextInput gets active focus, so that other
properties can be bound to whether the cursor is currently showing. As it
gets set and unset automatically, when you set the value yourself you must
keep in mind that your value may be overwritten.
It can be set directly in script, for example if a KeyProxy might
forward keys to it and you desire it to look active when this happens
- (but without actually giving it the focus).
+ (but without actually giving it active focus).
It should not be set directly on the element, like in the below QML,
as the specified value will be overridden an lost on focus changes.
@@ -396,7 +395,7 @@ void QDeclarativeTextInput::setMaxLength(int ml)
\endcode
In the above snippet the cursor will still become visible when the
- TextInput gains focus.
+ TextInput gains active focus.
*/
bool QDeclarativeTextInput::isCursorVisible() const
{
@@ -511,9 +510,9 @@ QString QDeclarativeTextInput::selectedText() const
}
/*!
- \qmlproperty bool TextInput::focusOnPress
+ \qmlproperty bool TextInput::activeFocusOnPress
- Whether the TextInput should gain focus on a mouse press. By default this is
+ Whether the TextInput should gain active focus on a mouse press. By default this is
set to true.
*/
bool QDeclarativeTextInput::focusOnPress() const
@@ -530,7 +529,7 @@ void QDeclarativeTextInput::setFocusOnPress(bool b)
d->focusOnPress = b;
- emit focusOnPressChanged(d->focusOnPress);
+ emit activeFocusOnPressChanged(d->focusOnPress);
}
/*!
@@ -946,15 +945,15 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
if(d->focusOnPress){
- bool hadFocus = hasFocus();
- forceFocus();
+ bool hadActiveFocus = hasActiveFocus();
+ forceActiveFocus();
if (d->showInputPanelOnFocus) {
- if (hasFocus() && hadFocus && !isReadOnly()) {
+ if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
// re-open input panel on press if already focused
openSoftwareInputPanel();
}
} else { // show input panel on click
- if (hasFocus() && !hadFocus) {
+ if (hasActiveFocus() && !hadActiveFocus) {
d->clickCausedFocus = true;
}
}
@@ -1313,10 +1312,10 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
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. On other platforms
- the panels are automatically opened when TextInput element gains focus. Input panels are
- always closed if no editor owns focus.
+ the panels are automatically opened when TextInput element gains active focus. Input panels are
+ always closed if no editor has active focus.
- . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
the behavior you want.
@@ -1327,12 +1326,12 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
TextInput {
id: textInput
text: "Hello world!"
- focusOnPress: false
+ activeFocusOnPress: false
MouseArea {
anchors.fill: parent
onClicked: {
- if (!textInput.focus) {
- textInput.focus = true;
+ if (!textInput.activeFocus) {
+ textInput.forceActiveFocus()
textInput.openSoftwareInputPanel();
} else {
textInput.focus = false;
@@ -1364,10 +1363,10 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
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. On other platforms
- the panels are automatically opened when TextInput element gains focus. Input panels are
- always closed if no editor owns focus.
+ the panels are automatically opened when TextInput element gains active focus. Input panels are
+ always closed if no editor has active focus.
- . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
the behavior you want.
@@ -1378,12 +1377,12 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
TextInput {
id: textInput
text: "Hello world!"
- focusOnPress: false
+ activeFocusOnPress: false
MouseArea {
anchors.fill: parent
onClicked: {
- if (!textInput.focus) {
- textInput.focus = true;
+ if (!textInput.activeFocus) {
+ textInput.forceActiveFocus();
textInput.openSoftwareInputPanel();
} else {
textInput.focus = false;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index b1862c6..ba3f5b1 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -87,7 +87,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativePaintedItem
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 activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
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)
@@ -211,7 +211,7 @@ Q_SIGNALS:
void echoModeChanged(EchoMode echoMode);
void passwordCharacterChanged();
void displayTextChanged();
- void focusOnPressChanged(bool focusOnPress);
+ void activeFocusOnPressChanged(bool activeFocusOnPress);
void autoScrollChanged(bool autoScroll);
void selectByMouseChanged(bool selectByMouse);
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index cfa1c6d..7952b97 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -77,7 +77,7 @@ public:
QDeclarativeVisualItemModelPrivate() : QObjectPrivate() {}
static void children_append(QDeclarativeListProperty<QDeclarativeItem> *prop, QDeclarativeItem *item) {
- item->QObject::setParent(prop->object);
+ QDeclarative_setParent_noEvent(item, prop->object);
static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(item);
static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->itemAppended();
static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
@@ -185,9 +185,11 @@ QDeclarativeItem *QDeclarativeVisualItemModel::item(int index, bool)
return d->children.at(index);
}
-QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *)
+QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *item)
{
- // Nothing to do
+ if (item->scene())
+ item->scene()->removeItem(item);
+ QDeclarative_setParent_noEvent(item, this);
return 0;
}
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index fcaaece..65a6af2 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -103,7 +103,7 @@ Lexer::Lexer(Engine *eng, bool tokenizeComments)
prohibitAutomaticSemicolon(false),
tokenizeComments(tokenizeComments)
{
- driver->setLexer(this);
+ if (driver) driver->setLexer(this);
// allocate space for read buffers
buffer8 = new char[size8];
buffer16 = new QChar[size16];
@@ -677,9 +677,9 @@ int Lexer::lex()
setDone(Other);
} else
state = Start;
- driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
} else if (current == 0) {
- driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
setDone(Eof);
}
@@ -689,14 +689,14 @@ int Lexer::lex()
setDone(Bad);
err = UnclosedComment;
errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
- driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
} else if (isLineTerminator()) {
shiftWindowsLineBreak();
yylineno++;
} else if (current == '*' && next1 == '/') {
state = Start;
shift(1);
- driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
}
break;
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index 53ff51c..c6b64ae 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -116,7 +116,7 @@ int qmlRegisterType()
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message);
@@ -151,7 +151,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
template<typename T>
@@ -184,7 +184,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
template<typename T, typename E>
@@ -217,7 +217,7 @@ int qmlRegisterExtendedType()
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
template<typename T, typename E>
@@ -258,7 +258,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
template<typename T>
@@ -278,7 +278,7 @@ int qmlRegisterInterface(const char *typeName)
qobject_interface_iid<T *>()
};
- return QDeclarativePrivate::registerType(interface);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &interface);
}
template<typename T>
@@ -312,7 +312,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
parser
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
class QDeclarativeContext;
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index f2eb770..e3ebca3 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -115,22 +115,55 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass QtObject QObject
\since 4.7
- \brief The QtObject element is the most basic element in QML
+ \brief The QtObject element is the most basic element in QML.
The QtObject element is a non-visual element which contains only the
- objectName property. It is useful for when you need an extremely
- lightweight element to place your own custom properties in.
+ objectName property.
+
+ It can be useful to create a QtObject if you need an extremely
+ lightweight element to enclose a set of custom properties:
+
+ \snippet doc/src/snippets/declarative/qtobject.qml 0
It can also be useful for C++ integration, as it is just a plain
QObject. See the QObject documentation for further details.
*/
/*!
\qmlproperty string QML:QtObject::objectName
- This property allows you to give a name to this specific object instance.
+ This property holds the QObject::objectName for this specific object instance.
+
+ This allows a C++ application to locate an item within a QML component
+ using the QObject::findChild() method. For example, the following C++
+ application locates the child \l Rectangle item and dynamically changes its
+ \c color value:
+
+ \qml
+ // MyRect.qml
+
+ import Qt 4.7
+
+ Item {
+ width: 200; height: 200
+
+ Rectangle {
+ anchors.fill: parent
+ color: "red"
+ objectName: "myRect"
+ }
+ }
+ \endqml
+
+ \code
+ // main.cpp
- See \l{scripting.html#accessing-child-qobjects}{Accessing Child QObjects}
- in the scripting documentation for details how objectName can be used from
- scripts.
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("MyRect.qml"));
+ view.show();
+
+ QDeclarativeItem *item = view.rootObject()->findChild<QDeclarativeItem*>("myRect");
+ if (item)
+ item->setProperty("color", QColor(Qt::yellow));
+ \endcode
*/
struct StaticQtMetaObject : public QObject
@@ -545,9 +578,9 @@ void QDeclarativeEngine::clearComponentCache()
component instances should be added to sub-contexts parented to the
root context.
*/
-QDeclarativeContext *QDeclarativeEngine::rootContext()
+QDeclarativeContext *QDeclarativeEngine::rootContext() const
{
- Q_D(QDeclarativeEngine);
+ Q_D(const QDeclarativeEngine);
return d->rootContext;
}
@@ -1080,13 +1113,20 @@ Here is an example. Notice it checks whether the component \l{Component::status}
\c Component.Ready before calling \l {Component::createObject()}{createObject()}
in case the QML file is loaded over a network and thus is not ready immediately.
-\snippet doc/src/snippets/declarative/componentCreation.js 0
+\snippet doc/src/snippets/declarative/componentCreation.js vars
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js remote
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
\codeline
-\snippet doc/src/snippets/declarative/componentCreation.js 1
+\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
-If you are certain the files will be local, you could simplify to:
+If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation()
+function and call \l {Component::createObject()}{createObject()} immediately:
-\snippet doc/src/snippets/declarative/componentCreation.js 2
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js local
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
To create a QML object from an arbitrary string of QML (instead of a file),
use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h
index 01487f5..d971d80 100644
--- a/src/declarative/qml/qdeclarativeengine.h
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -74,7 +74,7 @@ public:
QDeclarativeEngine(QObject *p = 0);
virtual ~QDeclarativeEngine();
- QDeclarativeContext *rootContext();
+ QDeclarativeContext *rootContext() const;
void clearComponentCache();
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index 0660599..448fde2 100644
--- a/src/declarative/qml/qdeclarativeextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -50,23 +50,76 @@ QT_BEGIN_NAMESPACE
\ingroup plugins
- QDeclarativeExtensionPlugin is a plugin interface that makes it
- possible to offer extensions that can be loaded dynamically into
- applications using the QDeclarativeEngine class.
-
- Writing a QML extension plugin is achieved by subclassing this
- base class, reimplementing the pure virtual registerTypes()
- function, and exporting the class using the Q_EXPORT_PLUGIN2()
- macro.
+ QDeclarativeExtensionPlugin is a plugin interface that makes it possible to
+ create QML extensions that can be loaded dynamically into QML applications.
+ These extensions allow custom QML types to be made available to the QML engine.
+
+ To write a QML extension plugin:
+
+ \list
+ \o Subclass QDeclarativeExtensionPlugin, implement registerTypes() method
+ to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro
+ \o Write an appropriate project file for the plugin
+ \o Create a \l{The qmldir file}{qmldir file} to describe the plugin
+ \endlist
QML extension plugins can be used to provide either application-specific or
library-like plugins. Library plugins should limit themselves to registering types,
as any manipulation of the engine's root context may cause conflicts
or other issues in the library user's code.
- See \l {Tutorial: Writing QML extensions with C++} for details on creating
- QML extensions, including how to build a plugin with with QDeclarativeExtensionPlugin.
- For a simple overview, see the \l{declarative/cppextensions/plugins}{plugins} example.
+
+ \section1 An example
+
+ Suppose there is a new \c TimeModel C++ class that should be made available
+ as a new QML element. It provides the current time through \c hour and \c minute
+ properties, like this:
+
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp 0
+ \dots
+
+ To make this class available as a QML type, create a plugin that registers
+ this type using qmlRegisterType(). For this example the plugin
+ module will be named \c com.nokia.TimeExample (as defined in the project
+ file further below).
+
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+ \codeline
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp export
+
+ This registers the \c TimeModel class with the 1.0 version of this
+ plugin library, as a QML type called \c Time. The Q_ASSERT statement
+ ensures the module is imported correctly by any QML components that use this plugin.
+
+ The project file defines the project as a plugin library and specifies
+ it should be built into the \c com/nokia/TimeExample directory:
+
+ \code
+ TEMPLATE = lib
+ CONFIG += qt plugin
+ QT += declarative
+
+ DESTDIR = com/nokia/TimeExample
+ TARGET = qmlqtimeexampleplugin
+ ...
+ \endcode
+
+ Finally, a \l{The qmldir file}{qmldir file} is required in the \c com/nokia/TimeExample directory
+ that describes the plugin. This directory includes a \c Clock.qml file that
+ should be bundled with the plugin, so it needs to be specified in the \c qmldir
+ file:
+
+ \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+
+ Once the project is built and installed, the new \c Time element can be
+ used by any QML component that imports the \c com.nokia.TimeExample module:
+
+ \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+
+ The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
+
+ The \l {Tutorial: Writing QML extensions with C++} also contains a chapter
+ on creating QML plugins.
\sa QDeclarativeEngine::importPlugin(), {How to Create Qt Plugins}
*/
@@ -95,7 +148,7 @@ QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent)
}
/*!
- Destroys the plugin.
+ \internal
*/
QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin()
{
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 153e2be..a5c878f 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <QtDeclarative/qdeclarativeprivate.h>
#include "private/qdeclarativemetatype_p.h"
#include "private/qdeclarativeproxymetaobject_p.h"
@@ -485,17 +486,17 @@ int QDeclarativeType::index() const
return d->m_index;
}
-int QDeclarativePrivate::registerAutoParentFunction(AutoParentFunction function)
+int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
{
QWriteLocker lock(metaTypeDataLock());
QDeclarativeMetaTypeData *data = metaTypeData();
- data->parentFunctions.append(function);
+ data->parentFunctions.append(autoparent.function);
return data->parentFunctions.count() - 1;
}
-int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &interface)
+int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
{
if (interface.version > 0)
qFatal("qmlRegisterType(): Cannot mix incompatible QML versions.");
@@ -524,7 +525,7 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterfa
return index;
}
-int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &type)
+int registerType(const QDeclarativePrivate::RegisterType &type)
{
if (type.elementName) {
for (int ii = 0; type.elementName[ii]; ++ii) {
@@ -576,6 +577,22 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &t
}
/*
+This method is "over generalized" to allow us to (potentially) register more types of things in
+the future without adding exported symbols.
+*/
+int QDeclarativePrivate::qmlregister(RegistrationType type, void *data)
+{
+ if (type == TypeRegistration) {
+ return registerType(*reinterpret_cast<RegisterType *>(data));
+ } else if (type == InterfaceRegistration) {
+ return registerInterface(*reinterpret_cast<RegisterInterface *>(data));
+ } else if (type == AutoParentRegistration) {
+ return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
+ }
+ return -1;
+}
+
+/*
Have any types been registered for \a module with at least versionMajor.versionMinor, and types
for \a module with at most versionMajor.versionMinor.
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
index 4c98b6f..f410547 100644
--- a/src/declarative/qml/qdeclarativemetatype_p.h
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE
class QDeclarativeType;
class QDeclarativeCustomParser;
+class QDeclarativeTypePrivate;
+
class Q_DECLARATIVE_EXPORT QDeclarativeMetaType
{
public:
@@ -103,7 +105,6 @@ public:
static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions();
};
-class QDeclarativeTypePrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeType
{
public:
@@ -144,11 +145,12 @@ public:
int propertyValueInterceptorCast() const;
int index() const;
+
private:
friend class QDeclarativeTypePrivate;
friend struct QDeclarativeMetaTypeData;
- friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &);
- friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &);
+ friend int registerType(const QDeclarativePrivate::RegisterType &);
+ friend int registerInterface(const QDeclarativePrivate::RegisterInterface &);
QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &);
QDeclarativeType(int, const QDeclarativePrivate::RegisterType &);
~QDeclarativeType();
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index cd859fe..b2d7451 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -42,6 +42,17 @@
#ifndef QDECLARATIVEPRIVATE_H
#define QDECLARATIVEPRIVATE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <QtCore/qvariant.h>
#ifndef Q_OS_WIN
@@ -177,6 +188,9 @@ namespace QDeclarativePrivate
return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
}
+ enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
+ typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+
struct RegisterType {
int version;
@@ -214,13 +228,19 @@ namespace QDeclarativePrivate
const char *iid;
};
- enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
- typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+ struct RegisterAutoParent {
+ int version;
- int Q_DECLARATIVE_EXPORT registerAutoParentFunction(AutoParentFunction);
- int Q_DECLARATIVE_EXPORT registerType(const RegisterType &);
- int Q_DECLARATIVE_EXPORT registerType(const RegisterInterface &);
+ AutoParentFunction function;
+ };
+
+ enum RegistrationType {
+ TypeRegistration = 0,
+ InterfaceRegistration = 1,
+ AutoParentRegistration = 2
+ };
+ int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *);
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 219d759..4d98ca8 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -896,6 +896,14 @@ QList<QDeclarativeError> QDeclarativeScriptParser::errors() const
return _errors;
}
+static void replaceWithSpace(QString &str, int idx, int n)
+{
+ QChar *data = str.data() + idx;
+ QChar space(' ');
+ for (int ii = 0; ii < n; ++ii)
+ *data++ = space;
+}
+
/*
Searches for ".pragma <value>" declarations within \a script. Currently supported pragmas
are:
@@ -905,83 +913,48 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra
{
QDeclarativeParser::Object::ScriptBlock::Pragmas rv = QDeclarativeParser::Object::ScriptBlock::None;
- const QChar forwardSlash(QLatin1Char('/'));
- const QChar star(QLatin1Char('*'));
- const QChar newline(QLatin1Char('\n'));
- const QChar dot(QLatin1Char('.'));
- const QChar semicolon(QLatin1Char(';'));
- const QChar space(QLatin1Char(' '));
- const QString pragma(QLatin1String(".pragma "));
-
- const QChar *pragmaData = pragma.constData();
-
- const QChar *data = script.constData();
- const int length = script.count();
- for (int ii = 0; ii < length; ++ii) {
- const QChar &c = data[ii];
-
- if (c.isSpace())
- continue;
-
- if (c == forwardSlash) {
- ++ii;
- if (ii >= length)
- return rv;
-
- const QChar &c = data[ii];
- if (c == forwardSlash) {
- // Find next newline
- while (ii < length && data[++ii] != newline) {};
- } else if (c == star) {
- // Find next star
- while (true) {
- while (ii < length && data[++ii] != star) {};
- if (ii + 1 >= length)
- return rv;
-
- if (data[ii + 1] == forwardSlash) {
- ++ii;
- break;
- }
- }
- } else {
- return rv;
- }
- } else if (c == dot) {
- // Could be a pragma!
- if (ii + pragma.length() >= length ||
- 0 != ::memcmp(data + ii, pragmaData, sizeof(QChar) * pragma.length()))
- return rv;
+ const QString pragma(QLatin1String("pragma"));
+ const QString library(QLatin1String("library"));
- int pragmaStatementIdx = ii;
+ QDeclarativeJS::Lexer l(0);
+ l.setCode(script, 0);
- ii += pragma.length();
+ int token = l.lex();
- while (ii < length && data[ii].isSpace()) { ++ii; }
+ while (true) {
+ if (token != QDeclarativeJSGrammar::T_DOT)
+ return rv;
- int startIdx = ii;
+ int startOffset = l.tokenOffset();
+ int startLine = l.currentLineNo();
- while (ii < length && data[ii].isLetter()) { ++ii; }
+ token = l.lex();
- int endIdx = ii;
+ if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+ l.currentLineNo() != startLine ||
+ script.mid(l.tokenOffset(), l.tokenLength()) != pragma)
+ return rv;
- if (ii != length && data[ii] != forwardSlash && !data[ii].isSpace() && data[ii] != semicolon)
- return rv;
+ token = l.lex();
- QString p(data + startIdx, endIdx - startIdx);
+ if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+ l.currentLineNo() != startLine)
+ return rv;
- if (p == QLatin1String("library"))
- rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
- else
- return rv;
+ QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
+ int endOffset = l.tokenLength() + l.tokenOffset();
- for (int jj = pragmaStatementIdx; jj < endIdx; ++jj) script[jj] = space;
+ token = l.lex();
+ if (l.currentLineNo() == startLine)
+ return rv;
+ if (pragmaValue == QLatin1String("library")) {
+ rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
+ replaceWithSpace(script, startOffset, endOffset - startOffset);
} else {
return rv;
}
}
-
return rv;
}
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index c17ec95..98e9a58 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -74,7 +74,7 @@ int qmlRegisterValueTypeEnums(const char *qmlName)
0
};
- return QDeclarativePrivate::registerType(type);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory()
@@ -973,7 +973,7 @@ qreal QDeclarativeFontValueType::letterSpacing() const
void QDeclarativeFontValueType::setLetterSpacing(qreal size)
{
- font.setLetterSpacing(QFont::PercentageSpacing, size);
+ font.setLetterSpacing(QFont::AbsoluteSpacing, size);
}
qreal QDeclarativeFontValueType::wordSpacing() const
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 88ec5ba..1a223d5 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -632,17 +632,18 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
\qmlclass ColorAnimation QDeclarativeColorAnimation
\since 4.7
\inherits PropertyAnimation
- \brief The ColorAnimation element allows you to animate color changes.
+ \brief The ColorAnimation element animates changes in color values.
- ColorAnimation defines an animation to be applied when a color value
- changes.
+ ColorAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a color value changes.
Here is a ColorAnimation applied to the \c color property of a \l Rectangle
- as a property value source:
+ as a property value source. It animates the \c color property's value from
+ its current value to a value of "red", over 1000 milliseconds:
\snippet doc/src/snippets/declarative/coloranimation.qml 0
- Like any other animation element, a NumberAnimation can be applied in a
+ Like any other animation element, a ColorAnimation can be applied in a
number of ways, including transitions, behaviors and property value
sources. The \l PropertyAnimation documentation shows a variety of methods
for creating animations.
@@ -674,11 +675,12 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
/*!
\qmlproperty color ColorAnimation::from
- This property holds the starting color.
+ This property holds the color value at which the animation should begin.
For example, the following animation is not applied until a color value
has reached "#c0c0c0":
+ \qml
Item {
states: [ ... ]
@@ -686,6 +688,11 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
NumberAnimation { from: "#c0c0c0"; duration: 2000 }
}
}
+ \endqml
+
+ If this value is not set and the ColorAnimation is defined within
+ a \l Transition, it defaults to the value defined in the starting
+ state of the \l Transition.
*/
QColor QDeclarativeColorAnimation::from() const
{
@@ -700,7 +707,12 @@ void QDeclarativeColorAnimation::setFrom(const QColor &f)
/*!
\qmlproperty color ColorAnimation::to
- This property holds the ending color.
+
+ This property holds the color value at which the animation should end.
+
+ If this value is not set and the ColorAnimation is defined within
+ a \l Transition or \l Behavior, it defaults to the value defined in the end
+ state of the \l Transition or \l Behavior.
*/
QColor QDeclarativeColorAnimation::to() const
{
@@ -869,18 +881,27 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
\inherits Animation
\brief The PropertyAction element allows immediate property changes during animation.
- Explicitly set \c theimage.smooth=true during a transition:
+ PropertyAction is used to specify an immediate property change
+ during an animation. The property change is not animated.
+
+ For example, to explicitly set \c {theImage.smooth = true} during a \l Transition:
\code
- PropertyAction { target: theimage; property: "smooth"; value: true }
+ transitions: Transition {
+ ...
+ PropertyAction { target: theImage; property: "smooth"; value: true }
+ ...
+ }
\endcode
- Set \c thewebview.url to the value set for the destination state:
+ Or, to set \c theWebView.url to the value set for the destination state:
\code
- PropertyAction { target: thewebview; property: "url" }
+ transitions: Transition {
+ ...
+ PropertyAction { target: theWebView; property: "url" }
+ ...
+ }
\endcode
- The PropertyAction is immediate -
- the target property is not animated to the selected value in any way.
\sa QtDeclarative
*/
@@ -906,14 +927,6 @@ void QDeclarativePropertyActionPrivate::init()
QDeclarative_setParent_noEvent(spa, q);
}
-/*!
- \qmlproperty Object PropertyAction::target
- This property holds an explicit target object to animate.
-
- The exact effect of the \c target property depends on how the animation
- is being used. Refer to the \l {QML Animation} documentation for details.
-*/
-
QObject *QDeclarativePropertyAction::target() const
{
Q_D(const QDeclarativePropertyAction);
@@ -945,12 +958,12 @@ void QDeclarativePropertyAction::setProperty(const QString &n)
}
/*!
+ \qmlproperty Object PropertyAction::target
\qmlproperty list<Object> PropertyAction::targets
\qmlproperty string PropertyAction::property
\qmlproperty string PropertyAction::properties
- \qmlproperty Object PropertyAction::target
- These properties are used as a set to determine which properties should be
+ These properties determine the items and their properties that are
affected by this action.
The details of how these properties are interpreted in different situations
@@ -982,7 +995,7 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets()
/*!
\qmlproperty list<Object> PropertyAction::exclude
- This property holds the objects not to be affected by this animation.
+ This property holds the objects that should not be affected by this action.
\sa targets
*/
@@ -1117,13 +1130,14 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
\qmlclass NumberAnimation QDeclarativeNumberAnimation
\since 4.7
\inherits PropertyAnimation
- \brief The NumberAnimation element allows you to animate changes in properties of type qreal.
+ \brief The NumberAnimation element animates changes in qreal-type values.
- NumberAnimation defines an animation to be applied when a numerical value
- changes.
+ NumberAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a numerical value changes.
Here is a NumberAnimation applied to the \c x property of a \l Rectangle
- as a property value source:
+ as a property value source. It animates the \c x value from its current
+ value to a value of 50, over 1000 milliseconds:
\snippet doc/src/snippets/declarative/numberanimation.qml 0
@@ -1174,6 +1188,7 @@ void QDeclarativeNumberAnimation::init()
For example, the following animation is not applied until the \c x value
has reached 100:
+ \qml
Item {
states: [ ... ]
@@ -1181,8 +1196,10 @@ void QDeclarativeNumberAnimation::init()
NumberAnimation { properties: "x"; from: 100; duration: 200 }
}
}
+ \endqml
- If this value is not set, it defaults to the value defined in the start
+ If this value is not set and the NumberAnimation is defined within
+ a \l Transition, it defaults to the value defined in the start
state of the \l Transition.
*/
@@ -1201,7 +1218,8 @@ void QDeclarativeNumberAnimation::setFrom(qreal f)
\qmlproperty real NumberAnimation::to
This property holds the ending number value.
- If this value is not set, it defaults to the value defined in the end
+ If this value is not set and the NumberAnimation is defined within
+ a \l Transition or \l Behavior, it defaults to the value defined in the end
state of the \l Transition or \l Behavior.
*/
qreal QDeclarativeNumberAnimation::to() const
@@ -1221,7 +1239,10 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
\qmlclass Vector3dAnimation QDeclarativeVector3dAnimation
\since 4.7
\inherits PropertyAnimation
- \brief The Vector3dAnimation element allows you to animate changes in properties of type QVector3d.
+ \brief The Vector3dAnimation element animates changes in QVector3d values.
+
+ Vector3dAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a Vector3d value changes.
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
@@ -1286,31 +1307,32 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
\qmlclass RotationAnimation QDeclarativeRotationAnimation
\since 4.7
\inherits PropertyAnimation
- \brief The RotationAnimation element allows you to animate rotations.
+ \brief The RotationAnimation element animates changes in rotation values.
RotationAnimation is a specialized PropertyAnimation that gives control
- over the direction of rotation. By default, it will rotate in the direction
+ over the direction of rotation during an animation.
+
+ By default, it rotates in the direction
of the numerical change; a rotation from 0 to 240 will rotate 220 degrees
clockwise, while a rotation from 240 to 0 will rotate 220 degrees
- counterclockwise.
+ counterclockwise. The \l direction property can be set to specify the
+ direction in which the rotation should occur.
+
+ In the following example we use RotationAnimation to animate the rotation
+ between states via the shortest path:
- When used in a transition RotationAnimation will rotate all
+ \snippet doc/src/snippets/declarative/rotationanimation.qml 0
+
+ Notice the RotationAnimation did not need to set a \l {RotationAnimation::}{target}
+ value. As a convenience, when used in a transition, RotationAnimation will rotate all
properties named "rotation" or "angle". You can override this by providing
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.
- \qml
- states: {
- State { name: "180"; PropertyChanges { target: myItem; rotation: 180 } }
- State { name: "90"; PropertyChanges { target: myItem; rotation: 90 } }
- State { name: "-90"; PropertyChanges { target: myItem; rotation: -90 } }
- }
- transition: Transition {
- RotationAnimation { direction: RotationAnimation.Shortest }
- }
- \endqml
+ Like any other animation element, a RotationAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l PropertyAnimation documentation shows a variety of methods
+ for creating animations.
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
@@ -1377,6 +1399,7 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
For example, the following animation is not applied until the \c angle value
has reached 100:
+ \qml
Item {
states: [ ... ]
@@ -1384,6 +1407,7 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
RotationAnimation { properties: "angle"; from: 100; duration: 2000 }
}
}
+ \endqml
If this value is not set, it defaults to the value defined in the start
state of the \l Transition.
@@ -1419,7 +1443,7 @@ void QDeclarativeRotationAnimation::setTo(qreal t)
/*!
\qmlproperty enumeration RotationAnimation::direction
- The direction in which to rotate.
+ This property holds the direction of the rotation.
Possible values are:
@@ -1512,19 +1536,26 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
\qmlclass SequentialAnimation QDeclarativeSequentialAnimation
\since 4.7
\inherits Animation
- \brief The SequentialAnimation element allows you to run animations sequentially.
+ \brief The SequentialAnimation element allows animations to be run sequentially.
- Animations controlled in SequentialAnimation will be run one after the other.
+ The SequentialAnimation and ParallelAnimation elements allow multiple
+ animations to be run together. Animations defined in a SequentialAnimation
+ are run one after the other, while animations defined in a ParallelAnimation
+ are run at the same time.
- The following example chains two numeric animations together. The \c MyItem
- object will animate from its current x position to 100, and then back to 0.
+ The following example runs two number animations in a sequence. The \l Rectangle
+ animates to a \c x position of 50, then to a \c y position of 50.
- \code
- SequentialAnimation {
- NumberAnimation { target: MyItem; property: "x"; to: 100 }
- NumberAnimation { target: MyItem; property: "x"; to: 0 }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/sequentialanimation.qml 0
+
+ Animations defined within a \l Transition are automatically run in parallel,
+ so SequentialAnimation can be used to enclose the animations in a \l Transition
+ if this is the preferred behavior.
+
+ Like any other animation element, a SequentialAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l PropertyAnimation documentation shows a variety of methods
+ for creating animations.
\sa ParallelAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
@@ -1574,19 +1605,22 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
\qmlclass ParallelAnimation QDeclarativeParallelAnimation
\since 4.7
\inherits Animation
- \brief The ParallelAnimation element allows you to run animations in parallel.
+ \brief The ParallelAnimation element allows animations to be run in parallel.
- Animations contained in ParallelAnimation will be run at the same time.
+ The SequentialAnimation and ParallelAnimation elements allow multiple
+ animations to be run together. Animations defined in a SequentialAnimation
+ are run one after the other, while animations defined in a ParallelAnimation
+ are run at the same time.
- The following animation demonstrates animating the \c MyItem item
- to (100,100) by animating the x and y properties in parallel.
+ The following animation runs two number animations in parallel. The \l Rectangle
+ moves to (50,50) by animating its \c x and \c y properties at the same time.
- \code
- ParallelAnimation {
- NumberAnimation { target: MyItem; property: "x"; to: 100 }
- NumberAnimation { target: MyItem; property: "y"; to: 100 }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/parallelanimation.qml 0
+
+ Like any other animation element, a ParallelAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l PropertyAnimation documentation shows a variety of methods
+ for creating animations.
\sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
@@ -1685,7 +1719,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
\qmlclass PropertyAnimation QDeclarativePropertyAnimation
\since 4.7
\inherits Animation
- \brief The PropertyAnimation element allows you to animate property changes.
+ \brief The PropertyAnimation element animates changes in property values.
PropertyAnimation provides a way to animate changes to a property's value.
@@ -2037,17 +2071,16 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t)
QEasingCurve QDeclarativePropertyAnimation::easing() const
{
Q_D(const QDeclarativePropertyAnimation);
- return d->easing;
+ return d->va->easingCurve();
}
void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e)
{
Q_D(QDeclarativePropertyAnimation);
- if (d->easing == e)
+ if (d->va->easingCurve() == e)
return;
- d->easing = e;
- d->va->setEasingCurve(d->easing);
+ d->va->setEasingCurve(e);
emit easingChanged(e);
}
@@ -2353,43 +2386,30 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
\qmlclass ParentAnimation QDeclarativeParentAnimation
\since 4.7
\inherits Animation
- \brief The ParentAnimation element allows you to animate parent changes.
+ \brief The ParentAnimation element animates changes in parent values.
- ParentAnimation is used in conjunction with NumberAnimation to smoothly
- animate changing an item's parent. In the following example,
- ParentAnimation wraps a NumberAnimation which animates from the
- current position in the old parent to the new position in the new
- parent.
+ ParentAnimation defines an animation to applied when a ParentChange
+ occurs. This allows parent changes to be smoothly animated.
- \qml
- ...
- State {
- //reparent myItem to newParent. myItem's final location
- //should be 10,10 in newParent.
- ParentChange {
- target: myItem
- parent: newParent
- x: 10; y: 10
- }
- }
- ...
- Transition {
- //smoothly reparent myItem and move into new position
- ParentAnimation {
- target: theItem
- NumberAnimation { properties: "x,y" }
- }
- }
- \endqml
+ For example, the following ParentChange changes \c blueRect to become
+ a child of \c redRect when it is clicked. The inclusion of the
+ ParentAnimation, which defines a NumberAnimation to be applied during
+ the transition, ensures the item animates smoothly as it moves to
+ its new parent:
+
+ \snippet doc/src/snippets/declarative/parentanimation.qml 0
- ParentAnimation can wrap any number of animations -- those animations will
- be run in parallel (like those in a ParallelAnimation group).
+ A ParentAnimation can contain any number of animations. These animations will
+ be run in parallel; to run them sequentially, define them within a
+ SequentialAnimation.
- In some cases, such as reparenting between items with clipping, it's useful
- to animate the parent change via another item with no clipping.
+ In some cases, such as when reparenting between items with clipping enabled, it is useful
+ to animate the parent change via another item that does not have clipping
+ enabled. Such an item can be set using the \l via property.
- When used in a transition, ParentAnimation will by default animate
- all ParentChanges.
+ By default, when used in a transition, ParentAnimation animates all parent
+ changes. This can be overriden by setting a specific target item using the
+ \l target property.
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
@@ -2426,8 +2446,8 @@ QDeclarativeParentAnimation::~QDeclarativeParentAnimation()
\qmlproperty Item ParentAnimation::target
The item to reparent.
- When used in a transition, if no target is specified all
- ParentChanges will be animated by the ParentAnimation.
+ When used in a transition, if no target is specified, all
+ ParentChange occurrences are animated by the ParentAnimation.
*/
QDeclarativeItem *QDeclarativeParentAnimation::target() const
{
@@ -2470,7 +2490,7 @@ void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent)
/*!
\qmlproperty Item ParentAnimation::via
The item to reparent via. This provides a way to do an unclipped animation
- when both the old parent and new parent are clipped
+ when both the old parent and new parent are clipped.
\qml
ParentAnimation {
@@ -2720,28 +2740,14 @@ QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation()
\qmlclass AnchorAnimation QDeclarativeAnchorAnimation
\since 4.7
\inherits Animation
- \brief The AnchorAnimation element allows you to animate anchor changes.
+ \brief The AnchorAnimation element animates changes in anchor values.
- AnchorAnimation will animated any changes specified by a state's AnchorChanges.
- In the following snippet we animate the addition of a right anchor to our item.
- \qml
- Item {
- id: myItem
- width: 100
- }
- ...
- State {
- AnchorChanges {
- target: myItem
- anchors.right: container.right
- }
- }
- ...
- Transition {
- //smoothly reanchor myItem and move into new position
- AnchorAnimation {}
- }
- \endqml
+ AnchorAnimation is used to animate an AnchorChange. It will anchor all
+ anchor changes specified in a \l State.
+
+ In the following snippet we animate the addition of a right anchor to a \l Rectangle:
+
+ \snippet doc/src/snippets/declarative/anchoranimation.qml 0
\sa AnchorChanges
*/
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
index b6d6bbb..e38580c 100644
--- a/src/declarative/util/qdeclarativeanimation_p_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -311,8 +311,6 @@ public:
QVariant from;
QVariant to;
- QEasingCurve easing;
-
QObject *target;
QString propertyName;
QString properties;
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 2bb28c3..fadb2ae 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -75,28 +75,21 @@ public:
\since 4.7
\brief The Behavior element allows you to specify a default animation for a property change.
- Behaviors provide one way to specify \l{qdeclarativeanimation.html}{animations} in QML.
-
- In the example below, the rectangle will use a bounce easing curve over 200 millisecond for any changes to its y property:
- \code
- Rectangle {
- width: 20; height: 20
- color: "#00ff00"
- y: 200 // initial value
- Behavior on y {
- NumberAnimation {
- easing.type: Easing.OutBounce
- easing.amplitude: 100
- duration: 200
- }
- }
- }
- \endcode
+ A Behavior defines the default animation to be applied whenever a
+ particular property value changes.
+
+ For example, the following Behavior defines a NumberAnimation to be run
+ whenever the \l Rectangle's \c width value changes. When the MouseArea
+ is clicked, the \c width is changed, triggering the behavior's animation:
+
+ \snippet doc/src/snippets/declarative/behavior.qml 0
- Currently only a single Behavior may be specified for a property;
- this Behavior can be enabled and disabled via the \l{enabled} property.
+ To run multiple animations within a Behavior, use ParallelAnimation or
+ SequentialAnimation.
- \sa {declarative/animation/behaviors}{Behavior example}, QtDeclarative
+ Note that a property cannot have more than one assigned Behavior.
+
+ \sa {Property Behaviors}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative
*/
@@ -113,7 +106,7 @@ QDeclarativeBehavior::~QDeclarativeBehavior()
\qmlproperty Animation Behavior::animation
\default
- The animation to use when the behavior is triggered.
+ This property holds the animation to run when the behavior is triggered.
*/
QDeclarativeAbstractAnimation *QDeclarativeBehavior::animation()
@@ -152,7 +145,9 @@ void QDeclarativeBehavior::qtAnimationStateChanged(QAbstractAnimation::State new
/*!
\qmlproperty bool Behavior::enabled
- Whether the Behavior will be triggered when the property it is tracking changes.
+
+ This property holds whether the behavior will be triggered when the tracked
+ property changes value.
By default a Behavior is enabled.
*/
@@ -182,7 +177,7 @@ void QDeclarativeBehavior::write(const QVariant &value)
return;
}
- if (value == d->targetValue)
+ if (d->animation->isRunning() && value == d->targetValue)
return;
d->currentValue = d->property.read();
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 00dd922..a83cac8 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -114,6 +114,18 @@ public:
static int downloadProgressIndex;
};
+class QDeclarativePixmapReaderThreadObject : public QObject {
+ Q_OBJECT
+public:
+ QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *);
+ void processJobs();
+ virtual bool event(QEvent *e);
+private slots:
+ void networkRequestDone();
+private:
+ QDeclarativePixmapReader *reader;
+};
+
class QDeclarativePixmapData;
class QDeclarativePixmapReader : public QThread
{
@@ -130,12 +142,11 @@ public:
protected:
void run();
-private slots:
- void networkRequestDone();
-
private:
+ friend class QDeclarativePixmapReaderThreadObject;
void processJobs();
void processJob(QDeclarativePixmapReply *);
+ void networkRequestDone(QNetworkReply *);
QList<QDeclarativePixmapReply*> jobs;
QList<QDeclarativePixmapReply*> cancelled;
@@ -143,14 +154,7 @@ private:
QObject *eventLoopQuitHack;
QMutex mutex;
- class ThreadObject : public QObject {
- public:
- ThreadObject(QDeclarativePixmapReader *);
- void processJobs();
- virtual bool event(QEvent *e);
- private:
- QDeclarativePixmapReader *reader;
- } *threadObject;
+ QDeclarativePixmapReaderThreadObject *threadObject;
QWaitCondition waitCondition;
QNetworkAccessManager *networkAccessManager();
@@ -161,7 +165,7 @@ private:
static int replyDownloadProgress;
static int replyFinished;
static int downloadProgress;
- static int thisNetworkRequestDone;
+ static int threadNetworkRequestDone;
static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers;
static QMutex readerMutex;
};
@@ -232,7 +236,7 @@ QMutex QDeclarativePixmapReader::readerMutex;
int QDeclarativePixmapReader::replyDownloadProgress = -1;
int QDeclarativePixmapReader::replyFinished = -1;
int QDeclarativePixmapReader::downloadProgress = -1;
-int QDeclarativePixmapReader::thisNetworkRequestDone = -1;
+int QDeclarativePixmapReader::threadNetworkRequestDone = -1;
void QDeclarativePixmapReply::postReply(ReadError error, const QString &errorString,
@@ -317,9 +321,8 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader()
wait();
}
-void QDeclarativePixmapReader::networkRequestDone()
+void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply)
{
- QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
QDeclarativePixmapReply *job = replies.take(reply);
if (job) {
@@ -335,7 +338,7 @@ void QDeclarativePixmapReader::networkRequestDone()
reply = networkAccessManager()->get(req);
QMetaObject::connect(reply, replyDownloadProgress, job, downloadProgress);
- QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
+ QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
replies.insert(reply, job);
return;
@@ -368,17 +371,17 @@ void QDeclarativePixmapReader::networkRequestDone()
threadObject->processJobs();
}
-QDeclarativePixmapReader::ThreadObject::ThreadObject(QDeclarativePixmapReader *i)
+QDeclarativePixmapReaderThreadObject::QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *i)
: reader(i)
{
}
-void QDeclarativePixmapReader::ThreadObject::processJobs()
+void QDeclarativePixmapReaderThreadObject::processJobs()
{
QCoreApplication::postEvent(this, new QEvent(QEvent::User));
}
-bool QDeclarativePixmapReader::ThreadObject::event(QEvent *e)
+bool QDeclarativePixmapReaderThreadObject::event(QEvent *e)
{
if (e->type() == QEvent::User) {
reader->processJobs();
@@ -388,6 +391,12 @@ bool QDeclarativePixmapReader::ThreadObject::event(QEvent *e)
}
}
+void QDeclarativePixmapReaderThreadObject::networkRequestDone()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+ reader->networkRequestDone(reply);
+}
+
void QDeclarativePixmapReader::processJobs()
{
QMutexLocker locker(&mutex);
@@ -469,7 +478,7 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
QNetworkReply *reply = networkAccessManager()->get(req);
QMetaObject::connect(reply, replyDownloadProgress, runningJob, downloadProgress);
- QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
+ QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
replies.insert(reply, runningJob);
}
@@ -520,15 +529,15 @@ void QDeclarativePixmapReader::run()
if (replyDownloadProgress == -1) {
const QMetaObject *nr = &QNetworkReply::staticMetaObject;
const QMetaObject *pr = &QDeclarativePixmapReply::staticMetaObject;
- const QMetaObject *ir = &QDeclarativePixmapReader::staticMetaObject;
+ const QMetaObject *ir = &QDeclarativePixmapReaderThreadObject::staticMetaObject;
replyDownloadProgress = nr->indexOfSignal("downloadProgress(qint64,qint64)");
replyFinished = nr->indexOfSignal("finished()");
downloadProgress = pr->indexOfSignal("downloadProgress(qint64,qint64)");
- thisNetworkRequestDone = ir->indexOfSlot("networkRequestDone()");
+ threadNetworkRequestDone = ir->indexOfSlot("networkRequestDone()");
}
mutex.lock();
- threadObject = new ThreadObject(this);
+ threadObject = new QDeclarativePixmapReaderThreadObject(this);
mutex.unlock();
processJobs();
@@ -605,7 +614,7 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data)
m_unreferencedCost += data->cost();
if (m_timerId == -1)
- startTimer(CACHE_EXPIRE_TIME * 1000);
+ m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
}
void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data)
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index e0d1097..11c3d4b 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -253,15 +253,22 @@ void QSmoothedAnimation::init()
\inherits NumberAnimation
\brief The SmoothedAnimation element allows a property to smoothly track a value.
- The SmoothedAnimation animates a property's value to a set target value
- using an ease in/out quad easing curve. If the animation is restarted
- with a different target value, the easing curves used to animate to the old
- and the new target values are smoothly spliced together to avoid any obvious
- visual glitches by maintaining the current velocity.
-
- The property animation is configured by setting the velocity at which the
- animation should occur, or the duration that the animation should take.
- If both a velocity and a duration are specified, the one that results in
+ A SmoothedAnimation animates a property's value to a set target value
+ using an ease in/out quad easing curve. When the target value changes,
+ the easing curves used to animate between the old and new target values
+ are smoothly spliced together to create a smooth movement to the new
+ target value that maintains the current velocity.
+
+ The follow example shows one \l Rectangle tracking the position of another
+ using SmoothedAnimation. The green rectangle's \c x and \c y values are
+ bound to those of the red rectangle. Whenever these values change, the
+ green rectangle smoothly animates to its new position:
+
+ \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
+
+ A SmoothedAnimation can be configured by setting the \l velocity at which the
+ animation should occur, or the \l duration that the animation should take.
+ If both the \l velocity and \l duration are specified, the one that results in
the quickest animation is chosen for each change in the target value.
For example, animating from 0 to 800 will take 4 seconds if a velocity
@@ -271,10 +278,6 @@ void QSmoothedAnimation::init()
will take 8 seconds with a duration of 8000 set, and will take 8 seconds
with both a velocity of 200 and a duration of 8000 set.
- The follow example shows one rectangle tracking the position of another.
-
- \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
-
The default velocity of SmoothedAnimation is 200 units/second. Note that if the range of the
value being animated is small, then the velocity will need to be adjusted
appropriately. For example, the opacity of an item ranges from 0 - 1.0.
@@ -287,7 +290,7 @@ void QSmoothedAnimation::init()
sources. The \l PropertyAnimation documentation shows a variety of methods
for creating animations.
- \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
+ \sa SpringAnimation, NumberAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent)
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index be0af6d..8ce4832 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -215,7 +215,9 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
You can also limit the maximum \l velocity of the animation.
The following \l Rectangle moves to the position of the mouse using a
- SpringAnimation when the mouse is clicked:
+ SpringAnimation when the mouse is clicked. The use of the \l Behavior
+ on the \c x and \c y values indicates that whenever these values are
+ changed, a SpringAnimation should be applied.
\snippet doc/src/snippets/declarative/springanimation.qml 0
@@ -224,7 +226,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
sources. The \l PropertyAnimation documentation shows a variety of methods
for creating animations.
- \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
+ \sa SmoothedAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
*/
QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent)
@@ -284,8 +286,8 @@ qreal QDeclarativeSpringAnimation::from() const
This property holds the value from which the animation will begin.
- If not set, the animation will start regardless of the
- value being tracked.
+ If not set, the animation will start whenever the tracked value has
+ changed, regardless of its value.
*/
void QDeclarativeSpringAnimation::setFrom(qreal value)
@@ -303,7 +305,10 @@ void QDeclarativeSpringAnimation::setFrom(qreal value)
/*!
\qmlproperty real SpringAnimation::velocity
+
This property holds the maximum velocity allowed when tracking the source.
+
+ The default value is 0 (no maximum velocity).
*/
qreal QDeclarativeSpringAnimation::velocity() const
@@ -322,13 +327,14 @@ void QDeclarativeSpringAnimation::setVelocity(qreal velocity)
/*!
\qmlproperty real SpringAnimation::spring
- This property holds the spring constant
- The spring constant describes how strongly the target is pulled towards the
- source. Setting spring to 0 turns off spring tracking. Useful values 0 - 5.0
+ This property describes how strongly the target is pulled towards the
+ source. The default value is 0 (that is, the spring-like motion is disabled).
+
+ The useful value range is 0 - 5.0.
- When a spring constant is set and the velocity property is greater than 0,
- velocity limits the maximum speed.
+ When this property is set and the \l velocity value is greater than 0,
+ the \l velocity limits the maximum speed.
*/
qreal QDeclarativeSpringAnimation::spring() const
{
@@ -347,10 +353,11 @@ void QDeclarativeSpringAnimation::setSpring(qreal spring)
\qmlproperty real SpringAnimation::damping
This property holds the spring damping value.
- This value describes how quickly a sprung follower comes to rest.
+ This value describes how quickly the spring-like motion comes to rest.
+ The default value is 0.
- The useful range is 0 - 1.0. The lower the value, the faster the
- follower comes to rest.
+ The useful value range is 0 - 1.0. The lower the value, the faster it
+ comes to rest.
*/
qreal QDeclarativeSpringAnimation::damping() const
{
@@ -392,7 +399,7 @@ void QDeclarativeSpringAnimation::setEpsilon(qreal epsilon)
/*!
\qmlproperty real SpringAnimation::modulus
- This property holds the modulus value.
+ This property holds the modulus value. The default value is 0.
Setting a \a modulus forces the target value to "wrap around" at the modulus.
For example, setting the modulus to 360 will cause a value of 370 to wrap around to 10.
@@ -417,8 +424,10 @@ void QDeclarativeSpringAnimation::setModulus(qreal modulus)
\qmlproperty real SpringAnimation::mass
This property holds the "mass" of the property being moved.
- mass is 1.0 by default. Setting a different mass changes the dynamics of
- a \l spring follow.
+ The value is 1.0 by default.
+
+ A greater mass causes slower movement and a greater spring-like
+ motion when an item comes to rest.
*/
qreal QDeclarativeSpringAnimation::mass() const
{
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 5590449..2291c16 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -1501,8 +1501,12 @@ void QDeclarativeAnchorChanges::rewind()
d->target->setX(d->rewindX);
d->target->setY(d->rewindY);
- d->target->setWidth(d->rewindWidth);
- d->target->setHeight(d->rewindHeight);
+ if (targetPrivate->widthValid) {
+ d->target->setWidth(d->rewindWidth);
+ }
+ if (targetPrivate->heightValid) {
+ d->target->setHeight(d->rewindHeight);
+ }
}
void QDeclarativeAnchorChanges::saveCurrentValues()
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 6b7418e..6561b8c 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -66,8 +66,6 @@ QT_BEGIN_NAMESPACE
\snippet doc/src/snippets/declarative/transition.qml 0
- Items can have multiple transitions, if
-
To specify multiple transitions, specify \l Item::transitions as a list:
\qml
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 496f2ad..7546a50 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -132,7 +132,7 @@ class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarative
public:
QDeclarativeViewPrivate()
: root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {}
- ~QDeclarativeViewPrivate() { delete root; }
+ ~QDeclarativeViewPrivate() { delete root; delete engine; }
void execute();
void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
void initResize();
@@ -145,7 +145,7 @@ public:
QUrl source;
- QDeclarativeEngine engine;
+ QDeclarativeEngine* engine;
QDeclarativeComponent *component;
QBasicTimer resizetimer;
@@ -170,7 +170,7 @@ void QDeclarativeViewPrivate::execute()
component = 0;
}
if (!source.isEmpty()) {
- component = new QDeclarativeComponent(&engine, source, q);
+ component = new QDeclarativeComponent(engine, source, q);
if (!component->isLoading()) {
q->continueExecute();
} else {
@@ -275,6 +275,7 @@ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
void QDeclarativeViewPrivate::init()
{
Q_Q(QDeclarativeView);
+ engine = new QDeclarativeEngine();
q->setScene(&scene);
q->setOptimizationFlags(QGraphicsView::DontSavePainterState);
@@ -338,10 +339,10 @@ QUrl QDeclarativeView::source() const
Returns a pointer to the QDeclarativeEngine used for instantiating
QML Components.
*/
-QDeclarativeEngine* QDeclarativeView::engine()
+QDeclarativeEngine* QDeclarativeView::engine() const
{
- Q_D(QDeclarativeView);
- return &d->engine;
+ Q_D(const QDeclarativeView);
+ return d->engine;
}
/*!
@@ -351,10 +352,10 @@ QDeclarativeEngine* QDeclarativeView::engine()
arranged hierarchically and this hierarchy is managed by the
QDeclarativeEngine.
*/
-QDeclarativeContext* QDeclarativeView::rootContext()
+QDeclarativeContext* QDeclarativeView::rootContext() const
{
- Q_D(QDeclarativeView);
- return d->engine.rootContext();
+ Q_D(const QDeclarativeView);
+ return d->engine->rootContext();
}
/*!
diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h
index cdcf134..d3e4948 100644
--- a/src/declarative/util/qdeclarativeview.h
+++ b/src/declarative/util/qdeclarativeview.h
@@ -75,8 +75,8 @@ public:
QUrl source() const;
void setSource(const QUrl&);
- QDeclarativeEngine* engine();
- QDeclarativeContext* rootContext();
+ QDeclarativeEngine* engine() const;
+ QDeclarativeContext* rootContext() const;
QGraphicsObject *rootObject() const;
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6249822..56182d1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1150,6 +1150,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) {
parentFocusScopeItem = fsi;
p->d_ptr->focusScopeItem = 0;
+ fsi->d_ptr->focusScopeItemChange(false);
}
break;
}
@@ -1182,6 +1183,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
while (p) {
if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
p->d_ptr->focusScopeItem = newFocusScopeItem;
+ newFocusScopeItem->d_ptr->focusScopeItemChange(true);
// Ensure the new item is no longer the subFocusItem. The
// only way to set focus on a child of a focus scope is
// by setting focus on the scope itself.
@@ -5587,6 +5589,16 @@ void QGraphicsItemPrivate::subFocusItemChange()
/*!
\internal
+ Subclasses can reimplement this function to be notified when an item
+ becomes a focusScopeItem (or is no longer a focusScopeItem).
+*/
+void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
+{
+}
+
+/*!
+ \internal
+
Subclasses can reimplement this function to be notified when its
siblingIndex order is changed.
*/
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 5b9a710..d60dffb 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -482,6 +482,7 @@ public:
void clearSubFocus(QGraphicsItem *rootItem = 0);
void resetFocusProxy();
virtual void subFocusItemChange();
+ virtual void focusScopeItemChange(bool isSubFocusItem);
static void children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item);
static int children_count(QDeclarativeListProperty<QGraphicsObject> *list);
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 8fdd72c..480d9ff 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -12,7 +12,7 @@ EXPORTS
??0QDeclarativeText@@QAE@PAVQDeclarativeItem@@@Z @ 11 NONAME ; QDeclarativeText::QDeclarativeText(class QDeclarativeItem *)
?trUtf8@QDeclarativePixmapReply@@SA?AVQString@@PBD0H@Z @ 12 NONAME ABSENT ; class QString QDeclarativePixmapReply::trUtf8(char const *, char const *, int)
?propertyTypeName@QDeclarativeProperty@@QBEPBDXZ @ 13 NONAME ; char const * QDeclarativeProperty::propertyTypeName(void) const
- ?wantsFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 14 NONAME ; void QDeclarativeItem::wantsFocusChanged(bool)
+ ?wantsFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 14 NONAME ABSENT ; void QDeclarativeItem::wantsFocusChanged(bool)
?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
?setLeft@QDeclarativeAnchors@@QAEXABVQDeclarativeAnchorLine@@@Z @ 16 NONAME ; void QDeclarativeAnchors::setLeft(class QDeclarativeAnchorLine const &)
?qt_metacall@QDeclarativeExpression@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int QDeclarativeExpression::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -61,7 +61,7 @@ EXPORTS
??0QDeclarativeDomObject@@QAE@XZ @ 60 NONAME ; QDeclarativeDomObject::QDeclarativeDomObject(void)
?errors@QDeclarativeDomDocument@@QBE?AV?$QList@VQDeclarativeError@@@@XZ @ 61 NONAME ; class QList<class QDeclarativeError> QDeclarativeDomDocument::errors(void) const
?toChanged@QDeclarativeTransition@@IAEXXZ @ 62 NONAME ; void QDeclarativeTransition::toChanged(void)
- ?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 63 NONAME ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
+ ?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 63 NONAME ABSENT ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
?objectOwnership@QDeclarativeEngine@@SA?AW4ObjectOwnership@1@PAVQObject@@@Z @ 64 NONAME ; enum QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(class QObject *)
??0QDeclarativeDebugWatch@@QAE@PAVQObject@@@Z @ 65 NONAME ; QDeclarativeDebugWatch::QDeclarativeDebugWatch(class QObject *)
?value@QDeclarativePropertyMap@@QBE?AVQVariant@@ABVQString@@@Z @ 66 NONAME ; class QVariant QDeclarativePropertyMap::value(class QString const &) const
@@ -79,7 +79,7 @@ EXPORTS
?isInvalid@QDeclarativeDomValue@@QBE_NXZ @ 78 NONAME ; bool QDeclarativeDomValue::isInvalid(void) const
?trUtf8@QDeclarativeText@@SA?AVQString@@PBD0H@Z @ 79 NONAME ; class QString QDeclarativeText::trUtf8(char const *, char const *, int)
??0QDeclarativeListReference@@QAE@ABV0@@Z @ 80 NONAME ; QDeclarativeListReference::QDeclarativeListReference(class QDeclarativeListReference const &)
- ?registerType@QDeclarativePrivate@@YAHABURegisterInterface@1@@Z @ 81 NONAME ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterInterface const &)
+ ?registerType@QDeclarativePrivate@@YAHABURegisterInterface@1@@Z @ 81 NONAME ABSENT ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterInterface const &)
?classBegin@QDeclarativeItem@@MAEXXZ @ 82 NONAME ; void QDeclarativeItem::classBegin(void)
?setTransformOrigin@QDeclarativeItem@@QAEXW4TransformOrigin@1@@Z @ 83 NONAME ; void QDeclarativeItem::setTransformOrigin(enum QDeclarativeItem::TransformOrigin)
?request@QDeclarativePixmapCache@@SAPAVQDeclarativePixmapReply@@PAVQDeclarativeEngine@@ABVQUrl@@HH@Z @ 84 NONAME ABSENT ; class QDeclarativePixmapReply * QDeclarativePixmapCache::request(class QDeclarativeEngine *, class QUrl const &, int, int)
@@ -265,7 +265,7 @@ EXPORTS
?readyRead@QPacketProtocol@@IAEXXZ @ 264 NONAME ; void QPacketProtocol::readyRead(void)
?qt_metacall@QDeclarativeValueType@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 265 NONAME ; int QDeclarativeValueType::qt_metacall(enum QMetaObject::Call, int, void * *)
?propertyType@QDeclarativePropertyPrivate@@QBEHXZ @ 266 NONAME ; int QDeclarativePropertyPrivate::propertyType(void) const
- ?engine@QDeclarativeView@@QAEPAVQDeclarativeEngine@@XZ @ 267 NONAME ; class QDeclarativeEngine * QDeclarativeView::engine(void)
+ ?engine@QDeclarativeView@@QAEPAVQDeclarativeEngine@@XZ @ 267 NONAME ABSENT ; class QDeclarativeEngine * QDeclarativeView::engine(void)
?inputMethodQuery@QDeclarativeItem@@MBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z @ 268 NONAME ; class QVariant QDeclarativeItem::inputMethodQuery(enum Qt::InputMethodQuery) const
?sizeHint@QDeclarativeView@@UBE?AVQSize@@XZ @ 269 NONAME ; class QSize QDeclarativeView::sizeHint(void) const
?flags@QDeclarativeCustomParser@@QBE?AV?$QFlags@W4Flag@QDeclarativeCustomParser@@@@XZ @ 270 NONAME ; class QFlags<enum QDeclarativeCustomParser::Flag> QDeclarativeCustomParser::flags(void) const
@@ -409,7 +409,7 @@ EXPORTS
?addRef@QDeclarativePixmapReply@@AAEXXZ @ 408 NONAME ABSENT ; void QDeclarativePixmapReply::addRef(void)
?mouseReleaseEvent@QDeclarativeText@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 409 NONAME ; void QDeclarativeText::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
?isCustomType@QDeclarativeDomObject@@QBE_NXZ @ 410 NONAME ; bool QDeclarativeDomObject::isCustomType(void) const
- ?registerType@QDeclarativePrivate@@YAHABURegisterType@1@@Z @ 411 NONAME ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterType const &)
+ ?registerType@QDeclarativePrivate@@YAHABURegisterType@1@@Z @ 411 NONAME ABSENT ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterType const &)
?radius@QDeclarativeRectangle@@QBEMXZ @ 412 NONAME ; float QDeclarativeRectangle::radius(void) const
??0QDeclarativeComponent@@AAE@PAVQDeclarativeEngine@@PAVQDeclarativeCompiledData@@HHPAVQObject@@@Z @ 413 NONAME ; QDeclarativeComponent::QDeclarativeComponent(class QDeclarativeEngine *, class QDeclarativeCompiledData *, int, int, class QObject *)
?resources_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQObject@@@@@Z @ 414 NONAME ; int QDeclarativeItemPrivate::resources_count(class QDeclarativeListProperty<class QObject> *)
@@ -813,7 +813,7 @@ EXPORTS
??0QDeclarativeView@@QAE@ABVQUrl@@PAVQWidget@@@Z @ 812 NONAME ; QDeclarativeView::QDeclarativeView(class QUrl const &, class QWidget *)
?qt_metacall@QDeclarativePixmapReply@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 813 NONAME ABSENT ; int QDeclarativePixmapReply::qt_metacall(enum QMetaObject::Call, int, void * *)
?valueChanged@QDeclarativeExpression@@IAEXXZ @ 814 NONAME ; void QDeclarativeExpression::valueChanged(void)
- ?childrenChanged@QDeclarativeItem@@IAEXXZ @ 815 NONAME ; void QDeclarativeItem::childrenChanged(void)
+ ?childrenChanged@QDeclarativeItem@@IAEXXZ @ 815 NONAME ABSENT ; void QDeclarativeItem::childrenChanged(void)
??_EQDeclarativeView@@UAE@I@Z @ 816 NONAME ; QDeclarativeView::~QDeclarativeView(unsigned int)
?trUtf8@QDeclarativeStateGroup@@SA?AVQString@@PBD0H@Z @ 817 NONAME ; class QString QDeclarativeStateGroup::trUtf8(char const *, char const *, int)
?tag@QMetaMethodBuilder@@QBE?AVQByteArray@@XZ @ 818 NONAME ; class QByteArray QMetaMethodBuilder::tag(void) const
@@ -877,7 +877,7 @@ EXPORTS
?setWidth@QDeclarativeItemPrivate@@UAEXM@Z @ 876 NONAME ; void QDeclarativeItemPrivate::setWidth(float)
?staticMetaObject@QDeclarativeDebugWatch@@2UQMetaObject@@B @ 877 NONAME ; struct QMetaObject const QDeclarativeDebugWatch::staticMetaObject
??_EQDeclarativeContext@@UAE@I@Z @ 878 NONAME ; QDeclarativeContext::~QDeclarativeContext(unsigned int)
- ?rootContext@QDeclarativeView@@QAEPAVQDeclarativeContext@@XZ @ 879 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void)
+ ?rootContext@QDeclarativeView@@QAEPAVQDeclarativeContext@@XZ @ 879 NONAME ABSENT ; class QDeclarativeContext * QDeclarativeView::rootContext(void)
?staticMetaObject@QDeclarativeDebugQuery@@2UQMetaObject@@B @ 880 NONAME ; struct QMetaObject const QDeclarativeDebugQuery::staticMetaObject
??0QDeclarativeExtensionPlugin@@QAE@PAVQObject@@@Z @ 881 NONAME ; QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(class QObject *)
??_EQDeclarativeOpenMetaObject@@UAE@I@Z @ 882 NONAME ; QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject(unsigned int)
@@ -1077,7 +1077,7 @@ EXPORTS
??1QDeclarativeEngine@@UAE@XZ @ 1076 NONAME ; QDeclarativeEngine::~QDeclarativeEngine(void)
?debugId@QDeclarativeDebugContextReference@@QBEHXZ @ 1077 NONAME ; int QDeclarativeDebugContextReference::debugId(void) const
?propertyNameParts@QDeclarativeDomProperty@@QBE?AV?$QList@VQByteArray@@@@XZ @ 1078 NONAME ; class QList<class QByteArray> QDeclarativeDomProperty::propertyNameParts(void) const
- ?rootContext@QDeclarativeEngine@@QAEPAVQDeclarativeContext@@XZ @ 1079 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void)
+ ?rootContext@QDeclarativeEngine@@QAEPAVQDeclarativeContext@@XZ @ 1079 NONAME ABSENT ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void)
?resetWidth@QDeclarativeItemPrivate@@UAEXXZ @ 1080 NONAME ; void QDeclarativeItemPrivate::resetWidth(void)
??AQDeclarativeOpenMetaObject@@QAEAAVQVariant@@ABVQByteArray@@@Z @ 1081 NONAME ; class QVariant & QDeclarativeOpenMetaObject::operator[](class QByteArray const &)
?bottom@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 1082 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom(void) const
@@ -1182,7 +1182,7 @@ EXPORTS
??_EQDeclarativeEngineDebug@@UAE@I@Z @ 1181 NONAME ; QDeclarativeEngineDebug::~QDeclarativeEngineDebug(unsigned int)
?bottom@QDeclarativeScaleGrid@@QBEHXZ @ 1182 NONAME ; int QDeclarativeScaleGrid::bottom(void) const
?d_func@QDeclarativePropertyMap@@AAEPAVQDeclarativePropertyMapPrivate@@XZ @ 1183 NONAME ; class QDeclarativePropertyMapPrivate * QDeclarativePropertyMap::d_func(void)
- ?forceFocus@QDeclarativeItem@@QAEXXZ @ 1184 NONAME ; void QDeclarativeItem::forceFocus(void)
+ ?forceFocus@QDeclarativeItem@@QAEXXZ @ 1184 NONAME ABSENT ; void QDeclarativeItem::forceFocus(void)
?trUtf8@QDeclarativeView@@SA?AVQString@@PBD0@Z @ 1185 NONAME ; class QString QDeclarativeView::trUtf8(char const *, char const *)
??0QDeclarativeTransition@@QAE@PAVQObject@@@Z @ 1186 NONAME ; QDeclarativeTransition::QDeclarativeTransition(class QObject *)
?horizontalCenter@QDeclarativeAnchors@@QBE?AVQDeclarativeAnchorLine@@XZ @ 1187 NONAME ; class QDeclarativeAnchorLine QDeclarativeAnchors::horizontalCenter(void) const
@@ -1442,7 +1442,7 @@ EXPORTS
?drawRect@QDeclarativeRectangle@@AAEXAAVQPainter@@@Z @ 1441 NONAME ; void QDeclarativeRectangle::drawRect(class QPainter &)
?read@QDeclarativeProperty@@QBE?AVQVariant@@XZ @ 1442 NONAME ; class QVariant QDeclarativeProperty::read(void) const
?isEmpty@QDeclarativePropertyMap@@QBE_NXZ @ 1443 NONAME ; bool QDeclarativePropertyMap::isEmpty(void) const
- ?wantsFocus@QDeclarativeItem@@QBE_NXZ @ 1444 NONAME ; bool QDeclarativeItem::wantsFocus(void) const
+ ?wantsFocus@QDeclarativeItem@@QBE_NXZ @ 1444 NONAME ABSENT ; bool QDeclarativeItem::wantsFocus(void) const
??6@YAAAVQDataStream@@AAV0@ABUQDeclarativeObjectData@QDeclarativeEngineDebugServer@@@Z @ 1445 NONAME ; class QDataStream & operator<<(class QDataStream &, struct QDeclarativeEngineDebugServer::QDeclarativeObjectData const &)
?trUtf8@QDeclarativeDebugObjectQuery@@SA?AVQString@@PBD0H@Z @ 1446 NONAME ; class QString QDeclarativeDebugObjectQuery::trUtf8(char const *, char const *, int)
??0QDeclarativeBinding@@QAE@ABVQString@@PAVQObject@@PAVQDeclarativeContext@@1@Z @ 1447 NONAME ; QDeclarativeBinding::QDeclarativeBinding(class QString const &, class QObject *, class QDeclarativeContext *, class QObject *)
@@ -1676,4 +1676,12 @@ EXPORTS
??0QDeclarativeImageProvider@@QAE@W4ImageType@0@@Z @ 1675 NONAME ; QDeclarativeImageProvider::QDeclarativeImageProvider(enum QDeclarativeImageProvider::ImageType)
?setMethodBody@QDeclarativeEngineDebug@@QAE_NHABVQString@@0@Z @ 1676 NONAME ; bool QDeclarativeEngineDebug::setMethodBody(int, class QString const &, class QString const &)
?resetBindingForObject@QDeclarativeEngineDebug@@QAE_NHABVQString@@@Z @ 1677 NONAME ; bool QDeclarativeEngineDebug::resetBindingForObject(int, class QString const &)
+ ?forceActiveFocus@QDeclarativeItem@@QAEXXZ @ 1678 NONAME ; void QDeclarativeItem::forceActiveFocus(void)
+ ?activeFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 1679 NONAME ; void QDeclarativeItem::activeFocusChanged(bool)
+ ?focusScopeItemChange@QDeclarativeItemPrivate@@UAEX_N@Z @ 1680 NONAME ; void QDeclarativeItemPrivate::focusScopeItemChange(bool)
+ ?hasActiveFocus@QDeclarativeItem@@QBE_NXZ @ 1681 NONAME ; bool QDeclarativeItem::hasActiveFocus(void) const
+ ?engine@QDeclarativeView@@QBEPAVQDeclarativeEngine@@XZ @ 1682 NONAME ; class QDeclarativeEngine * QDeclarativeView::engine(void) const
+ ?rootContext@QDeclarativeView@@QBEPAVQDeclarativeContext@@XZ @ 1683 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void) const
+ ?rootContext@QDeclarativeEngine@@QBEPAVQDeclarativeContext@@XZ @ 1684 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void) const
+ ?qmlregister@QDeclarativePrivate@@YAHW4RegistrationType@1@PAX@Z @ 1685 NONAME ; int QDeclarativePrivate::qmlregister(enum QDeclarativePrivate::RegistrationType, void *)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 1df9b84..b06cbba 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12879,4 +12879,8 @@ EXPORTS
?PreDocConstructL@QS60MainApplication@@UAEXXZ @ 12878 NONAME ; void QS60MainApplication::PreDocConstructL(void)
?NewAppServerL@QS60MainApplication@@UAEXAAPAVCApaAppServer@@@Z @ 12879 NONAME ; void QS60MainApplication::NewAppServerL(class CApaAppServer * &)
?HandleViewDeactivation@QS60MainAppUi@@UAEXABVTVwsViewId@@0@Z @ 12880 NONAME ; void QS60MainAppUi::HandleViewDeactivation(class TVwsViewId const &, class TVwsViewId const &)
+ ?timeout@QTapAndHoldGesture@@SAHXZ @ 12881 NONAME ; int QTapAndHoldGesture::timeout(void)
+ ?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool)
+ ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int)
+ ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool)
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index dd5103f..9a3cefa 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -44,7 +44,7 @@ EXPORTS
_ZN16QDeclarativeInfoD1Ev @ 43 NONAME
_ZN16QDeclarativeInfoD2Ev @ 44 NONAME
_ZN16QDeclarativeItem10classBeginEv @ 45 NONAME
- _ZN16QDeclarativeItem10forceFocusEv @ 46 NONAME
+ _ZN16QDeclarativeItem10forceFocusEv @ 46 NONAME ABSENT
_ZN16QDeclarativeItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 47 NONAME
_ZN16QDeclarativeItem10resetWidthEv @ 48 NONAME
_ZN16QDeclarativeItem10sceneEventEP6QEvent @ 49 NONAME
@@ -59,7 +59,7 @@ EXPORTS
_ZN16QDeclarativeItem13parentChangedEPS_ @ 58 NONAME
_ZN16QDeclarativeItem13setParentItemEPS_ @ 59 NONAME
_ZN16QDeclarativeItem13smoothChangedEb @ 60 NONAME
- _ZN16QDeclarativeItem15childrenChangedEv @ 61 NONAME
+ _ZN16QDeclarativeItem15childrenChangedEv @ 61 NONAME ABSENT
_ZN16QDeclarativeItem15geometryChangedERK6QRectFS2_ @ 62 NONAME
_ZN16QDeclarativeItem15keyReleaseEventEP9QKeyEvent @ 63 NONAME
_ZN16QDeclarativeItem16inputMethodEventEP17QInputMethodEvent @ 64 NONAME
@@ -69,7 +69,7 @@ EXPORTS
_ZN16QDeclarativeItem17componentCompleteEv @ 68 NONAME
_ZN16QDeclarativeItem17setBaselineOffsetEf @ 69 NONAME
_ZN16QDeclarativeItem17setImplicitHeightEf @ 70 NONAME
- _ZN16QDeclarativeItem17wantsFocusChangedEb @ 71 NONAME
+ _ZN16QDeclarativeItem17wantsFocusChangedEb @ 71 NONAME ABSENT
_ZN16QDeclarativeItem18keyPressPreHandlerEP9QKeyEvent @ 72 NONAME
_ZN16QDeclarativeItem18setTransformOriginENS_15TransformOriginE @ 73 NONAME
_ZN16QDeclarativeItem19childrenRectChangedERK6QRectF @ 74 NONAME
@@ -143,7 +143,7 @@ EXPORTS
_ZN16QDeclarativeView11qt_metacallEN11QMetaObject4CallEiPPv @ 142 NONAME
_ZN16QDeclarativeView11qt_metacastEPKc @ 143 NONAME
_ZN16QDeclarativeView11resizeEventEP12QResizeEvent @ 144 NONAME
- _ZN16QDeclarativeView11rootContextEv @ 145 NONAME
+ _ZN16QDeclarativeView11rootContextEv @ 145 NONAME ABSENT
_ZN16QDeclarativeView12sceneResizedE5QSize @ 146 NONAME
_ZN16QDeclarativeView13setResizeModeENS_10ResizeModeE @ 147 NONAME
_ZN16QDeclarativeView13setRootObjectEP7QObject @ 148 NONAME
@@ -151,7 +151,7 @@ EXPORTS
_ZN16QDeclarativeView15continueExecuteEv @ 150 NONAME
_ZN16QDeclarativeView16staticMetaObjectE @ 151 NONAME DATA 16
_ZN16QDeclarativeView19getStaticMetaObjectEv @ 152 NONAME
- _ZN16QDeclarativeView6engineEv @ 153 NONAME
+ _ZN16QDeclarativeView6engineEv @ 153 NONAME ABSENT
_ZN16QDeclarativeView9setSourceERK4QUrl @ 154 NONAME
_ZN16QDeclarativeViewC1EP7QWidget @ 155 NONAME
_ZN16QDeclarativeViewC1ERK4QUrlP7QWidget @ 156 NONAME
@@ -202,7 +202,7 @@ EXPORTS
_ZN18QDeclarativeEngine10setBaseUrlERK4QUrl @ 201 NONAME
_ZN18QDeclarativeEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 202 NONAME
_ZN18QDeclarativeEngine11qt_metacastEPKc @ 203 NONAME
- _ZN18QDeclarativeEngine11rootContextEv @ 204 NONAME
+ _ZN18QDeclarativeEngine11rootContextEv @ 204 NONAME ABSENT
_ZN18QDeclarativeEngine12importPluginERK7QStringS2_PS0_ @ 205 NONAME
_ZN18QDeclarativeEngine13addImportPathERK7QString @ 206 NONAME
_ZN18QDeclarativeEngine13addPluginPathERK7QString @ 207 NONAME
@@ -385,9 +385,9 @@ EXPORTS
_ZN19QDeclarativeDomListD1Ev @ 384 NONAME
_ZN19QDeclarativeDomListD2Ev @ 385 NONAME
_ZN19QDeclarativeDomListaSERKS_ @ 386 NONAME
- _ZN19QDeclarativePrivate12registerTypeERKNS_12RegisterTypeE @ 387 NONAME
- _ZN19QDeclarativePrivate12registerTypeERKNS_17RegisterInterfaceE @ 388 NONAME
- _ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 389 NONAME
+ _ZN19QDeclarativePrivate12registerTypeERKNS_12RegisterTypeE @ 387 NONAME ABSENT
+ _ZN19QDeclarativePrivate12registerTypeERKNS_17RegisterInterfaceE @ 388 NONAME ABSENT
+ _ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 389 NONAME ABSENT
_ZN19QDeclarativePrivate30qdeclarativeelement_destructorEP7QObject @ 390 NONAME
_ZN19QListModelInterface10itemsMovedEiii @ 391 NONAME
_ZN19QListModelInterface11qt_metacallEN11QMetaObject4CallEiPPv @ 392 NONAME
@@ -1075,7 +1075,7 @@ EXPORTS
_ZNK15QPacketProtocol17maximumPacketSizeEv @ 1074 NONAME
_ZNK16QDeclarativeItem10metaObjectEv @ 1075 NONAME
_ZNK16QDeclarativeItem10parentItemEv @ 1076 NONAME
- _ZNK16QDeclarativeItem10wantsFocusEv @ 1077 NONAME
+ _ZNK16QDeclarativeItem10wantsFocusEv @ 1077 NONAME ABSENT
_ZNK16QDeclarativeItem10widthValidEv @ 1078 NONAME
_ZNK16QDeclarativeItem11heightValidEv @ 1079 NONAME
_ZNK16QDeclarativeItem11mapFromItemERK12QScriptValueff @ 1080 NONAME
@@ -1707,4 +1707,11 @@ EXPORTS
_ZN25QDeclarativeImageProviderC2ENS_9ImageTypeE @ 1706 NONAME
_ZNK25QDeclarativeImageProvider9imageTypeEv @ 1707 NONAME
_ZN23QDeclarativeEngineDebug21resetBindingForObjectEiRK7QString @ 1708 NONAME
+ _ZN16QDeclarativeItem16forceActiveFocusEv @ 1709 NONAME
+ _ZN16QDeclarativeItem18activeFocusChangedEb @ 1710 NONAME
+ _ZNK16QDeclarativeItem14hasActiveFocusEv @ 1711 NONAME
+ _ZNK16QDeclarativeView11rootContextEv @ 1712 NONAME
+ _ZNK16QDeclarativeView6engineEv @ 1713 NONAME
+ _ZNK18QDeclarativeEngine11rootContextEv @ 1714 NONAME
+ _ZN19QDeclarativePrivate11qmlregisterENS_16RegistrationTypeEPv @ 1715 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 580e173..8c11002 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12084,4 +12084,8 @@ EXPORTS
_ZThn24_N13QS60MainAppUi15ProcessCommandLEi @ 12083 NONAME
_ZThn40_N13QS60MainAppUi15MopSupplyObjectE8TTypeUid @ 12084 NONAME
_ZThn92_N13QS60MainAppUi22HandleViewDeactivationERK10TVwsViewIdS2_ @ 12085 NONAME
+ _ZN18QTapAndHoldGesture10setTimeoutEi @ 12086 NONAME
+ _ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME
+ _ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME
+ _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME