summaryrefslogtreecommitdiff
path: root/widgets/LazyFillComboBox.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-11-16 21:54:50 +0100
committerChristoph Berg <myon@debian.org>2020-11-16 21:54:50 +0100
commit77922fa33547ce24535f2e514c9a112dcb496f18 (patch)
tree9f82b0ee01281b315f43a4c60d678927b4c6ca59 /widgets/LazyFillComboBox.hpp
parent7aa3c56b01768ba7d38fccedc17b30a4046b3fbb (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.hpp16
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