5

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?
Wojciech Danilo
  • 11,573
  • 17
  • 66
  • 132

2 Answers2

1

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.

Frank Osterfeld
  • 24,815
  • 5
  • 58
  • 70
  • Thank you, could you elaborate a little more about "mimicking it in `QWidget`/ plain `QGraphicsView` would be pain"? Why cannot I simply draw figures with `QGraphicsView` and then animate them. With `PySide` / `PyQt` it should be simple imo. Am I wrong? – Wojciech Danilo Jan 28 '13 at 19:37
  • Additional could you please tell me why `QGraphicsView` working on OpenGL would be not so good as `QtQuick 2.0` on limited hardware? Is the difference of performance between them so big? – Wojciech Danilo Jan 28 '13 at 19:39
  • QtQuick 2: The main difference to QQ1 is that it uses a scene graph: http://qt-project.org/doc/qt-5.0/qtquick/qtquick-visualcanvas-scenegraph.html – Frank Osterfeld Jan 28 '13 at 20:56
  • The "pain" part mainly referred to widgets. In most use cases plain graphicsview will end up more complicated if you use it for "normal" UI controls with user interaction: anchoring, animated transitions on interaction, i.e. the cases QML was made for. As QQ1 items can be easily embedded into a graphicsscene/view via QDeclarativeItem, one can combine those freely, so it's not an either/or decision. – Frank Osterfeld Jan 28 '13 at 21:03
  • I know it uses scenegraph. I think I've read everything (really) connected to QtQuick. This scenegraph is so fadst compared to `QGraphicsView` that it is the only option to run on limited hardware? I understeand that declarative language give us the tools to make animations fast with anchoring etc, but writing own classes and functions would give me simmilar effect, doesnt it? (I'm sorry for such in depth questions - I'm trying to deeply understeand the differences) – Wojciech Danilo Jan 28 '13 at 23:18
-1

A1. QtQuick is a modern technology to implementing fluidly advanced UI. It uses Scene Graph as backend which is newest technology to utilising Hardware Acceleration in a high performance and very intelligent approach. Scene Graph has best performance between QPainter, QGraphicsView, Scene Graph if target machine is OpenGL ES 2 capable.
It is very productive but you need to be care about some performance tips to keep performance as high as possible.
It is naturally suitable for MVC/MVC-like patterns but choosing/designing an efficient and suitable model to integrating and interaction between Model/Controller/View needs experience).

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

A3. In my experience, in case of a big and complex applications, you need to be careful about choosing a good approach to integrating C++ and QML (in other words controlling UI from C++).
Also you can create custom elements using QPainter or QGraphicView or QOpenGL or QQuickItem and integrate it with QtQuick based UI.
Keep in mind that static build of QtQuick is not possible now! (AFAIK)

Last word, I suggest you strongly to learn and test it in real world. Because it grows rapidly in Qt Framework and it is the future in my opinion.

S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59