6

I skimmed through new features of Qt5 and Qt Quick and don't really understand how it differs from the Graphics View Framework (QGraphicsScene) feature wise. It uses QML but beside that:

  1. Can Qt Quick do something that QGraphicsScene can't? For example particle effects.
  2. Is Qt Quick faster than QGraphicsScene? "Faster" meaning more FPS while displaying 1000 moving elements?

I am making a tower defense game and have been using QGraphicsScene and now I wonder whether I should switch to Qt Quick.

1 Answers1

7

Qt5 and Qt Quick 2 should give a nice performance boost, thanks to "scene graph", which is the underlying engine and basically written from scratch for Qt Quick of Qt5, to take full advantage of OpenGL, and have high frame rate as a design goal from the start.

In addition to performance, I think it count's as a big feature, that you can describe the GUI, transitions, animations and all that, in a much nicer way with QML. There's some learning curve, writing declarative GUI code is quite different from writing more direct C++ code to do similar things, but it's totally worth it.

In Qt4, I don't think QML is going to give any peformance advantage, as I think (did not verify now) there it is written on top QGraphicsView stuff.

So, to summarize: Go for Qt5 and Qt Quick2, and Learn QML for desiging the GUI. Have game logic done in C++ for performance (tower defence games can have quite a bit of stuff happening at the extreme case).

Edit: Blog (old so may be slightly out of date in details) about why then scene graph implementation was created: http://blog.qt.io/blog/2011/05/31/qml-scene-graph-in-master/

hyde
  • 60,639
  • 21
  • 115
  • 176
  • 1
    Can you provide any benchmarks or trustworthy sources that show the performance increase of _scene graph_ compared to _graphics view_? – problemofficer - n.f. Monica Jun 23 '13 at 06:11
  • @problemofficer Maybe, I added a link to an old blog, which has one benchmark graph, which shows Qt4 QML1 vs. Qt5 QML2 fps difference for one case. – hyde Jun 23 '13 at 18:42