diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-07-30 06:59:20 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-07-30 06:59:20 (GMT) |
commit | e74dd280af6ea8d7b30369e02344a473478a9ccc (patch) | |
tree | 4fee911a7dd1efa35330f968cb08adbb8d59a493 /src | |
parent | 136c8210cc98bc6d9b17fd4d517d9d399f30e6c2 (diff) | |
parent | e60b421f357843e0af61ef682a2ebe2ac973ca93 (diff) | |
download | Qt-e74dd280af6ea8d7b30369e02344a473478a9ccc.zip Qt-e74dd280af6ea8d7b30369e02344a473478a9ccc.tar.gz Qt-e74dd280af6ea8d7b30369e02344a473478a9ccc.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.h | 3 | ||||
-rw-r--r-- | src/declarative/fx/qfxkeyproxy.cpp | 12 | ||||
-rw-r--r-- | src/declarative/fx/qfxrepeater.cpp | 11 | ||||
-rw-r--r-- | src/declarative/fx/qfxrepeater.h | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 7eaaf8e..569af43 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -446,8 +446,6 @@ void QFxItem::setParentItem(QFxItem *parent) QObject::setParent(parent); QGraphicsObject::setParentItem(parent); - - parentChanged(parent, oldParent); } /*! @@ -1822,6 +1820,8 @@ QVariant QFxItem::itemChange(GraphicsItemChange change, } else if (change == ItemChildAddedChange || change == ItemChildRemovedChange) { childrenChanged(); + } else if (change == ItemParentHasChanged) { + emit parentChanged(); } return QGraphicsItem::itemChange(change, value); @@ -1846,11 +1846,6 @@ void QFxItem::paintContents(QPainter &) { } -void QFxItem::parentChanged(QFxItem *, QFxItem *) -{ - emit parentChanged(); -} - /*! \enum QFxItem::TransformOrigin @@ -2115,9 +2110,4 @@ void QFxItemPrivate::gvAddMouseFilter() q->installSceneEventFilter(q); } -QVariant QFxItem::inputMethodQuery(Qt::InputMethodQuery query) const -{ - return QGraphicsItem::inputMethodQuery(query); -} - QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index 932d44c..ba3ab4f 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -226,8 +226,6 @@ public: void setFocus(bool); bool hasActiveFocus() const; - QVariant inputMethodQuery(Qt::InputMethodQuery query) const; //### for KeyProxy - Q_SIGNALS: void xChanged(); void yChanged(); @@ -257,7 +255,6 @@ protected: virtual void classBegin(); virtual void componentComplete(); - virtual void parentChanged(QFxItem *, QFxItem *); virtual void focusChanged(bool); virtual void activeFocusChanged(bool); virtual void keyPressEvent(QKeyEvent *event); diff --git a/src/declarative/fx/qfxkeyproxy.cpp b/src/declarative/fx/qfxkeyproxy.cpp index 0a9a151..85ecc39 100644 --- a/src/declarative/fx/qfxkeyproxy.cpp +++ b/src/declarative/fx/qfxkeyproxy.cpp @@ -179,12 +179,20 @@ void QFxKeyProxy::inputMethodEvent(QInputMethodEvent *e) } } -QVariant QFxKeyProxy::inputMethodQuery(Qt::InputMethodQuery query) const +class QFxItemAccessor : public QFxItem { +public: + QVariant doInputMethodQuery(Qt::InputMethodQuery query) const { + return QFxItem::inputMethodQuery(query); + } +}; + +QVariant QFxKeyProxy::inputMethodQuery(Qt::InputMethodQuery query) const +{ for (int ii = 0; ii < d->targets.count(); ++ii) { QFxItem *i = qobject_cast<QFxItem *>(scene()->focusItem(d->targets.at(ii))); if (i && (i->flags() & ItemAcceptsInputMethod) && i == d->imeItem) { //### how robust is i == d->imeItem check? - QVariant v = i->inputMethodQuery(query); + QVariant v = static_cast<QFxItemAccessor*>(i)->doInputMethodQuery(query); if (v.type() == QVariant::RectF) v = mapRectFromItem(i, v.toRectF()); //### cost? return v; diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp index a231f20..8f30324 100644 --- a/src/declarative/fx/qfxrepeater.cpp +++ b/src/declarative/fx/qfxrepeater.cpp @@ -244,10 +244,15 @@ void QFxRepeater::componentComplete() /*! \internal */ -void QFxRepeater::parentChanged(QFxItem *o, QFxItem *n) +QVariant QFxRepeater::itemChange(GraphicsItemChange change, + const QVariant &value) { - QFxItem::parentChanged(o, n); - regenerate(); + QVariant rv = QFxItem::itemChange(change, value); + if (change == ItemParentHasChanged) { + regenerate(); + } + + return rv; } /*! diff --git a/src/declarative/fx/qfxrepeater.h b/src/declarative/fx/qfxrepeater.h index 6f950d3..7fa914e 100644 --- a/src/declarative/fx/qfxrepeater.h +++ b/src/declarative/fx/qfxrepeater.h @@ -73,7 +73,7 @@ private: protected: virtual void componentComplete(); - virtual void parentChanged(QFxItem *, QFxItem *); + QVariant itemChange(GraphicsItemChange change, const QVariant &value); QFxRepeater(QFxRepeaterPrivate &dd, QFxItem *parent); private: |