Gianni Ambrosio | 8 Jun 2012 13:20

curve symbol and legend

Hi All,
I use Qwt 5.2.0 and Qt 4.7.2 on windows.

On a plot I set the curve symbol style to QwtSymbol::Ellipse. I need 
that to identify points that can be dragged with a canvas picker. But on 
the plot legend each curve is also identified by an ellipse. Is it 
possible to have ellipses (= circles in my case) for points on the plot 
area but simple lines on the legend?

Regards
Gianni

------------------------------------------------------------------------------
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/
Uwe Rathmann | 10 Jun 2012 12:49
Picon

Re: curve symbol and legend

On 06/08/2012 01:20 PM, Gianni Ambrosio wrote:
> Hi All,
> I use Qwt 5.2.0 and Qt 4.7.2 on windows.
>
> On a plot I set the curve symbol style to QwtSymbol::Ellipse. I need
> that to identify points that can be dragged with a canvas picker. But on
> the plot legend each curve is also identified by an ellipse. Is it
> possible to have ellipses (= circles in my case) for points on the plot
> area but simple lines on the legend?
>

For Qwt 5.2 see QwtLegendItem::IdentifierMode.

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/
Gianni Ambrosio | 11 Jun 2012 18:20

Re: curve symbol and legend

Il 6/10/2012 12:49 PM, Uwe Rathmann ha scritto:
> For Qwt 5.2 see QwtLegendItem::IdentifierMode. 
Thanks Uwe,
I tried the following code but it does not seem to work:

    QWidget* legendItem = curve->legendItem();
    if (NULL != legendItem && legendItem->inherits("QwtLegendItem"))
    {

static_cast<QwtLegendItem*>(legendItem)->setIdentifierMode(QwtLegendItem::ShowLine);
    }

Is it correct? Is there anything else I should do after that?

Regards
Gianni

------------------------------------------------------------------------------
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 | 13 Jun 2012 09:50
Favicon

qwtscrollbar overlap curve

Hello all,
 
I got two requirements:
 
1. Using scrollbar when zooming.
 
2. Sync scrollbar of different plots.
 
I basically followed qwt example 'realtime' for requirement 1.
 
In order to acrhieve requirement 2 I had to make scrollbars to be shown alwayson, because the scrollbars have to be created so that the parent widget can sync them using following code.
 
/* Create plot */
  stat_graph= new JBStatGraph(scrollAreaWidgetContents,   
                              scrollAreaWidgetLayout,     
                              row, domain_unique,         
                              domain->getTimeString(),    
                              domain->getTimeValue());     

                /* Sync horizontal scrollbars */                                   
                if(row % 2 == 0) {                                                 
                    hbar_even= stat_graph->zoomer->horizontalScrollBar();          
                }                                                                  
                else {                                                             
                    hbar_odd= stat_graph->zoomer->horizontalScrollBar();           
                }                                                                  
                                                                                   
                if(hbar_even && hbar_odd) {                                        
                    connect(hbar_even, SIGNAL(valueChanged(int)),                  
                            hbar_odd, SLOT(setValue(int)));                        
                    connect(hbar_odd, SIGNAL(valueChanged(int)),                   
                            hbar_even, SLOT(setValue(int)));                       
                }                                                                  
                                                                                   
But the side effect is that qwtscrollbar is overlaping part of the curve ( shown in attachment qwt_01.png).
 
When zooming starts, qwtscrollbar works fine (shown in attachment qwt_02.png).
 
Setting scrollbars to be shown when needed may not work for sync.
 
I have been working on this for several days and any help is appreciated.
 
Regards,
 
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


------------------------------------------------------------------------------
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 | 13 Jun 2012 11:40
Picon

Re: qwtscrollbar overlap curve

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/
Uwe Rathmann | 13 Jun 2012 11:33
Picon

Re: curve symbol and legend

On 06/11/2012 06:20 PM, Gianni Ambrosio wrote:
> Is it correct?

No you have to overload QwtPlotItem::legendItem():

QWidget *YourCurve::legendItem() const
{
     QwtLegendItem* legendItem = new QwtLegendItem();
     legendItem->setIdentifierMode( ... );

     return legendItem;
}

When it doesn't work check/debug the implementation of 
QwtPlotCurve::updateLegend.

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 | 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/

Gmane