PDA

View Full Version : Problem with rubberband using Qwt5.0.1



luffy27
24th May 2007, 20:09
Hi guys:
I'm facing a problem for a couple of days.

I'm using Qt3.3.5 and Qwt5.0.1 to do my job. What I want is almost the same as the example provided by the source code package of Qwt. The example is called "realtime_plot". In the "realtime_plot" example, there are rubberband functionality, scrollbars, zoom stack etc. These features are just what I need! So I want to add them into my own app by using Qwt library.

Unfortunately there is a problem. When I rubberband the plot, I notice that the symbols(which are called "XCross" in the "realtime_plot" example) drawn on the QwtPlot(or on the QwtPlotCanvas) do not be scaled(zoomed) simultaneously. In another words, the symbols' size do not be zoomed in or zoomed out.

In my app, however, I want to zoomin or zoomout their size simultaneously while rubberbanding.

For example, I want to draw some circles with red color on the QwtPlot. And then rubberband the plot, of course, the X-axis and Y-axis will make some changes. And also these red circles will become bigger.
What should I do to solve the problem?Subclass a custom QwtPlotItem? Make some changes into the Qwt source code?...........

So does anybody could give me some advices?

Thanks a lot.
Best regards.

Uwe
25th May 2007, 08:50
Qwt doesn't scale the symbol size, so this is something you have to add to your code:

F.e. connect a slot to QwtPlotZoomer::zoomed and adjust the symbol size (QwtPlotCurve::setSymbol).

HTH,
Uwe

luffy27
25th May 2007, 18:49
Hi Uwe, first of all, I can't wait to say,your Qwt is really great!

And second:

Qwt doesn't scale the symbol size, so this is something you have to add to your code:

F.e. connect a slot to QwtPlotZoomer::zoomed and adjust the symbol size (QwtPlotCurve::setSymbol).

HTH,
Uwe
Could you provide me some pieces of code?
Just for open my mind.

Thank you very much.

luffy27
27th May 2007, 18:31
Could anybody give me some codes to illustrate the job?
I'm a freshman for Qt, so I really need you help.

Thanks a lot.