summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-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
}