David Stranz | 15 Jun 2012 00:05

Re: qwtscrollbar overlap curve

Hongliang,

If this code is in the constructor for your plot object, then none of 
these child objects will have any sizes yet.

Have you looked at any of the values that are being returned by the 
methods you are calling?  If the plot has not been made visible yet, 
then these objects will not have any size and asking for margins and 
extents will return 0.

You should move the layout code to the showEvent() for your plot.  At 
that point, the child widgets will have non-zero sizes.

Also make sure you are using the correct "xAxis".  If you want the 
scrollbar at the *top* of your plot, you should probably be using "xTop" 
and not the xAxis that your zoomer uses (it probably uses xBottom).

David

_______________________________________________________________
David Stranz, Ph.D.	david_stranz <at> MassSpec.com

Sierra Analytics, Inc.
5815 Stoddard Road, Suite 601
Modesto, CA  95356

Tel: (209) 545-8508
http://www.massspec.com
_______________________________________________________________

On 6/13/2012 3:04 AM, HongLiang Wang wrote:
> Hello Uwe,
> Thanks for your quick reply. I added following code to my plot
> constructor as you suggested:
>     zoomer= new JBStatZoomer(canvas());
>     QwtPlotLayout *plot_layout = plotLayout();
>     const int xAxis = zoomer->xAxis();
>     plot_layout->setCanvasMargin( plot_layout->canvasMargin( xAxis )
>                              + zoomer->horizontalScrollBar()->extent(),
>                              xAxis );
> But this code still has no effect.
> Can you please double check if my code was correct?
> Thanks.
>
> Hongliang Wang
>
> HVR Software bv | Haaksbergweg 45 | 1101 BR Amsterdam | The Netherlands
>
> T. +31-020 312 7517 | F. +31-020 312 7509 |
> hongliang.wang <at> hvr-software.com <mailto:hongliang.wang <at> hvr-software.com>
>
> www.hvr-software.com <http://www.hvr-software.com/>
>
>
>
>
> On Wed, Jun 13, 2012 at 11:40 AM, Uwe Rathmann <Uwe.Rathmann <at> tigertal.de
> <mailto:Uwe.Rathmann <at> tigertal.de>> wrote:
>
>     On 06/13/2012 09:50 AM, HongLiang Wang wrote:
>      >
>      > But the side effect is that qwtscrollbar is overlaping part of the
>      > curve ( shown in attachment qwt_01.png).
>
>     What about setting margins corresponding to the extent of the scrollbars
>     to your plot layout. See QwtPlotLayout::setCanvasMargin().
>
>     Uwe
>
>     ------------------------------------------------------------------------------
>     Live Security Virtual Conference
>     Exclusive live event will cover all the ways today's security and
>     threat landscape has changed and how IT managers can respond.
>     Discussions
>     will include endpoint security, mobile security and the latest in
>     malware
>     threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>     _______________________________________________
>     qwt-interest mailing list
>     qwt-interest <at> lists.sourceforge.net
>     <mailto:qwt-interest <at> lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/qwt-interest
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
>
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane