summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2012-01-02 17:42:00 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-05 11:40:08 +0100
commit8ad583b7f9cd4ab450e636bc2c0626975397aa86 (patch)
treecccc38e417a7e9ffb1f0020456078d6d114b5c7f /src/widgets
parentad22c0c7cff332a77ea527c21e39490c8917b68e (diff)
Removed QApplication::setInputContext()
Obsoleted by platform input context. Setting a custom QInputContext wouldn't work properly anymore. Change-Id: I966573a82fdd7530544878513a655eae7b3ad67b Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp22
-rw-r--r--src/widgets/kernel/qapplication.h1
-rw-r--r--src/widgets/kernel/qapplication_p.h4
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp4
4 files changed, 16 insertions, 15 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index b9a02fa09c..107319cb4f 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -4939,31 +4939,29 @@ int QApplication::keyboardInputInterval()
// Input Method support
// ************************************************************************
-/*!
+/*
This function replaces the QInputContext instance used by the application
with \a inputContext.
Qt takes ownership of the given \a inputContext.
-
- \sa inputContext()
*/
-void QApplication::setInputContext(QInputContext *inputContext)
+void QApplicationPrivate::setInputContext(QInputContext *newInputContext)
{
- if (inputContext == QApplicationPrivate::inputContext)
+ Q_Q(QApplication);
+
+ if (newInputContext == inputContext)
return;
- if (!inputContext) {
- qWarning("QApplication::setInputContext: called with 0 input context");
+ if (!newInputContext) {
+ qWarning("QApplicationPrivate::setInputContext: called with 0 input context");
return;
}
- delete QApplicationPrivate::inputContext;
- QApplicationPrivate::inputContext = inputContext;
- QApplicationPrivate::inputContext->setParent(this);
+ delete inputContext;
+ inputContext = newInputContext;
+ inputContext->setParent(q);
}
/*!
Returns the QInputContext instance used by the application.
-
- \sa setInputContext()
*/
QInputContext *QApplication::inputContext() const
{
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index ee55f7c33f..4347aa3521 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -223,7 +223,6 @@ public:
#endif
#ifndef QT_NO_IM
- void setInputContext(QInputContext *);
QInputContext *inputContext() const;
#endif
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index aacdf32862..574feba001 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -356,6 +356,10 @@ public:
QPoint toolTipPos, toolTipGlobalPos, hoverGlobalPos;
QPointer<QWidget> toolTipWidget;
+#ifndef QT_NO_IM
+ void setInputContext(QInputContext *);
+#endif
+
static QInputContext *inputContext;
static Qt::MouseButtons mouse_buttons;
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 8732a194e8..0bf5e67895 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -383,7 +383,7 @@ QPlatformNativeInterface *QApplication::platformNativeInterface()
return pi->nativeInterface();
}
-void qt_init(QApplicationPrivate *, int type)
+void qt_init(QApplicationPrivate *priv, int type)
{
Q_UNUSED(type);
@@ -393,7 +393,7 @@ void qt_init(QApplicationPrivate *, int type)
qApp->setObjectName(appName);
#ifndef QT_NO_QWS_INPUTMETHODS
- qApp->setInputContext(new QInputContext(qApp));
+ priv->setInputContext(new QInputContext(qApp));
#endif
}