diff options
| author | Christoph Berg <myon@debian.org> | 2020-11-16 21:54:50 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2020-11-16 21:54:50 +0100 |
| commit | 77922fa33547ce24535f2e514c9a112dcb496f18 (patch) | |
| tree | 9f82b0ee01281b315f43a4c60d678927b4c6ca59 /widgets/LazyFillComboBox.hpp | |
| parent | 7aa3c56b01768ba7d38fccedc17b30a4046b3fbb (diff) | |
New upstream version 2.3.0~rc2+repackupstream/2.3.0_rc2+repack
Diffstat (limited to 'widgets/LazyFillComboBox.hpp')
| -rw-r--r-- | widgets/LazyFillComboBox.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp index 7d905267..7ac828fe 100644 --- a/widgets/LazyFillComboBox.hpp +++ b/widgets/LazyFillComboBox.hpp @@ -10,7 +10,7 @@ class QWidget; // // QComboBox derivative that signals show and hide of the pop up list. // -class LazyFillComboBox final +class LazyFillComboBox : public QComboBox { Q_OBJECT @@ -24,6 +24,7 @@ public: { } +#if QT_VERSION >= QT_VERSION_CHECK (5, 12, 0) void showPopup () override { Q_EMIT about_to_show_popup (); @@ -35,6 +36,19 @@ public: QComboBox::hidePopup (); Q_EMIT popup_hidden (); } +#else + void mousePressEvent (QMouseEvent * e) override + { + Q_EMIT about_to_show_popup (); + QComboBox::mousePressEvent (e); + } + + void mouseReleaseEvent (QMouseEvent * e) override + { + QComboBox::mouseReleaseEvent (e); + Q_EMIT popup_hidden (); + } +#endif }; #endif |
