summaryrefslogtreecommitdiff
path: root/widgets/LazyFillComboBox.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-11-16 21:55:31 +0100
committerChristoph Berg <myon@debian.org>2020-11-16 21:55:31 +0100
commit62b7139bfe06fb6555de9a62ee3e62ccfd6e6cf1 (patch)
tree3d9e4579a69060d2767ec2e9153b0ec60f78cb54 /widgets/LazyFillComboBox.hpp
parent8bf7a33f24073bbed51789cb9aaf36ef9126e543 (diff)
parent77922fa33547ce24535f2e514c9a112dcb496f18 (diff)
Update upstream source from tag 'upstream/2.3.0_rc2+repack'
Update to upstream version '2.3.0~rc2+repack' with Debian dir c40ed5d87e465612e7c15c7b67791946a5dcf64c
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