[Development] 2D Graphics Roadmap?

Alan Alpert 416365416c at gmail.com
Tue Jan 28 20:43:16 CET 2014


On Sat, Jan 25, 2014 at 12:10 PM, Steve Gold <steveg2357 at gmail.com> wrote:
> I'm relatively new to Qt (3-4 months now) and have learned a lot. However,
> I've been experimenting with developing apps with QML/JavaScript and
> Canvas/Context2D but have received suggestions to look at Scene Graph or
> Graphics View, both of which seem to require developing C++ classes. Is this
> correct?
>
> QML appears to be a more "efficient" and "productive" approach from a
> development point of view but C++ seems to be more "powerful" and
> "expressive." The examples for Graphics View that I've looked at are the
> most extensive while the examples for Scene Graph and Canvas seem more
> simplistic.
>
> As an example, I found Graphics View demos called elasticnodes (moveable
> nodes/arc) and diagramscene (select/place items onto a palette) but nothing
> remotely similar for the other graphics technologies. I've created several
> posts in the forums and even sent one email but haven't received any
> significant responses.
>
> Before I spend much more time, possibly in the wrong direction, can someone
> address the future of Canvas, Graphics View and Scene Graph with respect to
> Qt and Qt Creator? A comparison would be especially useful.

GraphicsView is a more mature framework, pretty much marked "done",
which is why it has the most examples. It's not going anywhere, which
probably also means don't expect big changes in performance or
underlying implementation. SceneGraph is fairly new, and Canvas is
even newer, depends on the level of maturity you prefer to work on.
I'd expect SceneGraph, and probably Canvas too, to mature more over
the life of Qt 5 (both are new in 5.0).

GraphicsView and SceneGraph are both usable via QML or C++. You can
use C++ for complex custom elements, and compose simple ones out of
Rectangles or Images in QML. Note that all the QtQuick elements, even
Canvas, are implemented with SceneGraph, so you can mix and match them
freely. QtQuick 1, primarily available for compatibility reasons, uses
GraphicsView.

The current recommended approach is to use the new frameworks, build
your app in QML with QtQuick and use Canvas anywhere you need custom
2D rendering (possibly re-writing that element with SG C++ if it's
performance critical).

> Thanks.
>
> Steve
>
> BTW, I'm also posting this in the Qt forums

If you linked to that post, I could have easily checked it for possible overlap.

--
Alan Alpert



More information about the Development mailing list