From 7c086fb9c7fc06e60a3b85a97c8f68475229e321 Mon Sep 17 00:00:00 2001 From: Atul R Date: Sun, 1 Sep 2019 00:20:19 +0200 Subject: [PATCH] Re orders and marks things which have been implemented in react aswell --- src/index.ts | 14 +++++--- src/lib/QtWidgets/QAbstractSlider/index.ts | 21 ++++++------ src/lib/QtWidgets/QDial/index.ts | 22 ++++++++----- src/lib/QtWidgets/QSpinBox/index.ts | 38 +++++++++++++--------- 4 files changed, 56 insertions(+), 39 deletions(-) diff --git a/src/index.ts b/src/index.ts index 37e86a29f..2b5734886 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,20 @@ -// enums +// Enums: export * from "./lib/QtEnums"; +// Gui: export { QApplication } from "./lib/QtGui/QApplication"; -export { QWidget, QWidgetEvents } from "./lib/QtWidgets/QWidget"; export { QPixmap } from "./lib/QtGui/QPixmap"; export { QIcon } from "./lib/QtGui/QIcon"; export { QCursor } from "./lib/QtGui/QCursor"; +// Events: Maybe a separate module ? +export { QKeyEvent } from "./lib/QtGui/QEvent/QKeyEvent"; +export { NativeEvent } from "./lib/core/EventWidget"; // Abstract: export { NodeWidget } from "./lib/QtWidgets/QWidget"; export { NodeLayout } from "./lib/QtWidgets/QLayout"; +export { QAbstractScrollArea } from "./lib/QtWidgets/QAbstractScrollArea"; +export { QAbstractSlider } from "./lib/QtWidgets/QAbstractSlider"; // Widgets: +export { QWidget, QWidgetEvents } from "./lib/QtWidgets/QWidget"; export { QCheckBox, QCheckBoxEvents } from "./lib/QtWidgets/QCheckBox"; export { QLabel, QLabelEvents } from "./lib/QtWidgets/QLabel"; export { QDial, QDialEvents } from "./lib/QtWidgets/QDial"; @@ -26,7 +32,5 @@ export { QScrollArea, QScrollAreaEvents } from "./lib/QtWidgets/QScrollArea"; // Layouts: export { QGridLayout } from "./lib/QtWidgets/QGridLayout"; export { FlexLayout } from "./lib/core/FlexLayout"; -// Events : Maybe a separate module ? -export { QKeyEvent } from "./lib/QtGui/QEvent/QKeyEvent"; -export { NativeEvent } from "./lib/core/EventWidget"; +// Others: export { StyleSheet } from "./lib/core/Style/StyleSheet"; diff --git a/src/lib/QtWidgets/QAbstractSlider/index.ts b/src/lib/QtWidgets/QAbstractSlider/index.ts index ac587dbe9..4b768f115 100644 --- a/src/lib/QtWidgets/QAbstractSlider/index.ts +++ b/src/lib/QtWidgets/QAbstractSlider/index.ts @@ -1,4 +1,4 @@ -import { NodeWidget, QWidget } from "../QWidget"; +import { NodeWidget } from "../QWidget"; import { Orientation } from "../../QtEnums"; export abstract class QAbstractSlider extends NodeWidget { @@ -8,23 +8,22 @@ export abstract class QAbstractSlider extends NodeWidget { setMaximum(maximum: number) { this.native.setMaximum(maximum); } - setMinimum(minimum: number) { - this.native.setMinimum(minimum); - } - setValue(value: number) { - this.native.setValue(value); - } - setOrientation(orientation: Orientation) { - this.native.setOrientation(orientation); - } - maximum(): number { return this.native.maximum(); } + setMinimum(minimum: number) { + this.native.setMinimum(minimum); + } minimum(): number { return this.native.minimum(); } + setValue(value: number) { + this.native.setValue(value); + } value(): number { return this.native.value(); } + setOrientation(orientation: Orientation) { + this.native.setOrientation(orientation); + } } diff --git a/src/lib/QtWidgets/QDial/index.ts b/src/lib/QtWidgets/QDial/index.ts index a66f7c608..dac398cfe 100644 --- a/src/lib/QtWidgets/QDial/index.ts +++ b/src/lib/QtWidgets/QDial/index.ts @@ -26,28 +26,34 @@ export class QDial extends QAbstractSlider { this.parent = parent; // bind member functions this.setNotchesVisible.bind(this); + this.notchesVisible.bind(this); this.setWrapping.bind(this); + this.wrapping.bind(this); this.setNotchTarget.bind(this); this.notchTarget.bind(this); - this.notchesVisible.bind(this); - this.wrapping.bind(this); } setNotchesVisible(visible: boolean) { + // react:✓ this.native.setNotchesVisible(visible); } + notchesVisible(): boolean { + // react:✓ + return this.native.notchesVisible(); + } setWrapping(on: boolean) { + // react:✓ this.native.setWrapping(on); } + wrapping(): boolean { + // react:✓ + return this.native.wrapping(); + } setNotchTarget(target: number) { + // react:✓ this.native.setNotchTarget(target); } notchTarget(): number { + // react:✓ return this.native.notchTarget(); } - notchesVisible(): boolean { - return this.native.notchesVisible(); - } - wrapping(): boolean { - return this.native.wrapping(); - } } diff --git a/src/lib/QtWidgets/QSpinBox/index.ts b/src/lib/QtWidgets/QSpinBox/index.ts index e4fafe711..76f9a04e2 100644 --- a/src/lib/QtWidgets/QSpinBox/index.ts +++ b/src/lib/QtWidgets/QSpinBox/index.ts @@ -23,41 +23,49 @@ export class QSpinBox extends NodeWidget { this.native = native; // bind member functions this.setPrefix.bind(this); - this.setSingleStep.bind(this); this.setSuffix.bind(this); - this.setRange.bind(this); - this.setValue.bind(this); this.cleanText.bind(this); + this.setSingleStep.bind(this); + this.setRange.bind(this); this.maximum.bind(this); this.minimum.bind(this); + this.setValue.bind(this); this.value.bind(this); } - setPrefix(prefix: string) { - this.native.setPrefix(`${prefix}`); - } - setSingleStep(val: number) { - this.native.setSingleStep(val); + // react:✓ + this.native.setPrefix(prefix); } setSuffix(suffix: string) { - this.native.setSuffix(`${suffix}`); - } - setRange(minimum: number, maximum: number) { - this.native.setRange(minimum, maximum); - } - setValue(val: number) { - this.native.setValue(val); + // react:✓ + this.native.setSuffix(suffix); } cleanText(): string { + // react:✓ return this.native.cleanText(); } + setSingleStep(val: number) { + // react:✓ + this.native.setSingleStep(val); + } + setRange(minimum: number, maximum: number) { + // react:✓ + this.native.setRange(minimum, maximum); + } maximum(): number { + // react:✓ return this.native.maximum(); } minimum(): number { + // react:✓ return this.native.minimum(); } + setValue(val: number) { + // react:✓ + this.native.setValue(val); + } value(): number { + // react:✓ return this.native.value(); } }