HongLiang Wang | 13 Jun 2012 12:04
Favicon

Re: qwtscrollbar overlap curve

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

www.hvr-software.com




On Wed, Jun 13, 2012 at 11:40 AM, Uwe Rathmann <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
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
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/
HongLiang Wang | 15 Jun 2012 08:27
Favicon

Re: qwtscrollbar overlap curve

Hello David,
 
Thanks for your reply. The return value of the methods are non-zero, even if the code was put into the constructor.
 
 Tracing shows:
plot_layout->canvasMargin( QwtPlot::xTop) = 4
zoomer->horizontalScrollBar()->extent() = 16
 
I also tried to move that code into showEvent(), but it is not working either.
 
Changing xAxis into QwtPlot::xTop has no effect (see below).
 
 plot_layout->setCanvasMargin( plot_layout->canvasMargin( QwtPlot::xTop)
                          + zoomer->horizontalScrollBar()->extent(),
                          QwtPlot::xTop);
 
 
Any more suggestions?
 
Regards,

Hongliang Wang

HVR Software bv | Daalwijkdreef 47 | 1103 AD Amsterdam | The Netherlands

T. +31-020 820 1578 | F. +31-020 820 1579 | hongliang.wang <at> hvr-software.com

www.hvr-software.com




On Fri, Jun 15, 2012 at 12:05 AM, David Stranz <David_Stranz <at> massspec.com> wrote:
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/
_______________________________________________
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/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Uwe Rathmann | 15 Jun 2012 09:00
Picon

Re: qwtscrollbar overlap curve

On 06/15/2012 08:27 AM, HongLiang Wang wrote:
>
>  plot_layout->setCanvasMargin( plot_layout->canvasMargin( QwtPlot::xTop)
>                           + zoomer->horizontalScrollBar()->extent(),
>                           QwtPlot::xTop);
>

plot_layout->setAlignCanvasToScale( false );
plot_layout->setCanvasMargin( zoomer->horizontalScrollBar()->extent(), -1 );

Once you see an effect you can continue by replacing the -1.

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/
HongLiang Wang | 15 Jun 2012 09:46
Favicon

Re: qwtscrollbar overlap curve

Hello Uwe,
 
First I tried to call setCanvasMargin() with -1 but still got no effect.
 
Then I replaced -1 with xTop, then I got exactly what I what.
 
Now the code in my plot constructor looks like this.
 
 QwtPlotLayout *plot_layout = plotLayout();
 plot_layout->setAlignCanvasToScales( false );
 plot_layout->setCanvasMargin( zoomer->horizontalScrollBar()->extent(), QwtPlot::xTop);
Thanks for your help !
 
 

Hongliang Wang

HVR Software bv | Daalwijkdreef 47 | 1103 AD Amsterdam | The Netherlands

T. +31-020 820 1578 | F. +31-020 820 1579 | hongliang.wang <at> hvr-software.com

www.hvr-software.com




On Fri, Jun 15, 2012 at 9:00 AM, Uwe Rathmann <Uwe.Rathmann <at> tigertal.de> wrote:
On 06/15/2012 08:27 AM, HongLiang Wang wrote:
>
>  plot_layout->setCanvasMargin( plot_layout->canvasMargin( QwtPlot::xTop)
>                           + zoomer->horizontalScrollBar()->extent(),
>                           QwtPlot::xTop);
>

plot_layout->setAlignCanvasToScale( false );
plot_layout->setCanvasMargin( zoomer->horizontalScrollBar()->extent(), -1 );

Once you see an effect you can continue by replacing the -1.

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
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
Uwe Rathmann | 15 Jun 2012 11:44
Picon

Re: qwtscrollbar overlap curve

On 06/15/2012 09:46 AM, HongLiang Wang wrote:
> First I tried to call setCanvasMargin() with -1 but still got no effect.
> Then I replaced -1 with xTop, then I got exactly what I what.

-1 adds the margin to all borders ( including xTop ). So I'm pretty sure 
you did something wrong in your first attempt.

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/

Gmane