fixed xekboxes

This commit is contained in:
Hane 2023-09-08 18:48:51 +02:00
commit 50789d8176
7 changed files with 74 additions and 54 deletions

View file

@ -58,6 +58,7 @@
*/
enum CustomQEvent {
EndpointWidgetObsolete = 1001,
EndpointDefaultChange = 1002,
};
class EndpointWidgetEvent : public QEvent {
@ -69,18 +70,20 @@ public:
//Q_DECLARE_METATYPE(EndpointWidgetEvent)
class ExtendedCheckBox : public QCheckBox {
Q_OBJECT
Q_OBJECT
protected:
void customEvent(QEvent* ev) override;
public:
//c++11: this inherits all parent's constructors unconditionally
using QCheckBox::QCheckBox;
//alternative being calling parent ctor directly after declaring child ctor:
//B(int x) : A(x) { }
bool event(QEvent* ev) override;
};
class EndpointWidget : public QWidget {
Q_OBJECT
Q_OBJECT
public:
EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *parent = nullptr);
@ -153,8 +156,7 @@ private:
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
QAction *trayIconMenuQuit;
QEvent* changeDefaultCheckboxEnablement;
//public slots:
// void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);