It might be a good idea to have different type of markers:
	
	enum RttiValue
{
    TramStation,
    ...
};
 
{
    ...
    virtual int rtti() const { return TramStation; }
}
        enum RttiValue
{
    BusStation = QwtPlotItem::Rtti_PlotUserItem,
    TramStation,
    ...
};
class StationMarker: public QwtPlotMarker
{
    ...
    virtual int rtti() const { return TramStation; }
}
To copy to clipboard, switch view to plain text mode 
  
	
		
			
			
				As I understand, using these method full list of stations are shown in the legend.
			
		
 
	 
 No, you can enable/disable the QwtPlotItem::Legend attribute for each plot item individually. 
But I recommend not to use markers, when you have many stations. Instead use Qwt 6.x and implement your own type of plot item. Something like this:
	
	class Station
{
public:
};
 
class StationItem: public QwtPlotSeriesItem<Station>
{
public:
    enum Type
    {
        Tram,
        ...
    };
 
        StationItem<Station>
( QwtText( title 
) ),
        m_type(type)
   {
 
         setZ( ... );
   }
 
   virtual int rtti() const 
   { 
        return m_type;
   }
 
        const QRectF &canvasRect 
) const     {
        int numStations = dataSize();
 
        for ( int i = 0; i <= numStations; i++ )
        {
           const Station station = sample(i);
 
           if ( canvasRect.contains( pos ) )
           {
                painter->drawPixmap( ... );
                painter->drawText( ..., station.name );
           }
        }
    }
 
private:
    const Type m_type;
}
        class Station
{
public:
    QString name;
    QPointF pos;
};
class StationItem: public QwtPlotSeriesItem<Station>
{
public:
    enum Type
    {
        Bus = QwtPlotItem::Rtti_PlotUserItem,
        Tram,
        ...
    };
    StationItem( Type type, const QString &title = QString::null ):
        StationItem<Station>( QwtText( title ) ),
        m_type(type)
   {
         setItemAttribute( QwtPlotItem::Legend );
         setItemAttribute( QwtPlotItem::AutoScale );
         setZ( ... );
   }
   virtual int rtti() const 
   { 
        return m_type;
   }
    virtual void draw( QPainter *painter,
        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
        const QRectF &canvasRect ) const
    {
        int numStations = dataSize();
        for ( int i = 0; i <= numStations; i++ )
        {
           const Station station = sample(i);
           QPointF pos = QwtScaleMap::transform( xMap, yMap, station.pos );
           if ( canvasRect.contains( pos ) )
           {
                painter->drawPixmap( ... );
                painter->drawText( ..., station.name );
           }
        }
    }
private:
    const Type m_type;
}
To copy to clipboard, switch view to plain text mode 
  Uwe
				
			
Bookmarks