summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-25 01:21:54 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-25 01:21:54 (GMT)
commit1970d1fb78a300247cd3f14445da481558eef1af (patch)
treeaadda93a7cdfb6b4c707be03a627ee50ab521fa1
parent7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0 (diff)
parent13fd16e67500e77b8cda34de448cb89ca38a5dab (diff)
downloadQt-1970d1fb78a300247cd3f14445da481558eef1af.zip
Qt-1970d1fb78a300247cd3f14445da481558eef1af.tar.gz
Qt-1970d1fb78a300247cd3f14445da481558eef1af.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/fx/qfxitem.cpp19
-rw-r--r--src/declarative/fx/qfxitem.h1
2 files changed, 13 insertions, 7 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index feb4e8c..ed2386b 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -704,7 +704,6 @@ private:
};
static const SigMap sigMap[];
- static QHash<QObject*, QFxKeysAttached*> attachedProperties;
friend class QFxItem;
};
@@ -738,8 +737,6 @@ const QFxKeysAttached::SigMap QFxKeysAttached::sigMap[] = {
{ 0, 0 }
};
-QHash<QObject*, QFxKeysAttached*> QFxKeysAttached::attachedProperties;
-
bool QFxKeysAttachedPrivate::isConnected(const char *signalName)
{
return isSignalConnected(signalIndex(signalName));
@@ -796,10 +793,12 @@ void QFxKeysAttached::keyReleased(QKeyEvent *event)
QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
{
- QFxKeysAttached *rv = attachedProperties.value(obj);
- if (!rv) {
- rv = new QFxKeysAttached(obj);
- attachedProperties.insert(obj, rv);
+ QFxKeysAttached *rv = 0;
+ QFxItem *item = qobject_cast<QFxItem*>(obj);
+ if (item) {
+ rv = item->keyHandler();
+ if (!rv)
+ rv = new QFxKeysAttached(obj);
}
return rv;
}
@@ -1423,6 +1422,12 @@ void QFxItem::geometryChanged(const QRectF &newGeometry,
}
}
+QFxKeysAttached *QFxItem::keyHandler()
+{
+ Q_D(QFxItem);
+ return d->keyHandler;
+}
+
void QFxItem::setKeyHandler(QFxKeysAttached *handler)
{
Q_D(QFxItem);
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index 89c2cf1..222677c 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -197,6 +197,7 @@ private:
QFxAnchorLine verticalCenter() const;
QFxAnchorLine baseline() const;
+ QFxKeysAttached *keyHandler();
void setKeyHandler(QFxKeysAttached *);
friend class QmlStatePrivate;