* Adds abstract signals * basic layout and filedialogs * Adds all remaining signal heirarchies * fix lint
27 lines
830 B
C++
27 lines
830 B
C++
#pragma once
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include "QtWidgets/QWidget/qwidget_macro.h"
|
|
#include "core/NodeWidget/nodewidget.h"
|
|
#include "napi.h"
|
|
|
|
class NStackedWidget : public QStackedWidget, public NodeWidget {
|
|
Q_OBJECT
|
|
NODEWIDGET_IMPLEMENTATIONS(QStackedWidget)
|
|
public:
|
|
using QStackedWidget::QStackedWidget; // inherit all constructors of
|
|
// QStackedWidget
|
|
|
|
void connectSignalsToEventEmitter() {
|
|
QWIDGET_SIGNALS
|
|
// Qt Connects: Implement all signal connects here
|
|
QObject::connect(this, &QStackedWidget::currentChanged, [=](int index) {
|
|
Napi::Env env = this->emitOnNode.Env();
|
|
Napi::HandleScope scope(env);
|
|
this->emitOnNode.Call({Napi::String::New(env, "currentChanged"),
|
|
Napi::Value::From(env, index)});
|
|
});
|
|
}
|
|
};
|