Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Complex 2D graphics in QtQuick via C++

$
0
0
Hi, my goal is to implement custom QML element in C++. The purpose of this element is to draw rather complex 2D graphics (curves, polygons and polylines, text labels). And I also need to support mouse events handling (for example, editing polyline with mouse). In previous version of Qt I could reimplement method paint(QPainter *painter, …) of QDeclarativeItem and use QPainter to perform graphics and text drawing, but in Qt 5 this approach is deprecated (see QQuickPaintedItem docs). Currently I see two possibilites (described in Qt 5 docs): 1) subclass QQuickItem 2) write C++ QML plugin Could you, please, advise me which of this two possibilities is more preferrable and suitable for my purposes (if any)? Thanks in advance!

Viewing all articles
Browse latest Browse all 4972

Trending Articles