diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2020-01-26 14:21:42 +0800 |
---|---|---|
committer | Wang Chuan <ouchuanm@outlook.com> | 2020-02-07 09:18:47 +0800 |
commit | 75285b64ada65748f1fee3942a95b46a3f0b9d7e (patch) | |
tree | 5e6fdf80a616ad2a64c05890c53033d6823b81c9 /src/widgets/widgets/qcombobox.cpp | |
parent | f9cd8fef5e9062f6bd23d70693f4dfb7e32efc78 (diff) |
QComboBox: send font change event to popup menu when font changed
The font change in QComboBox might cause incorrect appearance of popup
menu since it doesn't notify popup menu to relayout itself
Fixes the issue by send font change event to the item view of popup
menu when received a font change event in QComboBox
Fixes: QTBUG-75846
Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 9a0e969e1c..fdf1a87bba 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3045,12 +3045,14 @@ void QComboBox::changeEvent(QEvent *e) d->updateViewContainerPaletteAndOpacity(); break; } - case QEvent::FontChange: + case QEvent::FontChange: { d->sizeHint = QSize(); // invalidate size hint d->viewContainer()->setFont(font()); + d->viewContainer()->itemView()->doItemsLayout(); if (d->lineEdit) d->updateLineEditGeometry(); break; + } default: break; } |