How can I use signals and slots in QCAD scripts, for example to detect if the text in a line edit has changed?
Signals and Slots in ECMAScript
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Signals and Slots in ECMAScript
From a QCAD user:
Re: Signals and Slots in ECMAScript
Example:
See also:
http://doc.qt.io/archives/qt-4.8/scripting.html
Code: Select all
var le = new QLineEdit();
...
// call this.validate() on text changes:
le.textChanged.connect(this, "validate");
// call an inline function on text changes:
le.textChanged.connect(this, function(text) { qDebug("text is now: " + text); });
http://doc.qt.io/archives/qt-4.8/scripting.html
Re: Signals and Slots in ECMAScript
How can I detect the sender? Object.sender() does not exist.
Arch Linux, QCad 3.22.0 Prof.