QtQuick 2.0 vs QGraphicsView (QPainter)

I am writing a Python application right now (PyQt / PySide), which should render and enable editing complex data flow graphs (for example, nodes in blender). Additionally, I want these nodes to display opengl 3D objects (small opengl scenes, like buttons on nodes), images, controls, etc. The graphical interface will also be complex - it will allow you to separate the panels and allow each panel to open a context (for example, in Eclipse or Visual Studio).

I am studying QtQuick 2.0 right now, and I read the picture overview in Qt 5 . I am wondering what are the real benefits of using QtQuick over QPainter . QtQucik 2.0 no longer uses QGraphicsView as its backend (it directly uses the OpenGL context)

In each technology, you can use OpenGL . In each of them you can draw custom buttons and widgets (for example, nodes, their connections, etc.) (you can even draw them using QPainter and manipulate the mouse yourself).

Of course, qml is declarative and can optimize OpenGL calls, but does it really matter? For a very long time I searched for any benches between QPainter ( QGraphicsView ) and QtQuick 2.0 , but did not find anything interesting.

So the questions are:

  • Is QtQuick technology of the “future”? Should I use it if possible? Will I benefit from this in the future? Or just a “different” way of doing the same thing as with QPainter with QGraphicsView and QWidgets ?
  • Are the capabilities of QtQuick 2.0 really higher than PySide / PyQt ?
  • Is QtQuick more suitable for developing such an application, or should I stick with PySide / PyQt and QPainter ?
+4
source share
2 answers

OpenGL basically matters if you want to embed the user interface directly with other OpenGL elements, and especially when you need smooth transitions, animations, etc. on limited equipment.

1), 2) it is difficult to answer - it depends. For a desktop application with a complex Eclipse-like user interface that does everything in QtQuick, it’s actually impossible. I will stay there with widgets. Re-executing Eclipse in QtQuick would be a huge task and end up with a barely usable user interface that wouldn't work well with the desktop. If you want an animated user interface, I would go QtQuick. There it is the right tool to work and imitating it in QWidget / plain QGraphicsView will be a pain.

+1
source

A1. QtQuick is a state-of-the-art technology for implementing a flexible, advanced user interface. It uses Scene Graph as a backend, which is the latest technology to use Hardware Acceleration in a high-performance and highly intelligent approach. The scene graph has better performance between QPainter, QGraphicsView, Scene Graph, if the target is OpenGL ES 2.
This is very productive, but you need to take care of some performance recommendations to maximize performance.
Naturally, it is suitable for models with MVC / MVC, but the choice / development of an effective and suitable model for integration and interaction between the experience of modeling Model / Controller / View).

A2. Your question is wrong! QtQuick is part of Qt, not a new thing parallel to the whole of Qt.

A3. In my experience, in the case of large and complex applications, you need to be careful in choosing a good approach to integrate C ++ and QML (in other words, control the user interface from C ++).
You can also create custom elements using QPainter or QGraphicView or QOpenGL or QQuickItem and integrate them with the QtQuick-based user interface.
Keep in mind that QtQuick static build is not possible! (AFAIK)

Last word, I suggest you learn and test it in the real world. Since it is growing rapidly in the Qt Framework, and this is the future, in my opinion.

-1
source

All Articles