wip remove epw now working, xekboxs still funky

This commit is contained in:
Hane 2023-09-07 22:51:55 +02:00
commit 6744a64fce
3 changed files with 8 additions and 7 deletions

View file

@ -182,7 +182,7 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
} }
void MainWindow::customEvent(QEvent* ev) { void MainWindow::customEvent(QEvent* ev) {
if (ev->type() == (QEvent::Type)CustomQEvent::EndpointWidgetObsolete) { if (ev->type() == CustomQEvent::EndpointWidgetObsolete) {
this->removeEndpointWidget((EndpointWidgetEvent*)ev); this->removeEndpointWidget((EndpointWidgetEvent*)ev);
return; return;
} }
@ -347,9 +347,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
}); });
osh->setRemoveEndpointWidgetFunction([this](uint64_t index) { osh->setRemoveEndpointWidgetFunction([this](uint64_t index) {
EndpointWidgetEvent removeObsoleteEndpointWidget((QEvent::Type)CustomQEvent::EndpointWidgetObsolete, index); EndpointWidgetEvent* removeObsoleteEndpointWidget = new EndpointWidgetEvent((QEvent::Type)CustomQEvent::EndpointWidgetObsolete, index);
removeObsoleteEndpointWidget.setAccepted(true); removeObsoleteEndpointWidget->setAccepted(true);
QCoreApplication::instance()->postEvent(this, &removeObsoleteEndpointWidget); QCoreApplication::instance()->postEvent(this, removeObsoleteEndpointWidget);
}); });
/* /*

View file

@ -61,12 +61,12 @@ enum CustomQEvent {
}; };
class EndpointWidgetEvent : public QEvent { class EndpointWidgetEvent : public QEvent {
Q_OBJECT
public: public:
EndpointWidgetEvent(QEvent::Type type, int idx); EndpointWidgetEvent(QEvent::Type type, int idx);
uint64_t idx; uint64_t idx;
}; };
//Q_DECLARE_METATYPE(EndpointWidgetEvent)
class ExtendedCheckBox : public QCheckBox { class ExtendedCheckBox : public QCheckBox {
Q_OBJECT Q_OBJECT

View file

@ -45,6 +45,7 @@ int main (int argc, char* argv[]) {
else exit(0); else exit(0);
osh = new OverseerHandler(); osh = new OverseerHandler();
//qRegisterMetaType<EndpointWidgetEvent>();
//INIT CONT //INIT CONT
log_debugcpp("main init"); log_debugcpp("main init");