PDA

View Full Version : Disconnection in the curve...



siraj
14th April 2014, 04:36
I am facing a problem when using qwtdirectpainter in my application..I am drawing my curve using qwtdirectpainter class..When the curve is getting plotted,if by chance a tooltip appears on the curve from other applications,and if i remove the tooltip then i find that the curve is getting disconnected...For example i am having many windows open on my desktop..I am plotting a curve on qwtplot widget which is the maximised window.If i place my mouse cursor on any minimised window,then we know that a tooltip describing that window appears..If by chance that tooltip covers the curve i am plotting and then after if i move the mouse cursor so that tooltip disappears,then i find that the curve which is getting plotted gets disconnected and plotting gets continued with some shift..The same observation i had when using the oscilloscope example...How to solve this problem?Thank you...

Uwe
14th April 2014, 06:29
Is the effect gone, when you enable the QwtPlotCanvas::ImmediatePaint flag ?

Uwe

siraj
15th April 2014, 10:52
The effect still exists even after enabling immediatepaint flag..is there something to do with the size of plotcanvas? Like when tooltip is removed to show the plotwidget again...the size of plotcanvas is getting effected and there is a shift in drawing plot?

Uwe
17th April 2014, 06:12
Without a small compilable example it is hard to say something useful.

Uwe

siraj
21st April 2014, 13:04
I am attaching snapshots depicting the situation i am facing during real-time plotting using QwtPlotDirectPainter class.

image1.png->It is the expected curve.
image2.png->here tootltip appears on the curve due to mouse movement during real-time plotting at around 102 seconds.
image3.png->the shift in the curve can be seen in the plotwidget when the tooltip is removed.


I have enabled these flags on my plot canvas.

canvas()->setPaintAttribute(QwtPlotCanvas::BackingStore, true);

#if defined(Q_WS_X11)

// Even if not recommended by TrollTech, Qt::WA_PaintOutsidePaintEvent
// works on X11. This has a nice effect on the performance.

canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);

if (canvas()->testPaintAttribute( QwtPlotCanvas::BackingStore ) )
{
canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
canvas()->setAttribute(Qt::WA_NoSystemBackground, false);
}

#endif

What is to be done to avoid this disconnection of the curve?

102971029810299

siraj
24th April 2014, 03:20
Hi Uwe.. I had the same observation of shift in the curve in oscilloscope example also when i enable the backingstore option..I am using qwt6.0.1 and qt 4.7 on linux.I ran your oscilloscope example with setting backingstore flag to true with no other changes..I observed that when any tooltip appears on the curve,the curve is getting shifted..Please look into this issue..I am attaching the sanpshots..thank you...

1030310304

Uwe
24th April 2014, 11:15
What happens when running the application with "-graphicssystem raster" and/or disabling the Qt::WA_PaintOutsidePaintEvent ?

Uwe

siraj
25th April 2014, 15:06
Thank you Uwe...the problem got solved after disabling both Qt::WA_PaintOutsidePaintEvent and backingstore..