Results 1 to 11 of 11

Thread: Drawing in QML

  1. #1
    Join Date
    Jun 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Drawing in QML

    I would like to use QML to draw different shapes or polygons such as triangles, diamonds, or simply diagonal lines. Is there a way to do this with the current version? If not will a future version have these features?
    Thanks

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

  3. #3
    Join Date
    Jun 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drawing in QML

    I'm not sure I see what I'm supposed to see there. I would just like to draw some shape besides a rectangle or circle. I don't want to use an image file, and I don't want to use c++ to draw the image, only QML to draw it. Is that possible?
    Thanks

  4. #4
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drawing in QML

    The polygon class may be what you need http://doc.qt.nokia.com/4.7-snapshot/qpolygon.html
    Got to keep the loonies on the path ...

  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Drawing in QML

    No. Qt is a C++ library.

  6. #6
    Join Date
    Jun 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drawing in QML

    I did see that, but ideally I would like to be able to have the polygon drawn in QML before I apply any c++ code to it.

  7. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drawing in QML

    Why dont you simply use some image editor / creator , create a image file and use that image in QML ??

  8. #8
    Join Date
    Jun 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drawing in QML

    I want to be able to use all of the cool features of QML (ex: gradient), and I don't want to have to swap in and out pictures of every feature I want change (ex: the direction of the gradient).

  9. #9
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drawing in QML

    Got to keep the loonies on the path ...

  10. #10
    Join Date
    Apr 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Drawing in QML

    You can easily use vector graphics: Element Image is able to load SVG

  11. #11
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Drawing in QML

    Use the QML Canvas Plugin http://qt.gitorious.org/qt-labs/qmlcanvas

Similar Threads

  1. 2D drawing
    By WXNSNW in forum Qt Programming
    Replies: 3
    Last Post: 5th October 2010, 23:01
  2. Drawing 3d pie
    By toutarrive in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2009, 16:21
  3. Drawing
    By chethana in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2007, 06:29
  4. Drawing an arc.
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2006, 05:36
  5. Drawing using QT
    By Kapil in forum Newbie
    Replies: 1
    Last Post: 17th March 2006, 04:23

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.