From adcb0219414272d4c7ab823f1634f07a3342cd25 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 20 Oct 2020 02:21:08 +0100 Subject: [PATCH] Compatibility with older Qt versions --- widgets/LazyFillComboBox.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp index 7d9052673..37af60f0b 100644 --- a/widgets/LazyFillComboBox.hpp +++ b/widgets/LazyFillComboBox.hpp @@ -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