Remove internal uses of Software input panel events.
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>
Thu, 8 Sep 2011 10:45:43 +0000 (13:45 +0300)
committerLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 13:21:34 +0000 (15:21 +0200)
Replaced with QInputPanel method calls. Only remaining instance in
QApplication::notify().

Change-Id: I384661f81d08b4322ce538bb21dbce9c7aef2f87
Reviewed-on: http://codereview.qt-project.org/4454
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/widgets/kernel/qapplication.cpp
src/widgets/kernel/qwidget_p.h
src/widgets/statemachine/qguistatemachine.cpp

index 25c0e7f..ff3fd89 100644 (file)
@@ -2098,16 +2098,6 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
                         prev->setEditFocus(false);
                 }
 #endif
-#ifndef QT_NO_IM
-                if (focus) {
-                    QInputContext *prevIc;
-                    prevIc = prev->inputContext();
-                    if (prevIc && prevIc != focus->inputContext()) {
-                        QEvent closeSIPEvent(QEvent::CloseSoftwareInputPanel);
-                        QApplication::sendEvent(prev, &closeSIPEvent);
-                    }
-                }
-#endif
                 QFocusEvent out(QEvent::FocusOut, reason);
                 QPointer<QWidget> that = prev;
                 QApplication::sendEvent(prev, &out);
index 7c74f79..6e1568e 100644 (file)
@@ -59,6 +59,7 @@
 #include "QtCore/qlocale.h"
 #include "QtCore/qset.h"
 #include "QtGui/qregion.h"
+#include "QtGui/qinputpanel.h"
 #include "QtWidgets/qsizepolicy.h"
 #include "QtWidgets/qstyle.h"
 #include "QtWidgets/qapplication.h"
@@ -663,8 +664,7 @@ public:
             QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
                     q->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
             if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
-                QEvent event(QEvent::RequestSoftwareInputPanel);
-                QApplication::sendEvent(q, &event);
+                qApp->inputPanel()->show();
             }
         }
     }
index 665f7ac..7a498eb 100644 (file)
@@ -456,10 +456,6 @@ static QEvent *cloneEvent(QEvent *e)
         break;
 #endif
 
-    case QEvent::RequestSoftwareInputPanel:
-    case QEvent::CloseSoftwareInputPanel:
-        return new QEvent(*e);
-
     case QEvent::UpdateSoftKeys:
         return new QEvent(*e);