wip chex still buggy + customEvent

This commit is contained in:
Hane 2023-09-07 21:50:45 +02:00
commit 80327f5bcc
6 changed files with 145 additions and 28 deletions

View file

@ -56,7 +56,17 @@
* ToggleButton(QWidget *parent = nullptr);
* };
*/
enum CustomQEvent {
EndpointWidgetObsolete = 1001,
};
class EndpointWidgetEvent : public QEvent {
Q_OBJECT
public:
EndpointWidgetEvent(QEvent::Type type, int idx);
uint64_t idx;
};
class ExtendedCheckBox : public QCheckBox {
Q_OBJECT
@ -76,6 +86,8 @@ public:
EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *parent = nullptr);
EndpointHandler* getEndpointHandler();
void updateEndpointHandlerFrontInfo(uint64_t index);
void setIndex(uint64_t idx);
uint64_t getIndex();
@ -124,9 +136,11 @@ public:
protected:
void closeEvent(QCloseEvent *event) override;
void customEvent(QEvent* ev) override;
private slots:
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
void removeEndpointWidget(EndpointWidgetEvent* ev);
//TODO: destroy/empty existing EndpointWidgets
//void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);
@ -140,6 +154,7 @@ private:
QMenu *trayIconMenu;
QAction *trayIconMenuQuit;
QEvent* changeDefaultCheckboxEnablement;
//public slots:
// void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);