[SOLVED] What part of Qt should I use for 2D graphics in circuit diagram editor?
-
wrote on 18 Jan 2013, 15:28 last edited by
Hi,
i want to create a circuit diagram editor. I don't know what parts of Qt should i use for painting 2D diagrams. I found QPainter, OpenGL and QGraphicsScene. What is the best for my problem? I found this example: http://qt-project.org/doc/qt-5.0/qtwidgets/graphicsview-diagramscene.html . My diagram editor will look like similar, but it will be more complicated. I would like to drawn diagram can be exported to svg. What would you recommended to me?Thanks for all replies and sorry for my bad english.
-
wrote on 18 Jan 2013, 16:07 last edited by
Your options are between the scenegraph and QGraphicsScene, the first one always uses openGL through QML and allows for occasional QPainter C++ extenssion, the second one can use openGL or use software rendering and is pure C++. If you plan to run simulations on your circuits a.k.a SPICE that would best be implemented in pure C++ for performance reasons.
Using QGraphicsScene should be more scalable, if you plan to create large circuits, using QML on the other hand will offer significantly faster development, but you have to interface your custom C++ components if you want top performance. For basic diagrams with no interactive simulations QML is the better choice, and last but not least, the documentation and samples on QGraphicsScene/View/Item is significantly more detailed and plentiful, and contains pretty much everything you will need to accomplish the task, with QML you will end up asking a lot of questions and waiting for answers that are not guaranteed to come quickly or at all.
-
wrote on 18 Jan 2013, 16:21 last edited by
[quote author="utcenter" date="1358525277"]Your options ...[/quote]
I want write it completely in C++. So do you mean the best choice is certainly QGraphicsScene? -
wrote on 18 Jan 2013, 16:30 last edited by
Best as in only - yes :) There is no public C++ API to use QtQuick, at least for the foreseeable future, so go ahead.
-
wrote on 18 Jan 2013, 16:34 last edited by
OK, thank you very much! :)
-
wrote on 19 Jan 2013, 08:46 last edited by
Have you heard of "Fritzing":http://fritzing.org/ ?
-
wrote on 21 Jan 2013, 02:32 last edited by
Or "Qucs":http://qucs.sourceforge.net/ ?
1/7