PDA

View Full Version : is there a grid() function in Qwt > 5.0.0



y.shan
12th September 2007, 16:07
Hi all!

I am currently porting a program from Qt3 to Qt4.
This program also uses the Qwt package 4.2.0, which i have to port to 5.0.2 too.
The problem now is, that there is a grid() function in Qwt 4.2.0 which returns the canvas grid, and in Qwt 5.0.2 I can't find this function anymore.
Can somebody help me?

Uwe
12th September 2007, 21:08
for ( QwtPlotItemIterator it = plot->itemList().begin();
it != itmList.end(); ++it )
{
if ( (*it)->rtti() == QwtPlotItem::Rtti_PlotGrid )
...
}


Or simply keep the grid as a member of your plot widget.

HTH,
Uwe

y.shan
13th September 2007, 08:12
for ( QwtPlotItemIterator it = plot->itemList().begin();
it != itmList.end(); ++it )
{
if ( (*it)->rtti() == QwtPlotItem::Rtti_PlotGrid )
...
}



hi uwe, i tried the code you mentioned, but the problem is, that the iterator points to a QwtPlotItem and not to a QwtPlotGrid, which i actually need, because i want to use the enableX and enableY function on it.


Or simply keep the grid as a member of your plot widget.

I'll try to use this approach.

BTW: Uwe like Uwe Rathmann? The developer of Qwt???

Uwe
13th September 2007, 10:29
... QwtPlotItem and not to a QwtPlotGrid
There is nothing wrong with using a cast ( as long as you are above 18).

The developer of Qwt???
Sure,
Uwe