diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-02-11 09:47:12 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-03-05 07:52:21 +0100 |
commit | 814682bb9a5c9ccaff30662dd757cd827f39aad0 (patch) | |
tree | d956947d620da0bded609556bd577157f33078b3 /src | |
parent | 20c35f9a2b5fd970d43efc98c324e1e4c9dd153d (diff) |
Update the current text after a translator is installed
This ensures that if the model is updated due to a retranslate
that it gets the updated string and the ComboBox shows it
correctly.
Change-Id: Iecbc18a1051d6db13035b3efa393d9bf97788dd9
Fixes: QTBUG-82020
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcombobox_p.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index 5f3f1cfc..d9bbd2bd 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -1865,6 +1865,14 @@ void QQuickComboBox::wheelEvent(QWheelEvent *event) } #endif +bool QQuickComboBox::event(QEvent *e) +{ + Q_D(QQuickComboBox); + if (e->type() == QEvent::LanguageChange) + d->updateCurrentText(); + return QQuickControl::event(e); +} + void QQuickComboBox::componentComplete() { Q_D(QQuickComboBox); diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h index b52d7545..282f3d23 100644 --- a/src/quicktemplates2/qquickcombobox_p.h +++ b/src/quicktemplates2/qquickcombobox_p.h @@ -227,6 +227,7 @@ protected: #if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) override; #endif + bool event(QEvent *e) override; void componentComplete() override; void itemChange(ItemChange change, const ItemChangeData &value) override; |