Details
-
Suggestion
-
Resolution: Duplicate
-
P2: Important
-
6.8
-
None
Description
Accessing a property member in QML with the "this." prefix causes the QML language server to emit a warning similar to the following:
Member "hoverColor" not found on type "QObject" [missing-property]
It seems that the qmlls always treats "this" as a QObject instead of resolving it's actual type. It can be useful to use "this.<propertyName>" as it removes all ambiguity as to where the property should resolve from while being id agnostic so that if code needs to be copied to somewhere else there is no need to refactor all the ids. It is also a familliar pattern for python devs.
It's possible to work around the issue using a direct cast but that is very verbose.
Would it be possible for the qmlls to handle this case?
Attachments
Issue Links
- duplicates
-
QTBUG-128805 qmllint always deduces type of "this" to be "QObject"
- Closed