-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.3
-
None
-
Qt SDK, latest docs
-
a8fdea9460ffd4814240543b0fd340aee593db85
At http://doc.trolltech.com/latest/qml-qt.html#createQmlObject-method we're told that
If filepath is specified, it will be used for error reporting for the created object. Example (where parentItem is the id of an existing QML item): var newObject = Qt.createQmlObject('import QtQuick 1.0; Rectangle {color: "red"; width: 20; height: 20}', parentItem, "dynamicSnippet1") In the case of an error, a QtScript Error object is thrown. This object has an additional property, qmlErrors, which is an array of the errors encountered. Each object in this array has the members lineNumber, columnNumber, fileName and message.
So:
- filepath is optional? If so, what is its default value?
- we're told what parentItem is but we have no context info for "dynamicSnippet1"
- in case of error, we could guess that the error objects will contain filepath as the fileName, but if so, where are the lineNumber, columnNumber and message coming from? And what is the connection between all these and the string containing the QML object to be created?