diff options
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 14 | ||||
-rw-r--r-- | src/widgets/widgets/qcombobox_p.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 1338a496e6..9afb4b3ae6 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -428,6 +428,20 @@ void QComboBoxPrivateContainer::resizeEvent(QResizeEvent *e) QFrame::resizeEvent(e); } +void QComboBoxPrivateContainer::paintEvent(QPaintEvent *e) +{ + QStyleOptionComboBox cbOpt = comboStyleOption(); + if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &cbOpt, combo) + && mask().isEmpty()) { + QStyleOption opt; + opt.initFrom(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_PanelMenu, &opt, &p, this); + } + + QFrame::paintEvent(e); +} + void QComboBoxPrivateContainer::leaveEvent(QEvent *) { // On Mac using the Mac style we want to clear the selection diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index 835bbf866e..3f75a357e4 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -248,6 +248,7 @@ protected: void timerEvent(QTimerEvent *timerEvent) override; void leaveEvent(QEvent *e) override; void resizeEvent(QResizeEvent *e) override; + void paintEvent(QPaintEvent *e) override; QStyleOptionComboBox comboStyleOption() const; Q_SIGNALS: |