Results 1 to 2 of 2

Thread: use if in row element failed

  1. #1
    Join Date
    Jun 2009
    Posts
    74
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Default use if in row element failed

    I add a property cond, when cond is true, it will draw 3 picture,otherwise only one will be drawed
    but qml report "Unexpected token `if'" ,any ideas? Thanks

    Qt Code:
    1. import QtQuick 1.1
    2.  
    3. Rectangle{
    4. id:rect
    5. property bool cond:true;
    6. Row{
    7. Image{ source:"good.png" }
    8. if(cond) {
    9. Image{ source:"good.png" }
    10. Image{ source:"good.png" }
    11. }
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by hashb; 29th May 2012 at 08:57.

  2. #2
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use if in row element failed

    you can use a repeater to set the number as a condition

Similar Threads

  1. Painting on QML Element
    By arunpk in forum Qt Quick
    Replies: 1
    Last Post: 12th May 2012, 00:54
  2. Replies: 9
    Last Post: 23rd April 2012, 13:53
  3. Get element in Qgridlayout
    By dieter in forum Newbie
    Replies: 1
    Last Post: 12th February 2012, 09:51
  4. Remove element of xml
    By VitaliBR in forum Newbie
    Replies: 17
    Last Post: 16th February 2011, 13:28
  5. Help with QML Pathview element
    By chetu1984 in forum Newbie
    Replies: 0
    Last Post: 7th February 2011, 04:49

Tags for this Thread

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.