Results 1 to 1 of 1

Thread: How to generate dynamic object

  1. #1
    Join Date
    Jul 2011
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to generate dynamic object

    Hello,
    i tried so far:

    Qt Code:
    1. Component.onCompleted: {var newObject = Qt.createQmlObject('
    2. import QtQuick 1.0;
    3.  
    4.  
    5. Rectangle {
    6.  
    7. x:20; y:20;
    8. width: 20; height: 20;
    9. color: "blue";
    10.  
    11. }',
    12. container, "dynamicSnippet1");}
    To copy to clipboard, switch view to plain text mode 


    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.
    Last edited by tuxit; 17th August 2011 at 13:49.

Similar Threads

  1. Replies: 4
    Last Post: 15th July 2011, 18:31
  2. How to drag dynamic object in Qml?
    By Franziss in forum Newbie
    Replies: 0
    Last Post: 28th May 2011, 17:07
  3. Replies: 1
    Last Post: 20th January 2011, 17:17
  4. Replies: 4
    Last Post: 20th August 2010, 13:07
  5. writing object to the file(Object Persistance)
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.