Uwe Rathmann | 2 Jun 2010 11:18
Picon

Re: Symbols in custom legend

> On 23.05.2010 21:25, David Stranz wrote:

> Ah, yes, I should have called parent's legendItem().

No you don't need to - but you have to set the legend flags 
(QwtLegend::setDisplayPolicy) for your custom identifiers. 

Uwe

------------------------------------------------------------------------------
Uwe Rathmann | 2 Jun 2010 11:20
Picon

Re: Problems using legends

>    Is there a way to disable legends for some of the curves?

curve->setItemAttribute(QwtPlotItem::Legend, false);

Uwe

------------------------------------------------------------------------------
Uwe Rathmann | 2 Jun 2010 11:34
Picon

Re: How to paint the QwtPlot member canvas()

>  How can I realize the QwtPlotCanvas interface paintEvent;

I strongly recommend not to try it.

Instead you could simply use a QLabel. Manage its size/position ( label-
>setGeometry() ) according to move/resize events of the plot canvas, that you 
can identify using an event filter. Disadvantage of this implementation is, 
that your text is not rendered by QwtPlot::print.

Another option is to use a QwtPlotMarker or to implement a new type of plot 
item, that aligns your text to the canvas geometry.

Uwe

------------------------------------------------------------------------------
David Stranz | 2 Jun 2010 15:33

Re: Symbols in custom legend

Hi Uwe,

Help me understand this.  Is QwtPlotCurve::legendItem() supposed to 
return a new instance each time it is called?  Like other parts of Qt 
and Qwt, I thought it was returning the address of an instance that the 
QwtPlotCurve controlled.  If the call returns a new instance, how does 
this new instance become associated with the QwtPlotCurve?  Is it 
necessary to call QwtPlotCurve::setLegendItem() with the new instance?

Thanks,

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
_______________________________________________________________

Uwe Rathmann wrote:
>> On 23.05.2010 21:25, David Stranz wrote:
> 
>> Ah, yes, I should have called parent's legendItem().
> 
> No you don't need to - but you have to set the legend flags 
> (QwtLegend::setDisplayPolicy) for your custom identifiers. 
(Continue reading)

Vedran Furač | 3 Jun 2010 00:42
X-Face
Picon

Re: Symbols in custom legend

Thanks for your reply!

On 02.06.2010 11:18, Uwe Rathmann wrote:

>> On 23.05.2010 21:25, David Stranz wrote:
> 
>> Ah, yes, I should have called parent's legendItem().
> 
> No you don't need to - but you have to set the legend flags 
> (QwtLegend::setDisplayPolicy) for your custom identifiers. 

Yes, I've tried putting:

legend->setDisplayPolicy(QwtLegend::FixedIdentifier,
QwtLegendItem::ShowSymbol|QwtLegendItem::ShowText);

in the method where I create legend as well as:

legendItem->setIdentifierMode(QwtLegendItem::ShowSymbol|QwtLegendItem::ShowText);

in that overloaded legendItem(), but still no luck, only text is shown.

Regards,
Vedran

--

-- 
http://vedranf.net | a8e7a7783ca0d460fee090cc584adc12

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
(Continue reading)

Uwe Rathmann | 4 Jun 2010 10:33
Picon

Re: Symbols in custom legend

Hi David,

> Is QwtPlotCurve::legendItem() supposed to
> return a new instance each time it is called?  

Yes - have a look at the implementation of 
QwtPlotItem::legendtItem()/updateLegend.

> If the call returns a new instance, how does
> this new instance become associated with the QwtPlotCurve? 

It is inserted into the legend, that holds the connection between the plot 
item and the widget, that represents it on the legend.

Note, that you can use any type of QWidget as legend item - not only widgets 
derived from QwtLegendItem. But then you need to implement the code that 
synchronizes plot item and legend item in YourPlotItem::updateLegend().

Uwe

PS: In Qwt 6.x the API has changed.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
Uwe Rathmann | 4 Jun 2010 10:44
Picon

Re: Symbols in custom legend

> ... but still no luck, only text is shown.

QwtPlotItem::legendItem() is for creating the widget that represents your 
curve on the legend. QwtPlotItem::updateLegend() is intended for synchronizing 
your legend item with the attributes of the plot item ( = curve ). All 
initializations done in legendItem() will be killed by the default 
implementation of updateLegend.

Instead you need to implement YourCurve::updateLegend(), something like this:

void YourCurve::updateLegend(QwtLegend *legend) const
{
	QwtPlotCurve::updateLegend(legend);

        QwtLegendItem *legendItem = 
            dynamic_cast<QwtLegendItem *>(legend->find(this));

       if ( legendItem )
       {
           ....
       }
}

Uwe

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
(Continue reading)

steve | 4 Jun 2010 18:07
Picon
Favicon

(unknown)

I am running qwt 5.2.1 on an XP box. I built a debug lib.

When I try to link against it, I get this error:

moc_scrollzoomer.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlotZoomer::staticMetaObject" (?staticMetaObject <at> QwtPlotZoomer <at> <at> 2UQMetaObject <at> <at> B)
debug\libmylib.dll : fatal error LNK1120: 1 unresolved externals

The exact sa me code base compiles fine in Linux.

How can I fix this?

Thanks

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
David Stranz | 4 Jun 2010 18:19

Re:

Steve,

Are you missing a #define QWT_DLL in your Windows Makefile (or in your 
Visual Studio project settings)?

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
_______________________________________________________________

steve wrote:
> I am running qwt 5.2.1 on an XP box. I built a debug lib.
> 
> When I try to link against it, I get this error:
> 
> moc_scrollzoomer.obj : error LNK2001: unresolved external symbol 
> "public: static struct QMetaObject const 
> QwtPlotZoomer::staticMetaObject" 
> (?staticMetaObject <at> QwtPlotZoomer <at>  <at> 2UQMetaObject <at>  <at> B)
> debug\libmylib.dll : fatal error LNK1120: 1 unresolved externals
> 
> The exact same code base compiles fine in Linux.
> 
> How can I fix this?
> 
> Thanks
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
steve | 4 Jun 2010 20:25
Picon
Favicon

link error in windows regarding QwtPlotZoomer

I am running qwt 5.2.1 on an XP box. I built a debug lib.

Hi all,

I added a subj line and some more information.

When I try to link against it, I get this error:

moc_scrollzoomer.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlotZoomer::staticMetaObject" (?staticMetaObject <at> QwtPlotZoomer <at> <at> 2UQMetaObject <at> <at> B)
debug\libmylib.dll : fatal error LNK1120: 1 unresolved externals

The exact same code base compiles fine in Linux.

How can I fix this?

I next ran >dumpbin /EXPORTS qwtd5.lib and found this in the output:
2034  7F1 000ADB34 ?staticMetaObject <at> QwtPlotZoomer <at> <at> 2UQMetaObject <at> <at> B

Thanks

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest

Gmane