diff options
| author | Christoph Berg <myon@debian.org> | 2020-09-28 23:28:26 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2020-09-28 23:28:26 +0200 |
| commit | c345880e5818351aec994d60cfb9a42351a4a6bd (patch) | |
| tree | 82e554ce75a62e7cca37968ee6e8ce08972eef04 /widgets/LazyFillComboBox.hpp | |
| parent | d55aefc872a0b03ac40c44e8b7d635dc0fa19f4e (diff) | |
| parent | 7aa3c56b01768ba7d38fccedc17b30a4046b3fbb (diff) | |
Update upstream source from tag 'upstream/2.3.0_rc1+repack'
Update to upstream version '2.3.0~rc1+repack'
with Debian dir 278ece20e94e89020b1ea45fb83e61a2cecbb31e
Diffstat (limited to 'widgets/LazyFillComboBox.hpp')
| -rw-r--r-- | widgets/LazyFillComboBox.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp new file mode 100644 index 00000000..7d905267 --- /dev/null +++ b/widgets/LazyFillComboBox.hpp @@ -0,0 +1,40 @@ +#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 final + : public QComboBox +{ + Q_OBJECT + +public: + Q_SIGNAL void about_to_show_popup (); + Q_SIGNAL void popup_hidden (); + + explicit LazyFillComboBox (QWidget * parent = nullptr) + : QComboBox {parent} + { + } + + void showPopup () override + { + Q_EMIT about_to_show_popup (); + QComboBox::showPopup (); + } + + void hidePopup () override + { + QComboBox::hidePopup (); + Q_EMIT popup_hidden (); + } +}; + +#endif |
