JS8Call-Improved master
Loading...
Searching...
No Matches
LazyFillComboBox.h
1#ifndef LAZY_FILL_COMBO_BOX_HPP__
2#define LAZY_FILL_COMBO_BOX_HPP__
3
4#include <QComboBox>
5
6class QWidget;
7
8//
9// Class LazyFillComboBox
10//
11// QComboBox derivative that signals show and hide of the pop up list.
12//
13class LazyFillComboBox : public QComboBox {
14 Q_OBJECT
15
16 public:
17 Q_SIGNAL void about_to_show_popup();
18 Q_SIGNAL void popup_hidden();
19
20 explicit LazyFillComboBox(QWidget *parent = nullptr) : QComboBox{parent} {}
21
22 void showPopup() override {
23 Q_EMIT about_to_show_popup();
24 QComboBox::showPopup();
25 }
26
27 void hidePopup() override {
28 QComboBox::hidePopup();
29 Q_EMIT popup_hidden();
30 }
31};
32
33#endif