What should I use for implementing a draggable and zoomable 'surface' ?
-
Hi
I want to draw some 2D geometry in a widget and let the user interact with it in a few limited ways.
Scaling, Translating and Rotating the whole thing interactively is needed.Is there some library widget I can use so I do not have to implement these manually.
(And some scene graph support would be great, but not very important.
For example, if I want the location of the user click irrespective of the transformations) -
QGraphicsView seems what you are looking for.
You can read about QGraphicsView framework at:
"http://doc-snapshot.qt-project.org/qt5-5.4/graphicsview.html":http://doc-snapshot.qt-project.org/qt5-5.4/graphicsview.html -
Hi,
Something's not clear: are you working with widgets or QML ?
-
Widgets, definitely.
I am not yet using Qt yet, just evaluating my options.
My display (with SFML) looks like this:
!http://s2.postimg.org/bjn97cpzt/snapshot41.png(Display)!I would like to implement this in Qt.
The drawing part needs to be somewhat low level (with vertex arrays), but it should allow interaction as I described in the original post. -
In Qt you can create GUI with widgets (C++) or with JavaScript like language (QML).
With QML you might get your desired result quickly, but might cost you a higher learning effort (depending on the skills you already have).
But you can prototype with QML and switch to QWidgets later on if you reach a limit with it.
It's also possible mix QML with widgets btw.