Remove NodeTextEdit, use QTextEdit
This commit is contained in:
parent
23759b1aaa
commit
fda93e9dd5
@ -2,7 +2,7 @@ import addon from '../utils/addon';
|
||||
import { QWidget } from './QWidget';
|
||||
import { NativeElement } from '../core/Component';
|
||||
import { QUrl } from '../QtCore/QUrl';
|
||||
import { NodeTextEdit, QTextEditSignals } from './QTextEdit';
|
||||
import { QTextEdit, QTextEditSignals } from './QTextEdit';
|
||||
|
||||
/**
|
||||
|
||||
@ -21,7 +21,7 @@ const textBrowser = new QTextBrowser();
|
||||
```
|
||||
|
||||
*/
|
||||
export class QTextBrowser extends NodeTextEdit<QTextBrowserSignals> {
|
||||
export class QTextBrowser extends QTextEdit<QTextBrowserSignals> {
|
||||
constructor(parent?: QWidget) {
|
||||
let native: NativeElement;
|
||||
if (parent) {
|
||||
|
||||
@ -4,6 +4,8 @@ import { QAbstractScrollArea, QAbstractScrollAreaSignals } from './QAbstractScro
|
||||
import { AlignmentFlag, TextInteractionFlag } from '../QtEnums';
|
||||
import { QFont } from '../QtGui/QFont';
|
||||
import { QColor } from '../QtGui/QColor';
|
||||
import { checkIfNativeElement } from '../utils/helpers';
|
||||
import { NativeElement } from '../core/Component';
|
||||
|
||||
/**
|
||||
|
||||
@ -22,7 +24,22 @@ const textEdit = new QTextEdit();
|
||||
```
|
||||
|
||||
*/
|
||||
export abstract class NodeTextEdit<Signals extends QTextEditSignals> extends QAbstractScrollArea<Signals> {
|
||||
export class QTextEdit<Signals extends QTextEditSignals = QTextEditSignals> extends QAbstractScrollArea<Signals> {
|
||||
constructor(arg?: QWidget | NativeElement) {
|
||||
let native: NativeElement;
|
||||
let parent: QWidget = null;
|
||||
if (checkIfNativeElement(arg)) {
|
||||
native = arg as NativeElement;
|
||||
} else if (arg) {
|
||||
parent = arg as QWidget;
|
||||
native = new addon.QTextEdit(parent.native);
|
||||
} else {
|
||||
native = new addon.QTextEdit();
|
||||
}
|
||||
super(native);
|
||||
parent && this.setNodeParent(parent);
|
||||
}
|
||||
|
||||
setAcceptRichText(accept: boolean): void {
|
||||
this.setProperty('acceptRichText', accept);
|
||||
}
|
||||
@ -238,19 +255,6 @@ export enum WrapMode {
|
||||
WrapAtWordBoundaryOrAnywhere,
|
||||
}
|
||||
|
||||
export class QTextEdit extends NodeTextEdit<QTextEditSignals> {
|
||||
constructor(parent?: QWidget) {
|
||||
let native;
|
||||
if (parent) {
|
||||
native = new addon.QTextEdit(parent.native);
|
||||
} else {
|
||||
native = new addon.QTextEdit();
|
||||
}
|
||||
super(native);
|
||||
parent && this.setNodeParent(parent);
|
||||
}
|
||||
}
|
||||
|
||||
export interface QTextEditSignals extends QAbstractScrollAreaSignals {
|
||||
copyAvailable: (yes: boolean) => void;
|
||||
cursorPositionChanged: () => void;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user