Add applicationDisplayNameChanged & lastWindowClosed signals to QApplication
This commit is contained in:
parent
3a04d14872
commit
4e42f61faa
@ -18,6 +18,14 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::applicationDisplayNameChanged, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "applicationDisplayNameChanged")});
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
this, &QGuiApplication::focusWindowChanged, [=](QWindow* focusWindow) {
|
this, &QGuiApplication::focusWindowChanged, [=](QWindow* focusWindow) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
@ -25,6 +33,12 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
this->emitOnNode.Call({Napi::String::New(env, "focusWindowChanged")});
|
this->emitOnNode.Call({Napi::String::New(env, "focusWindowChanged")});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QObject::connect(this, &QGuiApplication::lastWindowClosed, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "lastWindowClosed")});
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
|||||||
@ -105,7 +105,9 @@ export class QApplication extends QObject<QApplicationSignals> {
|
|||||||
wrapperCache.registerWrapper('QApplicationWrap', QApplication);
|
wrapperCache.registerWrapper('QApplicationWrap', QApplication);
|
||||||
|
|
||||||
export interface QApplicationSignals extends QObjectSignals {
|
export interface QApplicationSignals extends QObjectSignals {
|
||||||
|
applicationDisplayNameChanged: () => void;
|
||||||
focusWindowChanged: () => void;
|
focusWindowChanged: () => void;
|
||||||
|
lastWindowClosed: () => void;
|
||||||
primaryScreenChanged: (screen: QScreen) => void;
|
primaryScreenChanged: (screen: QScreen) => void;
|
||||||
screenAdded: (screen: QScreen) => void;
|
screenAdded: (screen: QScreen) => void;
|
||||||
screenRemoved: (screen: QScreen) => void;
|
screenRemoved: (screen: QScreen) => void;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user