Qwt with QWidget or QGraphicsView+QGraphicsScene
Hello!
I want to show a QwtPlot 2D graphic in my Qt application (and I'm using the UI interface for that). In previous software, what I did was I created a personal class with QwtPlot inherited and used the function setParent() pointing to a QWidget inside the UI interface.
But I noticed that the QGraphicsView + QGraphicsScene provides some painting functionality that simple QWidget don't provide, so I figured out, if it turned to be necessary, that probably it would be better if I connected the QwtPlot not with a QWidget, but with a QGraphicsView/QGraphicsScene so I could use not only the functions Qwt provide, but also what QGraphicsView/Scene provides.
I would like to know, given this desire, what are the advantages/disavantages of linking a QwtPlot to a QGraphicsView instead of a QWidget, what can I loose and if my previous, written thoughs are correct. Notice that I don't want only to plot, but to use many "special" functionality for the QwtPlot such as zoom and pan.
Thanks,
Momergil
Re: Qwt with QWidget or QGraphicsView+QGraphicsScene
Quote:
Originally Posted by
Momergil
I would like to know, given this desire, what are the advantages ...
When you are trying to use OpenGL you might find a way to tunnel QWidgets ( here Qwt widgets ) by using the OpenGL mode of the QGL canvas. Never tried this hack myself, but I wouldn't expect that it works out of the box.
Beside this I wouldn't expect anything useful from stacking Qwt and QGV as both are on the same level of abstraction ( somewhere between QPainter and QWidget ).
Uwe
Re: Qwt with QWidget or QGraphicsView+QGraphicsScene
Quote:
Originally Posted by
Uwe
When you are trying to use OpenGL you might find a way to tunnel QWidgets ( here Qwt widgets ) by using the OpenGL mode of the QGL canvas. Never tried this hack myself, but I wouldn't expect that it works out of the box.
To be sincere I'm not sure if I understood what you mean in this explanation.
Quote:
Beside this I wouldn't expect anything useful from stacking Qwt and QGV as both are on the same level of abstraction ( somewhere between QPainter and QWidget ).
Hmm, Ok. But does this garantee to me that all functionality that QGV+QGS provides will be avaliable if I stack Qwt in a QWidget?*
Now, given you mentioned OpenGL and some days ago I was studying what would be better to use to display graphics in my software - Qwt or OpenGL -, could you also say to me if there is the possibility to use OpenGL functions inside a QwtPlot? Let's imagine that I want to do something that Qwt classes/functions don't do or don't do very well while OpenGL offers exactly what I need. Is there a way to work with both of them in the same plot?
Thanks!
Momergil
*Notice that my greatest interest in using QGV+QGS by now is to be able to use the write text function in the Qt example Diagram Scene.
Re: Qwt with QWidget or QGraphicsView+QGraphicsScene
Quote:
To be sincere I'm not sure if I understood what you mean in this explanation.
Then it is of no importance for you.
Quote:
Ok. But does this garantee to me that all functionality that QGV+QGS provides will be avaliable if I stack Qwt in a QWidget?*
Of course not - stacking Qwt on QGV doesn't offer you to put QGraphicsItems on the plot canvas or QwtPlotItems on the QG scene. You can't have Qwt and QGV features together.
Uwe
Re: Qwt with QWidget or QGraphicsView+QGraphicsScene
Quote:
Originally Posted by
Uwe
Then it is of no importance for you.
Of course not - stacking Qwt on QGV doesn't offer you to put QGraphicsItems on the plot canvas or QwtPlotItems on the QG scene. You can't have Qwt and QGV features together.
Uwe
Hmm, ok. And what about OpenGL and Qwt together?
Momergil