diff options
| author | tony mancill <tmancill@debian.org> | 2026-04-12 08:46:47 -0700 |
|---|---|---|
| committer | tony mancill <tmancill@debian.org> | 2026-04-12 08:46:47 -0700 |
| commit | cd2dad3bc7ae0ee0a18b7b20a945009362ec3851 (patch) | |
| tree | 5a622ec4193e9bc899f6499f936848a661be29cb /widgets/LazyFillComboBox.hpp | |
| parent | 558c0b9d6ecf70c5222e2069ece1fea3656c75d7 (diff) | |
| parent | 291b3817bf0c7a742e9e17d42c94fc8c9530e40d (diff) | |
Merge branch 'debian/latest' into debian/trixie-backports
Diffstat (limited to 'widgets/LazyFillComboBox.hpp')
| -rw-r--r--[-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 7cff2505..7ac828fe 100755..100644 --- 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 |
