Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtQuick 2.0 vs QGraphicsView (QPainter)

I'm writing right now an application in Python (PyQt / PySide), which should visualise and should give the possibility to edit complex dataflow graphs (like nodes in blender). Additional I want these nodes to display opengl 3D objects (small opengl scenes, like buttons on nodes), images, controls etc. The GUI will be complex also - it will allow to subdivide to panels and allow in each panel to open a context (like in Eclipse or Visual Studio).

I'm learning QtQuick 2.0 right now and I've read Overview of painting in Qt 5. I'm wondering what are the real benefits of using QtQuick over QPainter. QtQucik 2.0 no longer uses QGraphicsView as its backend (it uses directly the OpenGL context)

In each technology you can use OpenGL. In each you can draw custom looking buttons and widgets (like nodes, their connections etc) (you can draw them even with QPainter and handle mouse by yourself).

Of course the qml is declarative and can optimize the OpenGL calls, but does it really matter? I've been searching very long for any benchamrks between QPainter (QGraphicsView) and QtQuick 2.0 but found nothing interesting.

So the questions are:

  1. Is really QtQuick the technology "of the future"? Should I use it if it is possible? Will I benefit from it in the future? Or it is simple "another" way of doing the same things like with QPainter with QGraphicsView and QWidgets?
  2. Are the possibilities of QtQuick 2.0 really higher than the PySide / PyQt?
  3. Is the QtQuick more suitable to develop this kind of application or should I stick to PySide / PyQT and QPainter?
like image 691
Wojciech Danilo Avatar asked Nov 25 '22 06:11

Wojciech Danilo


1 Answers

The OpenGL mostly matters if you want to embed the UI directly with other OpenGL elements, and especially when you want smooth transitions, animations etc. on limited hardware.

1), 2) are hard to answer - it depends. For a desktop application with complex eclipse-like UI doing everything in QtQuick isn't really feasible. I'd stay with widgets there. Reimplementing Eclipse in QtQuick would be a huge task and would end up in a hardly usable UI that doesn't blend in well with the desktop. If you want animated, custom UI, then I'd go QtQuick. There it's the right tool for the job and mimicking it in QWidget/plain QGraphicsView would be pain.

like image 51
Frank Osterfeld Avatar answered Dec 05 '22 19:12

Frank Osterfeld