From 93608e2e75234a90a3b7f7d2c2e567612c651e0c Mon Sep 17 00:00:00 2001 From: Atul R Date: Sun, 23 Jun 2019 17:56:46 +0200 Subject: [PATCH] Renamed to QKeyEvent --- config/application.gypi | 2 +- demo.ts | 4 ++-- .../QEvent/QKeyEvent/qkeyevent_wrap.cpp} | 2 +- .../QEvent/QKeyEvent/qkeyevent_wrap.h} | 0 src/cpp/main.cpp | 2 +- src/lib/QtGui/QEvent/QKeyEvent/index.ts | 13 +++++++++++++ src/lib/QtGui/QKeyEvent/index.ts | 13 ------------- 7 files changed, 18 insertions(+), 18 deletions(-) rename src/cpp/{core/Events/types/KeyEvent/keyevent_wrap.cpp => QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp} (97%) rename src/cpp/{core/Events/types/KeyEvent/keyevent_wrap.h => QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h} (100%) create mode 100644 src/lib/QtGui/QEvent/QKeyEvent/index.ts delete mode 100644 src/lib/QtGui/QKeyEvent/index.ts diff --git a/config/application.gypi b/config/application.gypi index 489dbdace..e819f124a 100644 --- a/config/application.gypi +++ b/config/application.gypi @@ -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", ], } ] diff --git a/demo.ts b/demo.ts index 8296d46cf..bff1bd63d 100644 --- a/demo.ts +++ b/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); }); diff --git a/src/cpp/core/Events/types/KeyEvent/keyevent_wrap.cpp b/src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp similarity index 97% rename from src/cpp/core/Events/types/KeyEvent/keyevent_wrap.cpp rename to src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp index 2d47e672c..9999549c8 100644 --- a/src/cpp/core/Events/types/KeyEvent/keyevent_wrap.cpp +++ b/src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp @@ -1,4 +1,4 @@ -#include "keyevent_wrap.h" +#include "qkeyevent_wrap.h" #include "src/cpp/Extras/Utils/nutils.h" #include #include "deps/spdlog/spdlog.h" diff --git a/src/cpp/core/Events/types/KeyEvent/keyevent_wrap.h b/src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h similarity index 100% rename from src/cpp/core/Events/types/KeyEvent/keyevent_wrap.h rename to src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h diff --git a/src/cpp/main.cpp b/src/cpp/main.cpp index 3c853c895..26454a1a4 100644 --- a/src/cpp/main.cpp +++ b/src/cpp/main.cpp @@ -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 // These cant be instantiated in JS Side diff --git a/src/lib/QtGui/QEvent/QKeyEvent/index.ts b/src/lib/QtGui/QEvent/QKeyEvent/index.ts new file mode 100644 index 000000000..3966410ec --- /dev/null +++ b/src/lib/QtGui/QEvent/QKeyEvent/index.ts @@ -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(); + }; +} diff --git a/src/lib/QtGui/QKeyEvent/index.ts b/src/lib/QtGui/QKeyEvent/index.ts deleted file mode 100644 index f7771f439..000000000 --- a/src/lib/QtGui/QKeyEvent/index.ts +++ /dev/null @@ -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(); - }; -}