Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 3.1.0
-
None
-
Ie8009846ce27d4acbc3e9ad4dd7dda73fde39413
Description
When I add a property whose name starts with an underscore (e.g. _foo) to a QML file and try to add a signal handler for its changed signal, then the signal handler name suggested by Qt Creator's code completer has the wrong capitalization. In this case it would suggested "onfooChanged" whereas the correct name is "on_FooChanged".
The following file gives no errors in the editor in Qt Creator:
import QtQuick 2.2 import QtQuick.Window 2.1 Window { visible: true width: 360 height: 360 property real __foo: 0.0 on__fooChanged: console.debug("test") }
However, when run it will give the following error: Cannot assign to non-existent property "on__fooChanged"
The following code runs fine with QML:
import QtQuick 2.2 import QtQuick.Window 2.1 Window { visible: true width: 360 height: 360 property real __foo: 0.0 on__FooChanged: console.debug("test") }
But in Qt Creator it gives a red underline for "on__FooChanged" with the error "Invalid property name (M16)".