From 7aa3c56b01768ba7d38fccedc17b30a4046b3fbb Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 28 Sep 2020 23:28:13 +0200 Subject: New upstream version 2.3.0~rc1+repack --- widgets/LazyFillComboBox.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 widgets/LazyFillComboBox.hpp (limited to 'widgets/LazyFillComboBox.hpp') 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 + +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 -- cgit v1.2.3