Renamed to QKeyEvent
This commit is contained in:
parent
e15d6b14ac
commit
93608e2e75
@ -19,6 +19,7 @@
|
||||
# wrapped cpps
|
||||
"../src/cpp/QtGui/QApplication/qapplication_wrap.cpp",
|
||||
"../src/cpp/QtGui/QWidget/qwidget_wrap.cpp",
|
||||
"../src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp",
|
||||
'../src/cpp/core/FlexLayout/flexlayout_wrap.cpp',
|
||||
"../src/cpp/QtWidgets/QGridLayout/qgridlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp",
|
||||
@ -29,7 +30,6 @@
|
||||
"../src/cpp/QtWidgets/QProgressBar/qprogressbar_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QRadioButton/qradiobutton_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLineEdit/qlineedit_wrap.cpp",
|
||||
"../src/cpp/core/Events/types/KeyEvent/keyevent_wrap.cpp",
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
4
demo.ts
4
demo.ts
@ -11,7 +11,7 @@ import { QProgressBar } from "./src/lib/QtWidgets/QProgressBar";
|
||||
import { QRadioButton } from "./src/lib/QtWidgets/QRadioButton";
|
||||
import { QLineEdit } from "./src/lib/QtWidgets/QLineEdit";
|
||||
import { FlexLayout } from "./src/lib/core/FlexLayout";
|
||||
import { KeyEvent } from "./src/lib/QtGui/QKeyEvent";
|
||||
import { QKeyEvent } from "./src/lib/QtGui/QEvent/QKeyEvent";
|
||||
|
||||
// Test all widgets in this one. This works as of now!
|
||||
const testGridLayout = () => {
|
||||
@ -72,7 +72,7 @@ const testFlexLayout = () => {
|
||||
|
||||
const win = new QMainWindow();
|
||||
win.addEventListener("KeyPress", nativeEvent => {
|
||||
const evt = new KeyEvent(nativeEvent);
|
||||
const evt = new QKeyEvent(nativeEvent);
|
||||
console.log(evt.text());
|
||||
console.log("KeyPress", evt);
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "keyevent_wrap.h"
|
||||
#include "qkeyevent_wrap.h"
|
||||
#include "src/cpp/Extras/Utils/nutils.h"
|
||||
#include <QString>
|
||||
#include "deps/spdlog/spdlog.h"
|
||||
@ -10,7 +10,7 @@
|
||||
#include "src/cpp/QtWidgets/QRadioButton/qradiobutton_wrap.h"
|
||||
#include "src/cpp/QtWidgets/QLineEdit/qlineedit_wrap.h"
|
||||
#include "src/cpp/core/FlexLayout/flexlayout_wrap.h"
|
||||
#include "src/cpp/core/Events/types/KeyEvent/keyevent_wrap.h"
|
||||
#include "src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h"
|
||||
#include <napi.h>
|
||||
|
||||
// These cant be instantiated in JS Side
|
||||
|
||||
13
src/lib/QtGui/QEvent/QKeyEvent/index.ts
Normal file
13
src/lib/QtGui/QEvent/QKeyEvent/index.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import addon from "../../../core/addon";
|
||||
import { NativeElement } from "../../../core/Component";
|
||||
import { NativeEvent } from "../../../core/EventWidget";
|
||||
|
||||
export class QKeyEvent {
|
||||
native: NativeElement;
|
||||
constructor(event: NativeEvent) {
|
||||
this.native = new addon.QKeyEvent(event);
|
||||
}
|
||||
text = (): string => {
|
||||
return this.native.text();
|
||||
};
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import addon from "../../core/addon";
|
||||
import { NativeElement } from "../../core/Component";
|
||||
import { NativeEvent } from "../../core/EventWidget";
|
||||
|
||||
export class KeyEvent {
|
||||
native: NativeElement;
|
||||
constructor(event: NativeEvent) {
|
||||
this.native = new addon.QKeyEvent(event);
|
||||
}
|
||||
text = (): string => {
|
||||
return this.native.text();
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user