diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /widgets/LazyFillComboBox.hpp | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'widgets/LazyFillComboBox.hpp')
| -rwxr-xr-x | widgets/LazyFillComboBox.hpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp index 7ac828fe..7cff2505 100755 --- a/widgets/LazyFillComboBox.hpp +++ b/widgets/LazyFillComboBox.hpp @@ -1,54 +1,54 @@ -#ifndef LAZY_FILL_COMBO_BOX_HPP__ -#define LAZY_FILL_COMBO_BOX_HPP__ - -#include <QComboBox> - -class QWidget; - -// -// Class LazyFillComboBox -// -// QComboBox derivative that signals show and hide of the pop up list. -// -class LazyFillComboBox - : public QComboBox -{ - Q_OBJECT - -public: - Q_SIGNAL void about_to_show_popup (); - Q_SIGNAL void popup_hidden (); - - explicit LazyFillComboBox (QWidget * parent = nullptr) - : QComboBox {parent} - { - } - -#if QT_VERSION >= QT_VERSION_CHECK (5, 12, 0) - void showPopup () override - { - Q_EMIT about_to_show_popup (); - QComboBox::showPopup (); - } - - void hidePopup () override - { - 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 +#ifndef LAZY_FILL_COMBO_BOX_HPP__
+#define LAZY_FILL_COMBO_BOX_HPP__
+
+#include <QComboBox>
+
+class QWidget;
+
+//
+// Class LazyFillComboBox
+//
+// QComboBox derivative that signals show and hide of the pop up list.
+//
+class LazyFillComboBox
+ : public QComboBox
+{
+ Q_OBJECT
+
+public:
+ Q_SIGNAL void about_to_show_popup ();
+ Q_SIGNAL void popup_hidden ();
+
+ explicit LazyFillComboBox (QWidget * parent = nullptr)
+ : QComboBox {parent}
+ {
+ }
+
+#if QT_VERSION >= QT_VERSION_CHECK (5, 12, 0)
+ void showPopup () override
+ {
+ Q_EMIT about_to_show_popup ();
+ QComboBox::showPopup ();
+ }
+
+ void hidePopup () override
+ {
+ 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
|
