Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
dev
-
None
Description
While trying to add a "native" property to Menu, I came across an error:
import QtQuick import QtQuick.Controls.Material ApplicationWindow { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") Menu { id: menu native: true Action { text: "Cut" } Action { text: "Copy" } Action { text: "Paste" } } TapHandler { onTapped: menu.open() } }
QQmlApplicationEngine failed to load componentqrc:/main.qml:13:9: Expected token `}'
After reading QTBUG-16062 and consequently https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords, I see that it is a reserved word.
However, that bug report was closed without any documentation added, and now we simply have this cryptic error message. We should add the list of reserved words to the docs and produce a more useful error message (which could link to the documentation).
Attachments
Issue Links
- is blocked by
-
QTBUG-118053 Create a failure tolerant QML parser
- Open
- relates to
-
QTBUG-16062 Add list of reserved words not to be used as QML ids
- Open