From 326cc83e3677cefe230d813a89ea55cd56fc22bf Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 30 Jul 2009 09:47:56 +1000 Subject: Partially revert ef0f2901d4055bf53ac2bebb7fe2d5681900db19. Accessor method for inputMethodQuery was causing crashes. --- src/declarative/fx/qfxitem.cpp | 5 +++++ src/declarative/fx/qfxitem.h | 2 ++ src/declarative/fx/qfxkeyproxy.cpp | 9 +-------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index d88b3af..4e66f55 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -2168,4 +2168,9 @@ 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 36845a2..cd346a7 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -239,6 +239,8 @@ public: bool hasActiveFocus() const; + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; //### for KeyProxy + public Q_SLOTS: void newChild(const QString &url); diff --git a/src/declarative/fx/qfxkeyproxy.cpp b/src/declarative/fx/qfxkeyproxy.cpp index 968ff09..13f4bfb 100644 --- a/src/declarative/fx/qfxkeyproxy.cpp +++ b/src/declarative/fx/qfxkeyproxy.cpp @@ -181,17 +181,10 @@ void QFxKeyProxy::inputMethodEvent(QInputMethodEvent *e) QVariant QFxKeyProxy::inputMethodQuery(Qt::InputMethodQuery query) const { - struct QFxItemAccessor : public QFxItem { - public: - QVariant inputMethodQuery(Qt::InputMethodQuery query) const { - return QGraphicsItem::inputMethodQuery(query); - } - }; - for (int ii = 0; ii < d->targets.count(); ++ii) { QFxItem *i = qobject_cast(scene()->focusItem(d->targets.at(ii))); if (i && (i->options() & AcceptsInputMethods) && i == d->imeItem) { //### how robust is i == d->imeItem check? - QVariant v = ((QFxItemAccessor*)i)->inputMethodQuery(query); + QVariant v = i->inputMethodQuery(query); if (v.type() == QVariant::RectF) v = mapRectFromItem(i, v.toRectF()); //### cost? return v; -- cgit v0.12