[CLOSED] 2D Graphics Roadmap?
-
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.
Thanks.
Steve
BTW, I'm also sending this to development@qt-project.org
-
GraphicsView is part of QtWidgets and a precursor to QML (QtQuick 1 is actually based on GraphicsView Framework). I'm not sure if anybody is working on Canvas, although it's newer. Scenegraph, since it's the base for QtQuick 2, is in constant development nowadays. Oh, don't forget there is also QPainter ;)
All those technologies are maintained, none is deprecated. So I think you just need to pick one that suits you best. AFAIK, modifying Scenegraph is - at the moment - rather low-level and tedious. Graphics View framework was designed with wide use in mind, so it should be easier to start there.
-
Tomasz,
Comments like " I’m not sure if anybody is working on Canvas" concern me and possibly indicate that there may not be a well thought out strategy, if any, for Qt 2D graphics. In addition, I've seen almost nothing recently about 3D graphics.
The following information is from "Qt Maintainers":http://qt-project.org/wiki/Maintainers.
- Lars Knoll is the maintainer for qtbase. Marc Mutz is the maintainer for QtWidgets but there's no specified maintainer for Graphics View.
- Alan Alpert is the maintainer for qtdeclarative. Gunnar Sletta is the maintainer for Scene Graph in Qt Quick. but there' no specified maintainer for Qt Quick/Items where Canvas resides.
It would be extremely helpful if someone, such as one or more of the above, could provide a graphics technology roadmap comparing the various technologies, possibly including Qt 3D and others for 3D, and describing what the "plans" are for each. More examples showing how apps can be built in QML/JavaScript with minimal or no C++ would also be very useful (of course Canvas doesn't require C++). This would certainly make it easier for people that are new to Qt, as well as individuals and companies with a strategic investment in Qt, to make better and more informed decisions.
Thanks.
Steve
BTW, the "roadmap":https://bugreports.qt-project.org/browse/QTBUG#selectedTab=com.atlassian.jira.plugin.system.project:roadmap-panel is not what I consider to be a roadmap
-
Well, don't take my word for this. I'm just a simple programmer that is trying to keep up with the rapid pace at which Qt is going forward ;)
All the maintainers can be contacted on development mailing list and on IRC. There are numerous companies working on Qt, each has it's own goals, and maintainers themselves don't write all the code themselves + they can't force anyone to develop any particular piece of code.
-
Tomasz,
I sent an email of my initial post in this thread to development@qt-project.org and qt-creator@qt-project.org. Have you received a copy of this?
I also sent an email to Gunnar Sletta a week ago asking two questions about Scene Graph.
So far the only responses I've received is from a "simple programmer" who is definitely not so simple. ;-)
BTW, Canvas and Context2D use QPainter, although "Qt Quick Scene Graph":http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph.html does state the following:
@
The scene graph is closely tied to Qt Quick 2.0 and can not be used stand-alone. The scene graph is managed and rendered by the QQuickWindow class and custom Item types can add their graphical primitives into the scene graph through a call to QQuickItem::updatePaintNode().
@Thanks.
Steve
-
Yes, I have seen the mail on the list.
The Scenegraph is evolving, I think it will be receiving more and more painting options in the future. Right now, though, the statement above is correct. But you can use it to do a lot of custom drawing in C++ for QtQuick, too. The documentation is not as comprehensive as for other parts of Qt, but it is getting better.
-
[quote author="SteveG" date="1390836385"]
- Alan Alpert is the maintainer for qtdeclarative. Gunnar Sletta is the maintainer for Scene Graph in Qt Quick. but there' no specified maintainer for Qt Quick/Items where Canvas resides.
[/quote]
With no specified separate maintainer, it's just Alan for QtQuick/Items.
Nothing is happening on Canvas right now because there isn't much use of it, or much room to extend. It's just following an HTML5 API specification, and is specifically for convenient, imperative rendering. The role of imperative rendering in a QML scene is not established yet, so we're waiting to see if it's used much other than just for graphing.
[quote author="SteveG" date="1390836385"]
It would be extremely helpful if someone, such as one or more of the above, could provide a graphics technology roadmap comparing the various technologies, possibly including Qt 3D and others for 3D, and describing what the "plans" are for each. More examples showing how apps can be built in QML/JavaScript with minimal or no C++ would also be very useful (of course Canvas doesn't require C++). This would certainly make it easier for people that are new to Qt, as well as individuals and companies with a strategic investment in Qt, to make better and more informed decisions.[/quote]
The tutorials and reference materials for creating QML/QtQuick Apps ( https://qt-project.org/doc/qt-5/qmlapplications.html ) should cover that, maybe you were just looking at the wrong keywords? - Alan Alpert is the maintainer for qtdeclarative. Gunnar Sletta is the maintainer for Scene Graph in Qt Quick. but there' no specified maintainer for Qt Quick/Items where Canvas resides.
-
Responses to the questions in the mail thread, to consolidate the discussion.
[quote author="Steve G" date="1390892319"]
** Are there any roadmaps for Scene Graph or Canvas that discuss planned
features or improvements? Does saying "... probably Canvas too ..." mean
that there is no definitive plan for the enhancement and evolution of
Canvas?
[/quote]As an open source project, planning is not quite so formal. The latest code is on git, and you can ask about direction if you want to submit patches (yes, this means that progress can be less reliably timetabled in advance).
Thus there is no definitive plan, period. There have been projects adding 3d support to Canvas, and there's a general feeling that it should be kept up to par with the slowly evolving HTML5 canvas API. But it's just one convenience element for quick imperative raster painting.
[quote author="Steve G" date="1390892319"]
** You state "... even Canvas, are implemented with SceneGraph ..." but
context2d.h and context2d.cpp use QPainter
class Context2D : public QObject
. . .
QPainter m_painter;
QPainterPath m_path;
. . .
The post located at http://qt-project.org/forums/viewthread/37605/ states
"Qt Quick 2 makes use of a dedicated scene graph based on OpenGL ES 2.0
or OpenGL 2.0 for its rendering. Using a scene graph for graphics rather
than
the traditional imperative painting systems (QPainter and similar), means
the scene to be rendered can be retained between frames and the complete set
of primitives to render is known before rendering starts."
Can you please clarify this apparent discrepancy?
[/quote]
Canvas, like QQuickPaintedItem, is a Scenegraph element which makes it easy to do imperative raster painting inside a Scenegraph scene. Canvas uses QPainter to render a texture for Scenegraph to render.
[quote author="Steve G" date="1390892319"]
** It would be an achievement if Qt enabled users to write QML types for
Canvas that used Scene Graph under the covers and did not require any
rewriting in C++.
[/quote]
QML types for canvas doesn't really make sense. As far as imperative painting goes, Canvas already is how you write QML types that uses scenegraph under the covers and doesn't require C++.If you want to write an application easily, without C++ but benefiting from the power of the scene graph, use the QtQuick elements. They are exposed to QML, you can assemble the majority of applications by combining them, and they are efficiently implemented in scenegraph with no imperative painting involved.
Canvas is just there as a convenience type if you actually need imperative painting for something (like line graphs, or the classic arcade game "missile command"). For a lot of stuff an HTML5 developer would use canvas for, an animated UI, a particle system, oddly-positioned text, colored rectangles, there exist QtQuick elements which are far more convenient and performant to use.
[quote author="Steve G" date="1390892319"]
** Will Qt use Scene Graph for 3D graphics? Is anything in this area on the
horizon for QML?
[/quote]Check the development mailing list for the recent mail by Sean Harmer about the development of the Qt3D module.
-
Thanks for all your comments. I'll take a closer look at the QML types and C++ classes, as well as look into Qt3D.
Steve