Renamed to QKeyEvent

This commit is contained in:
Atul R 2019-06-23 17:56:46 +02:00
parent e15d6b14ac
commit 93608e2e75
7 changed files with 18 additions and 18 deletions

View File

@ -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",
],
}
]

View File

@ -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);
});

View File

@ -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"

View File

@ -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

View 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();
};
}

View File

@ -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();
};
}