PDA

View Full Version : Drawing in QML



JeffC
2nd June 2010, 20:53
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

SixDegrees
2nd June 2010, 20:58
http://labs.trolltech.com/blogs/2009/05/13/qt-declarative-ui/

JeffC
3rd June 2010, 13:51
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

JD2000
3rd June 2010, 18:54
The polygon class may be what you need http://doc.qt.nokia.com/4.7-snapshot/qpolygon.html

SixDegrees
3rd June 2010, 18:57
No. Qt is a C++ library.

JeffC
3rd June 2010, 18:57
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.

aamer4yu
3rd June 2010, 19:27
Why dont you simply use some image editor / creator , create a image file and use that image in QML ??

JeffC
3rd June 2010, 19:33
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).

JD2000
3rd June 2010, 19:44
Well, if you are feeling brave...http://labs.trolltech.com/blogs/2010/01/27/upcoming-qtcreator-support-for-qml-or-what-is-bauhaus/

dialingo
21st April 2011, 11:13
You can easily use vector graphics: Element Image is able to load SVG

zester
10th June 2011, 18:25
Use the QML Canvas Plugin http://qt.gitorious.org/qt-labs/qmlcanvas