Initial commit (project based on widgets)
This commit is contained in:
35
hoverablecombobox.h
Normal file
35
hoverablecombobox.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef HOVERABLECOMBOBOX_H
|
||||
#define HOVERABLECOMBOBOX_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QComboBox>
|
||||
|
||||
class HoverableComboBox : public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
HoverableComboBox(QWidget *parent = nullptr);
|
||||
~HoverableComboBox() override;
|
||||
|
||||
protected:
|
||||
void hidePopup() override
|
||||
{
|
||||
QComboBox::hidePopup();
|
||||
emit closed();
|
||||
}
|
||||
|
||||
void showPopup() override
|
||||
{
|
||||
QComboBox::showPopup();
|
||||
emit opened();
|
||||
}
|
||||
|
||||
signals:
|
||||
void opened();
|
||||
void closed();
|
||||
};
|
||||
|
||||
//HoverableComboBox(QObject *parent) : QComboBox (parent) { }
|
||||
|
||||
#endif // HOVERABLECOMBOBOX_H
|
||||
Reference in New Issue
Block a user