From a2fd884543902629809cc5ba1bbaeced76e5accf Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Sun, 23 Jan 2022 12:05:31 +0100 Subject: [PATCH] Make `QLineEdit.setText()` accept an empty string --- src/lib/QtWidgets/QLineEdit.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/QtWidgets/QLineEdit.ts b/src/lib/QtWidgets/QLineEdit.ts index 60f66a23a..426ba5825 100644 --- a/src/lib/QtWidgets/QLineEdit.ts +++ b/src/lib/QtWidgets/QLineEdit.ts @@ -3,7 +3,7 @@ import { NodeWidget, QWidgetSignals } from './QWidget'; import { NativeElement } from '../core/Component'; /** - + > Create and control editable text field. * **This class is a JS wrapper around Qt's [QLineEdit class](https://doc.qt.io/qt-5/qlineedit.html)** @@ -35,7 +35,10 @@ export class QLineEdit extends NodeWidget { this.setNodeParent(parent); } setText(text: string): void { - text && this.native.setText(text); + if (text == null) { + return; + } + this.native.setText(text); } text(): string { return this.native.text();