C++ code lint fixes

This commit is contained in:
Simon Edwards 2022-12-26 13:20:35 +01:00
parent d4c443607e
commit 33c0b24731
2 changed files with 32 additions and 37 deletions

View File

@ -15,34 +15,30 @@ class DLL_EXPORT NButtonGroup : public QButtonGroup, public EventWidget {
virtual void connectSignalsToEventEmitter() {
QOBJECT_SIGNALS
// Qt Connects: Implement all signal connects here
connect(this, &QButtonGroup::idClicked,
[=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "idClicked"),
Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idPressed,
[=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "idPressed"),
Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idReleased,
[=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "idReleased"),
Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idToggled,
[=](int id, bool checked) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "idToggled"),
Napi::Number::New(env, id),
Napi::Boolean::New(env, checked)});
});
connect(this, &QButtonGroup::idClicked, [=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call(
{Napi::String::New(env, "idClicked"), Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idPressed, [=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call(
{Napi::String::New(env, "idPressed"), Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idReleased, [=](int id) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call(
{Napi::String::New(env, "idReleased"), Napi::Number::New(env, id)});
});
connect(this, &QButtonGroup::idToggled, [=](int id, bool checked) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "idToggled"),
Napi::Number::New(env, id),
Napi::Boolean::New(env, checked)});
});
}
};

View File

@ -38,14 +38,13 @@ class DLL_EXPORT NTextBrowser : public QTextBrowser, public NodeWidget {
this->emitOnNode.Call({Napi::String::New(env, "forwardAvailable"),
Napi::Boolean::New(env, available)});
});
QObject::connect(
this, &QTextBrowser::highlighted,
[=](const QUrl& link) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call({Napi::String::New(env, "highlighted"),
Napi::String::New(env, link.toString().toStdString())});
});
QObject::connect(this, &QTextBrowser::highlighted, [=](const QUrl& link) {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);
this->emitOnNode.Call(
{Napi::String::New(env, "highlighted"),
Napi::String::New(env, link.toString().toStdString())});
});
QObject::connect(this, &QTextBrowser::historyChanged, [=]() {
Napi::Env env = this->emitOnNode.Env();
Napi::HandleScope scope(env);