PDA

View Full Version : How to generate dynamic object



tuxit
17th August 2011, 14:49
Hello,
i tried so far:


Component.onCompleted: {var newObject = Qt.createQmlObject('
import QtQuick 1.0;


Rectangle {

x:20; y:20;
width: 20; height: 20;
color: "blue";

}',
container, "dynamicSnippet1");}


but i am getting Syntax Error : Parse Error.

Where am i wrong?
Thanks

Added after 1 44 minutes:

i found the solution. i must not to split the lines, the string parameter must be one line or must be concat with + operator.