Give QWidget::updateMicroFocus a parameter with default

This allows for potential optimizations in widgets, e.g. no need to for the
input method to query all data when only the cursor position changed.

Change-Id: Idd1e554acd776ed4d225197ce80915d651ede904
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Volker Hilsheimer 2020-11-16 08:59:05 +01:00
parent dba45c7272
commit 021a8ce5f7
2 changed files with 5 additions and 5 deletions

View File

@ -11473,13 +11473,13 @@ void QWidget::setShortcutAutoRepeat(int id, bool enable)
#endif // QT_NO_SHORTCUT
/*!
Updates the widget's micro focus.
Updates the widget's micro focus and informs input methods
that the state specified by \a query has changed.
*/
void QWidget::updateMicroFocus()
void QWidget::updateMicroFocus(Qt::InputMethodQuery query)
{
// updating everything since this is currently called for any kind of state change
if (this == QGuiApplication::focusObject())
QGuiApplication::inputMethod()->update(Qt::ImQueryAll);
QGuiApplication::inputMethod()->update(query);
}
/*!

View File

@ -667,7 +667,7 @@ public:
void setInputMethodHints(Qt::InputMethodHints hints);
protected Q_SLOTS:
void updateMicroFocus();
void updateMicroFocus(Qt::InputMethodQuery query = Qt::ImQueryAll);
protected:
void create(WId = 0, bool initializeWindow = true,