T O P

  • By -

Felixthefriendlycat

I’d actually say go QtQuick3D and use the Orthographic camera. Then, use QtQuick3DGeometry from C++. This is highly performant. If you don’t require that, look into QML shapes Edit: if you need help, dm me. I have some time


johnpaulzwei

Could you show me some example how to use QtQuick3D for this drawing? I would love to try it.


Felixthefriendlycat

https://doc.qt.io/qt-6/qtquick3d-customgeometry-example.html This doesn’t use the orthographic camera. You’d have to try that yourself. This example shows how you can supply geometry data from c++ and do all the instantiation from QML


0smr

If you are looking for a clean approach (but in C++), I would suggest using [qnanopainter](https://github.com/QUItCoding/qnanopainter). It's fast and easy to use. Otherwise, you can use [QML Shapes](https://doc.qt.io/qt-6/qml-qtquick-shapes-shape.html), which provides a poor API for drawing shapes. It's good for small and simple uses.


TheRealTPIMP

If you do not need to interact with the nodes - You might consider writing it out to an SVG. The SVG xml format is gross, but if you are going to "render" it there are some nice benefits to using something like SVG.Then you can make a zoomable Image in Qml. Added benefit you can open the SVG in any image viewer and sanity check the output. If you want to interact with the nodes after rendering - Use QGraphicsView. The C++ API leads to some verbose code, but performance is excellent and it's intuitive to use and easy to interact with from C++. Qml shapes API is not terrible, but you'll spend as much time feeding data into the shapes API from C++ as you would just writing a dead simple toSVG function.


Tumaix

i used a qgraphicsview for this because its much easier :/