src/hbcore/inputfw/hbinputeditorinterface_p.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
--- a/src/hbcore/inputfw/hbinputeditorinterface_p.cpp	Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbcore/inputfw/hbinputeditorinterface_p.cpp	Fri Sep 17 08:32:10 2010 +0300
@@ -31,6 +31,8 @@
 #include <QLineEdit>
 #include <QTextEdit>
 
+#include "hbwidget.h"
+
 void HbEditorInterfacePrivate::lock()
 {
     mMutex.lock();
@@ -146,7 +148,9 @@
 
         // Check whether the connected object is Hb editor, QLineEdit or QTextEdit,
         // and if yes, connect its cursorPositionChanged() signal to this item's cursorPositionChanged() signal
-        if (editor->inherits("HbAbstractEdit")) {
+        HbWidget *hbWidget = qobject_cast<HbWidget*>(editor);
+        if (hbWidget && (hbWidget->flags() & QGraphicsItem::ItemAcceptsInputMethod)) {
+            // We connect blindly for now without knowing whether it actually implements the signal.
             connect(editor, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int)));
         } else {
             QLineEdit *lineedit = qobject_cast<QLineEdit *>(editor);