[Qt-qml] lines?

Thomas McGuire thomas.mcguire at kdab.com
Thu Sep 29 20:24:02 CEST 2011


Hi,

On Thursday 29 September 2011 20:18:24 Jason H wrote:
> I am trying to make a DrawArea (where you have a pen and can scribble
> over the rect) and to do this, I was planning on using onPressed and
> onPositionChanged. I need to create an array of points to store the
> scribble, and have then drawn consecutively.
> 
> But I am not seeing a Line element and the PathView seems to be used for
> layout on a path, and not an actual line?
> 
> How can I go about making a scribble?

Don't try to use QML for this, it would mean one QML element per line, which 
would be a really big overhead when making a drawing consisting of many lines. 
Also, there is no Line QML element.

I recommend implementing a Scribble QML item yourself, in C++, by subclassing 
QDeclarativeItem and reimplementing things like paintEvent() and the mouse 
handlers.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3637 bytes
Desc: not available
Url : http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110929/253cdfe3/attachment.bin 


More information about the Qt-qml mailing list