Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
Qt Creator 4.15.2
Description
When “Generate signals with …” is enabled ( see QtCreatorbug26184-setting.png )
and right click -> Refactor -> Generate missing Q_PROPERTY member of the following code
Q_PROPERTY(QString name READ name WRITE setname NOTIFY nameChanged)
QtCreator auto-generates
signals:
void nameChanged(const QString &);
This doesn't work if QML slot is like this.
onNameChanged: console.log(name)
and this message is output
qrc:/main.qml:17: ReferenceError: name is not defined
If the slot is like this, it works.
onNameChanged : function(name)
{
console.log("Name changed to", name);
}
But if auto-generated code is like this (add “name” as argument name)
signals:
void nameChanged(const QString &name);
both methods work without a problem.
It'd be nice to have the argument name if this is not intentional.