summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidget.cpp30
-rw-r--r--src/widgets/kernel/qwidget.h2
-rw-r--r--src/widgets/widgets/qlineedit.cpp6
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp8
-rw-r--r--src/widgets/widgets/qlineedit_p.h2
5 files changed, 13 insertions, 35 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9211a24efd..74db6b5b8f 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -440,29 +440,6 @@ void QWidget::setInputContext(QInputContext *context)
}
-/*!
- \obsolete
-
- This function can be called on the widget that currently has focus
- to reset the input method operating on it.
-
- This function is providing for convenience, instead you should use
- \l{QInputContext::}{reset()} on the input context that was
- returned by inputContext().
-
- \sa QInputContext, inputContext(), QInputContext::reset()
-*/
-void QWidget::resetInputContext()
-{
- if (!hasFocus())
- return;
-#ifndef QT_NO_IM
- QInputContext *qic = this->inputContext();
- if(qic)
- qic->reset();
-#endif // QT_NO_IM
-}
-
#ifdef QT_KEYPAD_NAVIGATION
QPointer<QWidget> QWidgetPrivate::editingWidget;
@@ -8265,13 +8242,6 @@ bool QWidget::event(QEvent *event)
break;
case QEvent::MouseButtonPress:
- // Don't reset input context here. Whether reset or not is
- // a responsibility of input method. reset() will be
- // called by mouseHandler() of input method if necessary
- // via mousePressEvent() of text widgets.
-#if 0
- resetInputContext();
-#endif
mousePressEvent((QMouseEvent*)event);
break;
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 65d5f4701c..91f09db449 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -714,8 +714,6 @@ public:
Qt::InputMethodHints inputMethodHints() const;
void setInputMethodHints(Qt::InputMethodHints hints);
-protected:
- void resetInputContext();
protected Q_SLOTS:
void updateMicroFocus();
protected:
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index aca15f30ed..30f90cd5db 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1342,7 +1342,7 @@ void QLineEdit::insert(const QString &newText)
void QLineEdit::clear()
{
Q_D(QLineEdit);
- resetInputContext();
+ d->resetInputPanel();
d->control->clear();
}
@@ -1355,7 +1355,7 @@ void QLineEdit::clear()
void QLineEdit::undo()
{
Q_D(QLineEdit);
- resetInputContext();
+ d->resetInputPanel();
d->control->undo();
}
@@ -1366,7 +1366,7 @@ void QLineEdit::undo()
void QLineEdit::redo()
{
Q_D(QLineEdit);
- resetInputContext();
+ d->resetInputPanel();
d->control->redo();
}
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 8511d0c9e5..cd7fa13b36 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -239,6 +239,14 @@ void QLineEditPrivate::updatePasswordEchoEditing(bool editing)
q->setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod());
}
+void QLineEditPrivate::resetInputPanel()
+{
+ Q_Q(QLineEdit);
+ if (q->hasFocus() && qApp) {
+ qApp->inputPanel()->reset();
+ }
+}
+
/*!
This function is not intended as polymorphic usage. Just a shared code
fragment that calls QInputContext::mouseHandler for this
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 74717fd2fa..c7d14cbd32 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -101,6 +101,8 @@ public:
void updatePasswordEchoEditing(bool);
+ void resetInputPanel();
+
inline bool shouldEnableInputMethod() const
{
return !control->isReadOnly();