Index: trunk/BNC/qwtpolar/qwt_polar_canvas.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_canvas.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_canvas.cpp	(revision 8127)
@@ -9,4 +9,5 @@
 #include "qwt_polar_canvas.h"
 #include "qwt_polar_plot.h"
+#include <qwt_painter.h>
 #include <qpainter.h>
 #include <qevent.h>
@@ -213,5 +214,8 @@
                 {
                     QWidget *bgWidget = qwtBackgroundWidget( plot() );
-                    bs.fill( bgWidget, mapTo( bgWidget, rect().topLeft() ) );
+
+					QwtPainter::fillPixmap( bgWidget, bs,
+						mapTo( bgWidget, rect().topLeft() ) );
+
                     p.begin( &bs );
                 }
Index: trunk/BNC/qwtpolar/qwt_polar_curve.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_curve.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_curve.cpp	(revision 8127)
@@ -14,5 +14,4 @@
 #include <qwt_symbol.h>
 #include <qwt_legend.h>
-#include <qwt_legend_item.h>
 #include <qwt_curve_fitter.h>
 #include <qwt_clipper.h>
@@ -174,5 +173,5 @@
   \sa symbol()
 */
-void QwtPolarCurve::setSymbol( const QwtSymbol *symbol )
+void QwtPolarCurve::setSymbol( QwtSymbol *symbol )
 {
     if ( symbol != d_data->symbol )
@@ -434,5 +433,5 @@
     if ( !clipRect.isEmpty() )
     {
-        double off = qCeil( qMax(qreal(1.0), painter->pen().widthF() ) );
+        double off = qCeil( qMax( qreal( 1.0 ), painter->pen().widthF() ) );
         clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
         polyline = QwtClipper::clipPolygonF( clipRect, polyline );
@@ -501,70 +500,37 @@
 }
 
-//!  Update the widget that represents the curve on the legend
-void QwtPolarCurve::updateLegend( QwtLegend *legend ) const
-{
-    if ( legend && testItemAttribute( QwtPolarCurve::Legend )
-            && ( d_data->legendAttributes & QwtPolarCurve::LegendShowSymbol )
-            && d_data->symbol
-            && d_data->symbol->style() != QwtSymbol::NoSymbol )
-    {
-        QWidget *lgdItem = legend->find( this );
-        if ( lgdItem == NULL )
-        {
-            lgdItem = legendItem();
-            if ( lgdItem )
-                legend->insert( this, lgdItem );
-        }
-
-        QwtLegendItem *l = qobject_cast<QwtLegendItem *>( lgdItem );
-        if ( l )
-        {
-            QSize sz = d_data->symbol->boundingSize();
-            sz += QSize( 2, 2 ); // margin
-
-            if ( d_data->legendAttributes & QwtPolarCurve::LegendShowLine )
-            {
-                // Avoid, that the line is completely covered by the symbol
-
-                int w = qCeil( 1.5 * sz.width() );
-                if ( w % 2 )
-                    w++;
-
-                sz.setWidth( qMax( 8, w ) );
-            }
-
-            l->setIdentifierSize( sz );
-        }
-    }
-
-    QwtPolarItem::updateLegend( legend );
-}
-
-/*!
-  \brief Draw the identifier representing the curve on the legend
-
-  \param painter Qt Painter
-  \param rect Bounding rectangle for the identifier
-
-  \sa setLegendAttribute
-*/
-void QwtPolarCurve::drawLegendIdentifier(
-    QPainter *painter, const QRectF &rect ) const
-{
-    if ( rect.isEmpty() )
-        return;
-
-    const double dim = qMin( rect.width(), rect.height() );
-
-    QSizeF size( dim, dim );
-
-    QRectF r( 0, 0, size.width(), size.height() );
-    r.moveCenter( rect.center() );
+/*!
+   \return Icon representing the curve on the legend
+
+   \param index Index of the legend entry 
+                ( ignored as there is only one )
+   \param size Icon size
+
+   \sa QwtPolarItem::setLegendIconSize(), QwtPolarItem::legendData()
+ */
+QwtGraphic QwtPolarCurve::legendIcon( int index,
+    const QSizeF &size ) const
+{
+    Q_UNUSED( index );
+
+    if ( size.isEmpty() )
+        return QwtGraphic();
+
+    QwtGraphic graphic;
+    graphic.setDefaultSize( size );
+    graphic.setRenderHint( QwtGraphic::RenderPensUnscaled, true );
+
+    QPainter painter( &graphic );
+    painter.setRenderHint( QPainter::Antialiasing,
+        testRenderHint( QwtPolarItem::RenderAntialiased ) );
 
     if ( d_data->legendAttributes == 0 )
     {
         QBrush brush;
+
         if ( style() != QwtPolarCurve::NoCurve )
+        {
             brush = QBrush( pen().color() );
+        }
         else if ( d_data->symbol &&
             ( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
@@ -572,43 +538,36 @@
             brush = QBrush( d_data->symbol->pen().color() );
         }
+
         if ( brush.style() != Qt::NoBrush )
-            painter->fillRect( r, brush );
-    }
+        {
+            QRectF r( 0, 0, size.width(), size.height() );
+            painter.fillRect( r, brush );
+        }
+    }
+
     if ( d_data->legendAttributes & QwtPolarCurve::LegendShowLine )
     {
         if ( pen() != Qt::NoPen )
         {
-            painter->setPen( pen() );
-            QwtPainter::drawLine( painter, rect.left(), rect.center().y(),
-                rect.right() - 1.0, rect.center().y() );
-        }
-    }
+            QPen pn = pen();
+            pn.setCapStyle( Qt::FlatCap );
+
+            painter.setPen( pn );
+
+            const double y = 0.5 * size.height();
+            QwtPainter::drawLine( &painter, 0.0, y, size.width(), y );
+        }
+    }
+
     if ( d_data->legendAttributes & QwtPolarCurve::LegendShowSymbol )
     {
-        if ( d_data->symbol &&
-            ( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
-        {
-            QSize symbolSize = d_data->symbol->boundingSize();
-            symbolSize -= QSize( 2, 2 );
-
-            // scale the symbol size down if it doesn't fit into rect.
-
-            double xRatio = 1.0;
-            if ( rect.width() < symbolSize.width() )
-                xRatio = rect.width() / symbolSize.width();
-            double yRatio = 1.0;
-            if ( rect.height() < symbolSize.height() )
-                yRatio = rect.height() / symbolSize.height();
-
-            const double ratio = qMin( xRatio, yRatio );
-
-            painter->save();
-            painter->scale( ratio, ratio );
-
-            d_data->symbol->drawSymbol( painter, rect.center() / ratio );
-
-            painter->restore();
-        }
-    }
+        if ( d_data->symbol )
+        {
+            QRectF r( 0, 0, size.width(), size.height() );
+            d_data->symbol->drawSymbol( &painter, r );
+        }
+    }
+
+    return graphic;
 }
 
@@ -634,2 +593,4 @@
     return QwtInterval();
 }
+
+
Index: trunk/BNC/qwtpolar/qwt_polar_curve.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_curve.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_curve.h	(revision 8127)
@@ -58,6 +58,5 @@
         In the default setting all attributes are off.
 
-        \sa setLegendAttribute(), testLegendAttribute(),
-            drawLegendIdentifier()
+        \sa setLegendAttribute(), testLegendAttribute()
      */
 
@@ -101,5 +100,5 @@
     CurveStyle style() const;
 
-    void setSymbol( const QwtSymbol * );
+    void setSymbol( QwtSymbol * );
     const QwtSymbol *symbol() const;
 
@@ -116,8 +115,7 @@
         const QPointF &pole, int from, int to ) const;
 
-    virtual void updateLegend( QwtLegend * ) const;
     virtual QwtInterval boundingInterval( int scaleId ) const;
 
-    virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const;
+    virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
 
 protected:
Index: trunk/BNC/qwtpolar/qwt_polar_global.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_global.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_global.h	(revision 8127)
@@ -14,8 +14,6 @@
 // QWT_POLAR_VERSION is (major << 16) + (minor << 8) + patch.
 
-#define QWT_POLAR_VERSION       0x010000
-#define QWT_POLAR_VERSION_STR   "1.0.0"
-
-#if defined(Q_WS_WIN) || defined(Q_WS_S60)
+#define QWT_POLAR_VERSION       0x010101
+#define QWT_POLAR_VERSION_STR   "1.1.1"
 
 #if defined(_MSC_VER) /* MSVC Compiler */
@@ -26,14 +24,12 @@
 #ifdef QWT_POLAR_DLL
 
-#if defined(QWT_POLAR_MAKEDLL)     // create a Qwt DLL library 
-#define QWT_POLAR_EXPORT  __declspec(dllexport)
+#if defined(QWT_POLAR_MAKEDLL)     // create DLL library 
+#define QWT_POLAR_EXPORT  Q_DECL_EXPORT
 #define QWT_POLAR_TEMPLATEDLL
-#else                        // use a Qwt DLL library
-#define QWT_POLAR_EXPORT  __declspec(dllimport)
+#else                        // use DLL library
+#define QWT_POLAR_EXPORT  Q_DECL_IMPORT
 #endif
 
-#endif // QWT_POLAR_MAKEDLL
-
-#endif // Q_WS_WIN
+#endif // QWT_POLAR_DLL
 
 #ifndef QWT_POLAR_EXPORT
Index: trunk/BNC/qwtpolar/qwt_polar_grid.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_grid.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_grid.cpp	(revision 8127)
@@ -877,5 +877,10 @@
 
             scaleDraw->setAngleRange( from, from - 360.0 );
-            scaleDraw->setTransformation( azimuthMap.transformation()->copy() );
+
+            const QwtTransform *transform = azimuthMap.transformation();
+            if ( transform )
+                scaleDraw->setTransformation( transform->copy() );
+            else
+                scaleDraw->setTransformation( NULL );
         }
         else
@@ -911,5 +916,9 @@
                 }
             }
-            scaleDraw->setTransformation( radialMap.transformation()->copy() );
+            const QwtTransform *transform = radialMap.transformation();
+            if ( transform )
+                scaleDraw->setTransformation( transform->copy() );
+            else
+                scaleDraw->setTransformation( NULL );
         }
     }
@@ -976,6 +985,5 @@
                 QwtScaleDiv sd = radialGrid.scaleDiv;
 
-                QList<double> &ticks =
-                    const_cast<QList<double> &>( sd.ticks( QwtScaleDiv::MajorTick ) );
+                QList<double> ticks = sd.ticks( QwtScaleDiv::MajorTick );
 
                 if ( testDisplayFlag( SmartOriginLabel ) )
@@ -1011,4 +1019,5 @@
                 }
 
+                sd.setTicks( QwtScaleDiv::MajorTick, ticks );
                 axis.scaleDraw->setScaleDiv( sd );
 
@@ -1049,5 +1058,5 @@
 const QwtScaleDraw *QwtPolarGrid::scaleDraw( int axisId ) const
 {
-    if ( axisId >= QwtPolar::AxisLeft || axisId <= QwtPolar::AxisBottom )
+    if ( axisId >= QwtPolar::AxisLeft && axisId <= QwtPolar::AxisBottom )
         return static_cast<QwtScaleDraw *>( d_data->axisData[axisId].scaleDraw );
 
@@ -1064,5 +1073,5 @@
 QwtScaleDraw *QwtPolarGrid::scaleDraw( int axisId )
 {
-    if ( axisId >= QwtPolar::AxisLeft || axisId <= QwtPolar::AxisBottom )
+    if ( axisId >= QwtPolar::AxisLeft && axisId <= QwtPolar::AxisBottom )
         return static_cast<QwtScaleDraw *>( d_data->axisData[axisId].scaleDraw );
 
Index: trunk/BNC/qwtpolar/qwt_polar_item.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_item.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_item.cpp	(revision 8127)
@@ -10,5 +10,4 @@
 #include "qwt_polar_item.h"
 #include <qwt_legend.h>
-#include <qwt_legend_item.h>
 #include <qwt_scale_div.h>
 #include <qpainter.h>
@@ -22,5 +21,7 @@
         attributes( 0 ),
         renderHints( 0 ),
-        z( 0.0 )
+        renderThreadCount( 1 ),
+        z( 0.0 ),
+        legendIconSize( 8, 8 )
     {
     }
@@ -31,7 +32,10 @@
     QwtPolarItem::ItemAttributes attributes;
     QwtPolarItem::RenderHints renderHints;
+    uint renderThreadCount;
+
     double z;
 
     QwtText title;
+    QSize legendIconSize;
 };
 
@@ -74,26 +78,23 @@
         return;
 
-    // remove the item from the previous plot
-
     if ( d_data->plot )
-    {
-        if ( d_data->plot->legend() )
-            d_data->plot->legend()->remove( this );
-
         d_data->plot->attachItem( this, false );
 
-        if ( d_data->plot->autoReplot() )
-            d_data->plot->update();
-    }
-
     d_data->plot = plot;
 
     if ( d_data->plot )
-    {
-        // insert the item into the current plot
-
         d_data->plot->attachItem( this, true );
-        itemChanged();
-    }
+}
+
+/*!
+   \brief This method detaches a QwtPolarItem from the QwtPolarPlot it
+          has been associated with.
+
+   detach() is equivalent to calling attach( NULL )
+   \sa attach()
+*/
+void QwtPolarItem::detach() 
+{ 
+    attach( NULL ); 
 }
 
@@ -257,4 +258,58 @@
 }
 
+/*!
+   On multi core systems rendering of certain plot item 
+   ( f.e QwtPolarSpectrogram ) can be done in parallel in 
+   several threads.
+
+   The default setting is set to 1.
+
+   \param numThreads Number of threads to be used for rendering.
+                     If numThreads is set to 0, the system specific
+                     ideal thread count is used.
+
+   The default thread count is 1 ( = no additional threads )
+*/
+void QwtPolarItem::setRenderThreadCount( uint numThreads )
+{
+    d_data->renderThreadCount = numThreads;
+}
+
+/*!
+   \return Number of threads to be used for rendering.
+           If numThreads() is set to 0, the system specific
+           ideal thread count is used.
+*/
+uint QwtPolarItem::renderThreadCount() const
+{
+    return d_data->renderThreadCount;
+}
+
+/*!
+   Set the size of the legend icon
+
+   The default setting is 8x8 pixels
+
+   \param size Size
+   \sa legendIconSize(), legendIcon()
+*/
+void QwtPolarItem::setLegendIconSize( const QSize &size )
+{
+    if ( d_data->legendIconSize != size )
+    {
+        d_data->legendIconSize = size;
+        legendChanged();
+    }
+}
+
+/*!
+   \return Legend icon size
+   \sa setLegendIconSize(), legendIcon()
+*/
+QSize QwtPolarItem::legendIconSize() const
+{
+    return d_data->legendIconSize;
+}
+
 //! Show the item
 void QwtPolarItem::show()
@@ -302,10 +357,15 @@
 {
     if ( d_data->plot )
-    {
-        if ( d_data->plot->legend() )
-            updateLegend( d_data->plot->legend() );
-
         d_data->plot->autoRefresh();
-    }
+}
+
+/*!
+   Update the legend of the parent plot.
+   \sa QwtPolarPlot::updateLegend(), itemChanged()
+*/
+void QwtPolarItem::legendChanged()
+{
+    if ( testItemAttribute( QwtPolarItem::Legend ) && d_data->plot )
+        d_data->plot->updateLegend( this );
 }
 
@@ -351,92 +411,63 @@
 
 /*!
-   \brief Update the widget that represents the item on the legend
-
-   updateLegend() is called from itemChanged() to adopt the widget
-   representing the item on the legend to its new configuration.
-
-   The default implementation is made for QwtPolarCurve and updates a
-   QwtLegendItem(), but an item could be represented by any type of widget,
-   by overloading legendItem() and updateLegend().
-
-   \sa legendItem(), itemChanged(), QwtLegend()
-*/
-void QwtPolarItem::updateLegend( QwtLegend *legend ) const
-{
-    if ( legend == NULL )
-        return;
-
-    QWidget *lgdItem = legend->find( this );
-    if ( testItemAttribute( QwtPolarItem::Legend ) )
-    {
-        if ( lgdItem == NULL )
-        {
-            lgdItem = legendItem();
-            if ( lgdItem )
-                legend->insert( this, lgdItem );
-        }
-
-        QwtLegendItem* label = qobject_cast<QwtLegendItem *>( lgdItem );
-        if ( label )
-        {
-            // paint the identifier
-            const QSize sz = label->identifierSize();
-
-            QPixmap identifier( sz.width(), sz.height() );
-            identifier.fill( Qt::transparent );
-
-            QPainter painter( &identifier );
-            painter.setRenderHint( QPainter::Antialiasing,
-                testRenderHint( QwtPolarItem::RenderAntialiased ) );
-
-            drawLegendIdentifier( &painter,
-                QRect( 0, 0, sz.width(), sz.height() ) );
-
-            painter.end();
-
-            const bool doUpdate = label->updatesEnabled();
-            if ( doUpdate )
-                label->setUpdatesEnabled( false );
-
-            label->setText( title() );
-            label->setIdentifier( identifier );
-            label->setItemMode( legend->itemMode() );
-
-            if ( doUpdate )
-                label->setUpdatesEnabled( true );
-
-            label->update();
-        }
-    }
-    else
-    {
-        if ( lgdItem )
-        {
-            lgdItem->hide();
-            lgdItem->deleteLater();
-        }
-    }
-}
-/*!
-   \brief Allocate the widget that represents the item on the legend
-
-   The default implementation is made for QwtPolarCurve and returns a
-   QwtLegendItem(), but an item could be represented by any type of widget,
-   by overloading legendItem() and updateLegend().
-
-   \return QwtLegendItem()
-   \sa updateLegend() QwtLegend()
-*/
-QWidget *QwtPolarItem::legendItem() const
-{
-    QwtLegendItem *item = new QwtLegendItem;
-    if ( d_data->plot )
-    {
-        QObject::connect( item, SIGNAL( clicked() ),
-            d_data->plot, SLOT( legendItemClicked() ) );
-        QObject::connect( item, SIGNAL( checked( bool ) ),
-            d_data->plot, SLOT( legendItemChecked( bool ) ) );
-    }
-    return item;
+   \brief Return all information, that is needed to represent
+          the item on the legend
+
+   Most items are represented by one entry on the legend
+   showing an icon and a text.
+
+   QwtLegendData is basically a list of QVariants that makes it
+   possible to overload and reimplement legendData() to 
+   return almost any type of information, that is understood
+   by the receiver that acts as the legend.
+
+   The default implementation returns one entry with 
+   the title() of the item and the legendIcon().
+
+   \sa title(), legendIcon(), QwtLegend
+ */
+QList<QwtLegendData> QwtPolarItem::legendData() const
+{
+    QwtLegendData data;
+
+    QwtText label = title();
+    label.setRenderFlags( label.renderFlags() & Qt::AlignLeft );
+
+    QVariant titleValue;
+    qVariantSetValue( titleValue, label );
+    data.setValue( QwtLegendData::TitleRole, titleValue );
+
+    const QwtGraphic graphic = legendIcon( 0, legendIconSize() );
+    if ( !graphic.isNull() )
+    {
+        QVariant iconValue;
+        qVariantSetValue( iconValue, graphic );
+        data.setValue( QwtLegendData::IconRole, iconValue );
+    }
+
+    QList<QwtLegendData> list;
+    list += data;
+
+    return list;
+}
+
+/*!
+   \return Icon representing the item on the legend
+
+   The default implementation returns an invalid icon
+
+   \param index Index of the legend entry 
+                ( usually there is only one )
+   \param size Icon size
+
+   \sa setLegendIconSize(), legendData()
+ */
+QwtGraphic QwtPolarItem::legendIcon(
+    int index, const QSizeF &size ) const
+{
+    Q_UNUSED( index )
+    Q_UNUSED( size )
+
+    return QwtGraphic();
 }
 
Index: trunk/BNC/qwtpolar/qwt_polar_item.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_item.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_item.h	(revision 8127)
@@ -12,5 +12,6 @@
 #include "qwt_polar_global.h"
 #include <qwt_text.h>
-#include <qwt_legend_itemmanager.h>
+#include <qwt_legend_data.h>
+#include <qwt_graphic.h>
 #include <qwt_interval.h>
 
@@ -34,5 +35,5 @@
   types of items.
 */
-class QWT_POLAR_EXPORT QwtPolarItem: public QwtLegendItemManager
+class QWT_POLAR_EXPORT QwtPolarItem
 {
 public:
@@ -103,13 +104,5 @@
 
     void attach( QwtPolarPlot *plot );
-
-    /*!
-       \brief This method detaches a QwtPolarItem from any QwtPolarPlot it
-              has been associated with.
-
-       detach() is equivalent to calling attach( NULL )
-       \sa attach( QwtPolarPlot* plot )
-    */
-    void detach() { attach( NULL ); }
+    void detach();
 
     QwtPolarPlot *plot() const;
@@ -127,4 +120,7 @@
     bool testRenderHint( RenderHint ) const;
 
+    void setRenderThreadCount( uint numThreads );
+    uint renderThreadCount() const;
+
     double z() const;
     void setZ( double z );
@@ -136,4 +132,5 @@
 
     virtual void itemChanged();
+    virtual void legendChanged();
 
     /*!
@@ -154,11 +151,14 @@
     virtual QwtInterval boundingInterval( int scaleId ) const;
 
-    virtual QWidget *legendItem() const;
-
-    virtual void updateLegend( QwtLegend * ) const;
     virtual void updateScaleDiv( const QwtScaleDiv &,
         const QwtScaleDiv &, const QwtInterval & );
 
     virtual int marginHint() const;
+
+    void setLegendIconSize( const QSize & );
+    QSize legendIconSize() const;
+
+    virtual QList<QwtLegendData> legendData() const;
+    virtual QwtGraphic legendIcon( int index, const QSizeF  & ) const;
 
 private:
@@ -174,3 +174,5 @@
 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::RenderHints )
 
+Q_DECLARE_METATYPE( QwtPolarItem * )
+
 #endif
Index: trunk/BNC/qwtpolar/qwt_polar_itemdict.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_itemdict.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_itemdict.cpp	(revision 8127)
@@ -110,21 +110,23 @@
 
 /*!
-   Attach/Detach a plot item
+  Insert a plot item
 
-   Attached items will be deleted in the destructor,
-   if auto deletion is enabled (default). Manually detached
-   items are not deleted.
+  \param item PlotItem
+  \sa removeItem()
+ */
+void QwtPolarItemDict::insertItem( QwtPolarItem *item )
+{
+    d_data->itemList.insertItem( item );
+}
 
-   \param item Plot item to attach/detach
-   \ on If true attach, else detach the item
+/*!
+  Remove a plot item
 
-   \sa setAutoDelete, ~QwtPolarItemDict
-*/
-void QwtPolarItemDict::attachItem( QwtPolarItem *item, bool on )
+  \param item PlotItem
+  \sa insertItem()
+ */
+void QwtPolarItemDict::removeItem( QwtPolarItem *item )
 {
-    if ( on )
-        d_data->itemList.insertItem( item );
-    else
-        d_data->itemList.removeItem( item );
+    d_data->itemList.removeItem( item );
 }
 
Index: trunk/BNC/qwtpolar/qwt_polar_itemdict.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_itemdict.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_itemdict.h	(revision 8127)
@@ -44,9 +44,9 @@
         bool autoDelete = true );
 
+protected:
+    void insertItem( QwtPolarItem * );
+    void removeItem( QwtPolarItem * );
+
 private:
-    friend class QwtPolarItem;
-
-    void attachItem( QwtPolarItem *, bool );
-
     class PrivateData;
     PrivateData *d_data;
Index: trunk/BNC/qwtpolar/qwt_polar_layout.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_layout.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_layout.cpp	(revision 8127)
@@ -23,6 +23,6 @@
     {
         int frameWidth;
-        int vScrollBarWidth;
-        int hScrollBarHeight;
+        int hScrollExtent;
+        int vScrollExtent;
         QSizeF hint;
     } legend;
@@ -49,8 +49,8 @@
     {
         legend.frameWidth = plot->legend()->frameWidth();
-        legend.vScrollBarWidth =
-            plot->legend()->verticalScrollBar()->sizeHint().width();
-        legend.hScrollBarHeight =
-            plot->legend()->horizontalScrollBar()->sizeHint().height();
+        legend.hScrollExtent =
+            plot->legend()->scrollExtent( Qt::Horizontal );
+        legend.vScrollExtent =
+            plot->legend()->scrollExtent( Qt::Vertical );
 
         const QSizeF hint = plot->legend()->sizeHint();
@@ -62,5 +62,5 @@
 
         if ( h > rect.height() )
-            w += legend.vScrollBarWidth;
+            w += legend.hScrollExtent;
 
         legend.hint = QSizeF( w, h );
@@ -279,5 +279,5 @@
         // half of the available space.
 
-        dim = qMin( hint.width(), qreal(rect.width() * d_data->legendRatio) );
+        dim = qMin( double( hint.width() ), rect.width() * d_data->legendRatio );
 
         if ( !( options & IgnoreScrollbars ) )
@@ -288,5 +288,5 @@
                 // space for the vertical scrollbar.
 
-                dim += d_data->layoutData.legend.vScrollBarWidth;
+                dim += d_data->layoutData.legend.hScrollExtent;
             }
         }
@@ -294,6 +294,6 @@
     else
     {
-        dim = qMin( hint.width(), qreal(rect.width() * d_data->legendRatio) );
-        dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
+        dim = qMin( double( hint.height() ), rect.height() * d_data->legendRatio );
+        dim = qMax( dim, d_data->layoutData.legend.vScrollExtent );
     }
 
Index: trunk/BNC/qwtpolar/qwt_polar_plot.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_plot.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_plot.cpp	(revision 8127)
@@ -16,5 +16,4 @@
 #include <qwt_round_scale_draw.h>
 #include <qwt_legend.h>
-#include <qwt_legend_item.h>
 #include <qwt_dyngrid_layout.h>
 #include <qpointer.h>
@@ -35,4 +34,5 @@
 public:
     ScaleData():
+        isValid( false ),
         scaleEngine( NULL )
     {
@@ -53,4 +53,6 @@
     int maxMinor;
 
+    bool isValid;
+
     QwtScaleDiv scaleDiv;
     QwtScaleEngine *scaleEngine;
@@ -70,5 +72,5 @@
     QPointer<QwtTextLabel> titleLabel;
     QPointer<QwtPolarCanvas> canvas;
-    QPointer<QwtLegend> legend;
+    QPointer<QwtAbstractLegend> legend;
     double azimuthOrigin;
 
@@ -183,8 +185,9 @@
       QwtPolarLayout::setLegendPosition()
 */
-void QwtPolarPlot::insertLegend( QwtLegend *legend,
+void QwtPolarPlot::insertLegend( QwtAbstractLegend *legend,
     QwtPolarPlot::LegendPosition pos, double ratio )
 {
     d_data->layout->setLegendPosition( pos, ratio );
+
     if ( legend != d_data->legend )
     {
@@ -196,41 +199,79 @@
         if ( d_data->legend )
         {
-            if ( pos != ExternalLegend )
+            connect( this,
+                SIGNAL( legendDataChanged(
+                    const QVariant &, const QList<QwtLegendData> & ) ),
+                d_data->legend,
+                SLOT( updateLegend(
+                    const QVariant &, const QList<QwtLegendData> & ) )
+            );
+
+            if ( d_data->legend->parent() != this )
+                d_data->legend->setParent( this );
+
+            updateLegend();
+
+            QwtLegend *lgd = qobject_cast<QwtLegend *>( legend );
+            if ( lgd )
             {
-                if ( d_data->legend->parent() != this )
-                    d_data->legend->setParent( this );
-            }
-
-            const QwtPolarItemList& itmList = itemList();
-            for ( QwtPolarItemIterator it = itmList.begin();
-                    it != itmList.end(); ++it )
-            {
-                ( *it )->updateLegend( d_data->legend );
-            }
-
-            QwtDynGridLayout *tl = qobject_cast<QwtDynGridLayout *>(
-                d_data->legend->contentsWidget()->layout() );
-
-            if ( tl )
-            {
-                switch( d_data->layout->legendPosition() )
+                switch ( d_data->layout->legendPosition() )
                 {
                     case LeftLegend:
                     case RightLegend:
-                        tl->setMaxCols( 1 ); // 1 column: align vertical
+                    {
+                        if ( lgd->maxColumns() == 0     )
+                            lgd->setMaxColumns( 1 ); // 1 column: align vertical
                         break;
-
+                    }
                     case TopLegend:
                     case BottomLegend:
-                        tl->setMaxCols( 0 ); // unlimited
+                    {
+                        lgd->setMaxColumns( 0 ); // unlimited
                         break;
-
-                    case ExternalLegend:
+                    }
+                    default:
                         break;
                 }
             }
-        }
-    }
+
+        }
+    }
+
     updateLayout();
+}
+
+/*!
+  Emit legendDataChanged() for all plot item
+
+  \sa QwtPlotItem::legendData(), legendDataChanged()
+ */
+void QwtPolarPlot::updateLegend()
+{
+    const QwtPolarItemList& itmList = itemList();
+    for ( QwtPolarItemIterator it = itmList.begin();
+        it != itmList.end(); ++it )
+    {
+        updateLegend( *it );
+    }
+}
+
+/*!
+  Emit legendDataChanged() for a plot item
+
+  \param plotItem Plot item
+  \sa QwtPlotItem::legendData(), legendDataChanged()
+ */
+void QwtPolarPlot::updateLegend( const QwtPolarItem *plotItem )
+{
+    if ( plotItem == NULL )
+        return;
+
+    QList<QwtLegendData> legendData;
+
+    if ( plotItem->testItemAttribute( QwtPolarItem::Legend ) )
+        legendData = plotItem->legendData();
+
+    const QVariant itemInfo = itemToInfo( const_cast< QwtPolarItem *>( plotItem) );
+    Q_EMIT legendDataChanged( itemInfo, legendData );
 }
 
@@ -239,5 +280,5 @@
   \sa insertLegend()
 */
-QwtLegend *QwtPolarPlot::legend()
+QwtAbstractLegend *QwtPolarPlot::legend()
 {
     return d_data->legend;
@@ -248,37 +289,7 @@
   \sa insertLegend()
 */
-const QwtLegend *QwtPolarPlot::legend() const
+const QwtAbstractLegend *QwtPolarPlot::legend() const
 {
     return d_data->legend;
-}
-
-/*!
-  Called internally when the legend has been clicked on.
-  Emits a legendClicked() signal.
-*/
-void QwtPolarPlot::legendItemClicked()
-{
-    if ( d_data->legend && sender()->isWidgetType() )
-    {
-        QwtPolarItem *plotItem = static_cast< QwtPolarItem* >(
-            d_data->legend->find( qobject_cast<const QWidget *>( sender() ) ) );
-        if ( plotItem )
-            Q_EMIT legendClicked( plotItem );
-    }
-}
-
-/*!
-  Called internally when the legend has been checked
-  Emits a legendClicked() signal.
-*/
-void QwtPolarPlot::legendItemChecked( bool on )
-{
-    if ( d_data->legend && sender()->isWidgetType() )
-    {
-        QwtPolarItem *plotItem = static_cast< QwtPolarItem* >(
-            d_data->legend->find( qobject_cast<const QWidget *>( sender() ) ) );
-        if ( plotItem )
-            Q_EMIT legendChecked( plotItem, on );
-    }
 }
 
@@ -389,8 +400,5 @@
         return;
 
-    if ( maxMinor < 0 )
-        maxMinor = 0;
-    if ( maxMinor > 100 )
-        maxMinor = 100;
+    maxMinor = qBound( 0, maxMinor, 100 );
 
     ScaleData &scaleData = d_data->scaleData[scaleId];
@@ -399,5 +407,5 @@
     {
         scaleData.maxMinor = maxMinor;
-        scaleData.scaleDiv.invalidate();
+        scaleData.isValid = false;
         autoRefresh();
     }
@@ -429,8 +437,5 @@
         return;
 
-    if ( maxMajor < 1 )
-        maxMajor = 1;
-    if ( maxMajor > 1000 )
-        maxMajor = 10000;
+    maxMajor = qBound( 1, maxMajor, 10000 );
 
     ScaleData &scaleData = d_data->scaleData[scaleId];
@@ -438,5 +443,5 @@
     {
         scaleData.maxMajor = maxMajor;
-        scaleData.scaleDiv.invalidate();
+        scaleData.isValid = false;
         autoRefresh();
     }
@@ -477,5 +482,5 @@
     scaleData.scaleEngine = scaleEngine;
 
-    scaleData.scaleDiv.invalidate();
+    scaleData.isValid = false;
 
     autoRefresh();
@@ -527,5 +532,5 @@
     ScaleData &scaleData = d_data->scaleData[scaleId];
 
-    scaleData.scaleDiv.invalidate();
+    scaleData.isValid = false;
 
     scaleData.minValue = min;
@@ -551,4 +556,5 @@
 
     scaleData.scaleDiv = scaleDiv;
+    scaleData.isValid = true;
     scaleData.doAutoScale = false;
 
@@ -732,5 +738,5 @@
     {
         map.setPaintInterval( d_data->azimuthOrigin,
-            d_data->azimuthOrigin + M_2PI );
+            d_data->azimuthOrigin + 2 * M_PI );
     }
     else
@@ -820,6 +826,7 @@
         scaleData.maxMajor = 8;
 
+        scaleData.isValid = false;
+
         scaleData.scaleEngine = new QwtLinearScaleEngine;
-        scaleData.scaleDiv.invalidate();
     }
     d_data->zoomFactor = 1.0;
@@ -858,14 +865,16 @@
     }
 
-    if ( d_data->legend &&
-        d_data->layout->legendPosition() != ExternalLegend )
-    {
-        if ( d_data->legend->itemCount() > 0 )
-        {
-            d_data->legend->setGeometry( d_data->layout->legendRect().toRect() );
+    if ( d_data->legend )
+    {
+        if ( d_data->legend->isEmpty() )
+        {
+            d_data->legend->hide();
+        }
+        else
+        {
+            const QRectF legendRect = d_data->layout->legendRect();
+            d_data->legend->setGeometry( legendRect.toRect() );
             d_data->legend->show();
         }
-        else
-            d_data->legend->hide();
     }
 
@@ -1054,11 +1063,12 @@
         d.scaleEngine->autoScale( d.maxMajor,
                                   minValue, maxValue, stepSize );
-        d.scaleDiv.invalidate();
-    }
-
-    if ( !d.scaleDiv.isValid() )
+        d.isValid = false;
+    }
+
+    if ( !d.isValid )
     {
         d.scaleDiv = d.scaleEngine->divideScale(
             minValue, maxValue, d.maxMajor, d.maxMinor, stepSize );
+        d.isValid = true;
     }
 
@@ -1270,2 +1280,83 @@
     return d_data->layout;
 }
+
+/*!
+  \brief Attach/Detach a plot item 
+
+  \param plotItem Plot item
+  \param on When true attach the item, otherwise detach it
+ */
+void QwtPolarPlot::attachItem( QwtPolarItem *plotItem, bool on )
+{
+    if ( on )
+        insertItem( plotItem );
+    else
+        removeItem( plotItem );
+
+    Q_EMIT itemAttached( plotItem, on );
+
+    if ( plotItem->testItemAttribute( QwtPolarItem::Legend ) )
+    {
+        // the item wants to be represented on the legend
+
+        if ( on )
+        {
+            updateLegend( plotItem );
+        }
+        else
+        {
+            const QVariant itemInfo = itemToInfo( plotItem );
+            Q_EMIT legendDataChanged( itemInfo, QList<QwtLegendData>() );
+        }
+    }
+
+    if ( autoReplot() )
+        update();
+}
+
+/*!
+  \brief Build an information, that can be used to identify
+         a plot item on the legend.
+
+  The default implementation simply wraps the plot item
+  into a QVariant object. When overloading itemToInfo()
+  usually infoToItem() needs to reimplemeted too.
+
+\code
+    QVariant itemInfo;
+    qVariantSetValue( itemInfo, plotItem );
+\endcode
+
+  \param plotItem Plot item
+  \sa infoToItem()
+ */
+QVariant QwtPolarPlot::itemToInfo( QwtPolarItem *plotItem ) const
+{
+    QVariant itemInfo;
+    qVariantSetValue( itemInfo, plotItem );
+
+    return itemInfo;
+}
+
+/*!
+  \brief Identify the plot item according to an item info object,
+         that has bee generated from itemToInfo().
+
+  The default implementation simply tries to unwrap a QwtPlotItem 
+  pointer:
+
+\code
+    if ( itemInfo.canConvert<QwtPlotItem *>() )
+        return qvariant_cast<QwtPlotItem *>( itemInfo );
+\endcode
+  \param itemInfo Plot item
+  \return A plot item, when successful, otherwise a NULL pointer.
+  \sa itemToInfo()
+*/
+QwtPolarItem *QwtPolarPlot::infoToItem( const QVariant &itemInfo ) const
+{
+    if ( itemInfo.canConvert<QwtPolarItem *>() )
+        return qvariant_cast<QwtPolarItem *>( itemInfo );
+
+    return NULL;
+}
Index: trunk/BNC/qwtpolar/qwt_polar_plot.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_plot.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_plot.h	(revision 8127)
@@ -24,4 +24,5 @@
 class QwtPolarCanvas;
 class QwtPolarLayout;
+class QwtAbstractLegend;
 
 /*!
@@ -141,9 +142,12 @@
     // Legend
 
-    void insertLegend( QwtLegend *,
+    void insertLegend( QwtAbstractLegend *,
         LegendPosition = RightLegend, double ratio = -1.0 );
 
-    QwtLegend *legend();
-    const QwtLegend *legend() const;
+    QwtAbstractLegend *legend();
+    const QwtAbstractLegend *legend() const;
+
+    void updateLegend();
+    void updateLegend( const QwtPolarItem * );
 
     // Layout
@@ -157,29 +161,26 @@
     int plotMarginHint() const;
 
+    virtual QVariant itemToInfo( QwtPolarItem * ) const;
+    virtual QwtPolarItem *infoToItem( const QVariant & ) const;
+
 Q_SIGNALS:
     /*!
-      A signal which is emitted when the user has clicked on
-      a legend item, which is in QwtLegend::ClickableItem mode.
-
-      \param plotItem Corresponding plot item of the
-                 selected legend item
-
-      \note clicks are disabled as default
-      \sa QwtLegend::setItemMode, QwtLegend::itemMode
-     */
-    void legendClicked( QwtPolarItem *plotItem );
-
-    /*!
-      A signal which is emitted when the user has clicked on
-      a legend item, which is in QwtLegend::CheckableItem mode
-
-      \param plotItem Corresponding plot item of the
-                 selected legend item
-      \param on True when the legen item is checked
-
-      \note clicks are disabled as default
-      \sa QwtLegend::setItemMode, QwtLegend::itemMode
-     */
-    void legendChecked( QwtPolarItem *plotItem, bool on );
+      A signal indicating, that an item has been attached/detached
+
+      \param plotItem Plot item
+      \param on Attached/Detached
+     */
+    void itemAttached( QwtPolarItem *plotItem, bool on );
+
+    /*! 
+      A signal with the attributes how to update 
+      the legend entries for a plot item.
+                
+      \param itemInfo Info about a plot, build from itemToInfo()
+    
+      \sa itemToInfo(), infoToItem(), QwtAbstractLegend::updateLegend()
+     */
+    void legendDataChanged( const QVariant &itemInfo,
+        const QList<QwtLegendData> &data );
 
     /*!
@@ -194,8 +195,4 @@
     void setAzimuthOrigin( double );
 
-protected Q_SLOTS:
-    virtual void legendItemClicked();
-    virtual void legendItemChecked( bool );
-
 protected:
     virtual bool event( QEvent * );
@@ -210,4 +207,7 @@
 
 private:
+    friend class QwtPolarItem;
+    void attachItem( QwtPolarItem *, bool );
+
     void initPlot( const QwtText & );
 
Index: trunk/BNC/qwtpolar/qwt_polar_renderer.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_renderer.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_renderer.cpp	(revision 8127)
@@ -11,5 +11,4 @@
 #include "qwt_polar_layout.h"
 #include <qwt_legend.h>
-#include <qwt_legend_item.h>
 #include <qwt_dyngrid_layout.h>
 #include <qwt_text_label.h>
@@ -17,4 +16,6 @@
 #include <qpainter.h>
 #include <qprinter.h>
+#include <qprintdialog.h>
+#include <qfiledialog.h>
 #include <qimagewriter.h>
 #include <qfileinfo.h>
@@ -115,17 +116,37 @@
 
     const QString fmt = format.toLower();
-    if ( format == "pdf" || format == "ps" )
-    {
+    if ( format == "pdf" )
+    {
+#ifndef QT_NO_PRINTER
         QPrinter printer;
+        printer.setColorMode( QPrinter::Color );
         printer.setFullPage( true );
         printer.setPaperSize( sizeMM, QPrinter::Millimeter );
         printer.setDocName( title );
         printer.setOutputFileName( fileName );
-        printer.setOutputFormat( ( format == "pdf" )
-            ? QPrinter::PdfFormat : QPrinter::PostScriptFormat );
+        printer.setOutputFormat( QPrinter::PdfFormat );
         printer.setResolution( resolution );
 
         QPainter painter( &printer );
         render( plot, &painter, documentRect );
+#endif
+    }
+    else if ( format == "ps" )
+    {
+#if QT_VERSION < 0x050000
+#ifndef QT_NO_PRINTER
+        QPrinter printer;
+        printer.setColorMode( QPrinter::Color );
+        printer.setFullPage( true );
+        printer.setPaperSize( sizeMM, QPrinter::Millimeter );
+        printer.setDocName( title );
+        printer.setOutputFileName( fileName );
+        printer.setOutputFormat( QPrinter::PostScriptFormat );
+        printer.setResolution( resolution );
+
+        QPainter painter( &printer );
+        render( plot, &painter, documentRect );
+#endif
+#endif
     }
 #ifndef QWT_NO_POLAR_SVG
@@ -300,5 +321,5 @@
 
     painter->save();
-    renderLegend( painter, layout->legendRect() );
+    renderLegend( plot, painter, layout->legendRect() );
     painter->restore();
 
@@ -340,82 +361,77 @@
   Render the legend into a given rectangle.
 
+  \param plot Plot widget
   \param painter Painter
   \param rect Bounding rectangle
 */
-
-void QwtPolarRenderer::renderLegend(
+void QwtPolarRenderer::renderLegend( const QwtPolarPlot *plot,
     QPainter *painter, const QRectF &rect ) const
 {
-    QwtLegend *legend = d_data->plot->legend();
-    if ( legend == NULL || legend->isEmpty() )
-        return;
-
-    const QwtDynGridLayout *legendLayout = qobject_cast<QwtDynGridLayout *>(
-        legend->contentsWidget()->layout() );
-    if ( legendLayout == NULL )
-        return;
-
-    uint numCols = legendLayout->columnsForWidth( rect.width() );
-    const QList<QRect> itemRects =
-        legendLayout->layoutItems( rect.toRect(), numCols );
-
-    int index = 0;
-
-    for ( int i = 0; i < legendLayout->count(); i++ )
-    {
-        QLayoutItem *item = legendLayout->itemAt( i );
-        QWidget *w = item->widget();
-        if ( w )
+    if ( plot->legend() )
+        plot->legend()->renderLegend( painter, rect, true );
+}
+
+/*!
+   \brief Execute a file dialog and render the plot to the selected file
+
+   The document will be rendered in 85 dpi for a size 30x30 cm
+
+   \param plot Plot widget
+   \param documentName Default document name
+   \param sizeMM Size for the document in millimeters.
+   \param resolution Resolution in dots per Inch (dpi)
+
+   \sa renderDocument()
+*/
+bool QwtPolarRenderer::exportTo( QwtPolarPlot *plot, 
+    const QString &documentName, const QSizeF &sizeMM, int resolution )
+{
+    if ( plot == NULL )
+        return false;
+
+    QString fileName = documentName;
+
+    // What about translation 
+
+#ifndef QT_NO_FILEDIALOG
+    const QList<QByteArray> imageFormats =
+        QImageWriter::supportedImageFormats();
+
+    QStringList filter;
+#ifndef QT_NO_PRINTER
+    filter += QString( "PDF " ) + tr( "Documents" ) + " (*.pdf)";
+#endif
+#ifndef QWT_NO_SVG
+    filter += QString( "SVG " ) + tr( "Documents" ) + " (*.svg)";
+#endif
+#ifndef QT_NO_PRINTER
+    filter += QString( "Postscript " ) + tr( "Documents" ) + " (*.ps)";
+#endif
+
+    if ( imageFormats.size() > 0 )
+    {
+        QString imageFilter( tr( "Images" ) );
+        imageFilter += " (";
+        for ( int i = 0; i < imageFormats.size(); i++ )
         {
-            painter->save();
-
-            painter->setClipRect( itemRects[index] );
-            renderLegendItem( painter, w, itemRects[index] );
-
-            index++;
-            painter->restore();
+            if ( i > 0 )
+                imageFilter += " ";
+            imageFilter += "*.";
+            imageFilter += imageFormats[i];
         }
-    }
-
-}
-
-/*!
-  Print the legend item into a given rectangle.
-
-  \param painter Painter
-  \param widget Widget representing a legend item
-  \param rect Bounding rectangle
-
-  \note When widget is not derived from QwtLegendItem renderLegendItem
-        does nothing and needs to be overloaded
-*/
-void QwtPolarRenderer::renderLegendItem( QPainter *painter,
-    const QWidget *widget, const QRectF &rect ) const
-{
-    const QwtLegendItem *item = qobject_cast<const QwtLegendItem *>( widget );
-    if ( item )
-    {
-        const QSize sz = item->identifierSize();
-
-        const QRectF identifierRect( rect.x() + item->margin(),
-            rect.center().y() - 0.5 * sz.height(), sz.width(), sz.height() );
-
-        QwtLegendItemManager *itemManger = d_data->plot->legend()->find( item );
-        if ( itemManger )
-        {
-            painter->save();
-            painter->setClipRect( identifierRect, Qt::IntersectClip );
-            itemManger->drawLegendIdentifier( painter, identifierRect );
-            painter->restore();
-        }
-
-        // Label
-
-        QRectF titleRect = rect;
-        titleRect.setX( identifierRect.right() + 2 * item->spacing() );
-
-        painter->setFont( item->font() );
-        item->text().draw( painter, titleRect );
-    }
-}
-
+        imageFilter += ")";
+
+        filter += imageFilter;
+    }
+
+    fileName = QFileDialog::getSaveFileName(
+        NULL, tr( "Export File Name" ), fileName,
+        filter.join( ";;" ), NULL, QFileDialog::DontConfirmOverwrite );
+#endif
+    if ( fileName.isEmpty() )
+        return false;
+
+    renderDocument( plot, fileName, sizeMM, resolution );
+
+    return true;
+}
Index: trunk/BNC/qwtpolar/qwt_polar_renderer.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_renderer.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_renderer.h	(revision 8127)
@@ -12,7 +12,7 @@
 #include "qwt_polar_global.h"
 #include <qobject.h>
+#include <qsize.h>
 
 class QwtPolarPlot;
-class QSizeF;
 class QRectF;
 class QPainter;
@@ -52,15 +52,16 @@
 #endif
     void renderTo( QwtPolarPlot *, QPrinter & ) const;
-    void renderTo( QwtPolarPlot *, QPaintDevice &p ) const;
+    void renderTo( QwtPolarPlot *, QPaintDevice & ) const;
 
     virtual void render( QwtPolarPlot *,
         QPainter *, const QRectF &rect ) const;
 
-protected:
+    bool exportTo( QwtPolarPlot *, const QString &documentName,
+        const QSizeF &sizeMM = QSizeF( 200, 200 ), int resolution = 85 );
+
     virtual void renderTitle( QPainter *, const QRectF & ) const;
-    virtual void renderLegend( QPainter *, const QRectF & ) const;
 
-    virtual void renderLegendItem( QPainter *,
-        const QWidget *, const QRectF & ) const;
+    virtual void renderLegend(
+        const QwtPolarPlot *, QPainter *, const QRectF & ) const;
 
 private:
Index: trunk/BNC/qwtpolar/qwt_polar_spectrogram.cpp
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_spectrogram.cpp	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_spectrogram.cpp	(revision 8127)
@@ -95,6 +95,5 @@
 public:
     PrivateData():
-        data( NULL ),
-        renderThreadCount( 1 )
+        data( NULL )
     {
         colorMap = new QwtLinearColorMap();
@@ -109,6 +108,4 @@
     QwtRasterData *data;
     QwtColorMap *colorMap;
-
-    uint renderThreadCount;
 
     QwtPolarSpectrogram::PaintAttributes paintAttributes;
@@ -223,35 +220,4 @@
 {
     return ( d_data->paintAttributes & attribute );
-}
-
-/*!
-   Rendering an image from the raster data can often be done
-   parallel on a multicore system.
-
-   \param numThreads Number of threads to be used for rendering.
-                     If numThreads is set to 0, the system specific
-                     ideal thread count is used.
-
-   The default thread count is 1 ( = no additional threads )
-
-   \warning Rendering in multiple threads is only supported for Qt >= 4.4
-   \sa renderThreadCount(), renderImage(), renderTile()
-*/
-void QwtPolarSpectrogram::setRenderThreadCount( uint numThreads )
-{
-    d_data->renderThreadCount = numThreads;
-}
-
-/*!
-   \return Number of threads to be used for rendering.
-           If numThreads is set to 0, the system specific
-           ideal thread count is used.
-
-   \warning Rendering in multiple threads is only supported for Qt >= 4.4
-   \sa setRenderThreadCount(), renderImage(), renderTile()
-*/
-uint QwtPolarSpectrogram::renderThreadCount() const
-{
-    return d_data->renderThreadCount;
 }
 
@@ -357,5 +323,5 @@
 
 #if QT_VERSION >= 0x040400 && !defined(QT_NO_QFUTURE)
-    uint numThreads = d_data->renderThreadCount;
+    uint numThreads = renderThreadCount();
 
     if ( numThreads <= 0 )
Index: trunk/BNC/qwtpolar/qwt_polar_spectrogram.h
===================================================================
--- trunk/BNC/qwtpolar/qwt_polar_spectrogram.h	(revision 7990)
+++ trunk/BNC/qwtpolar/qwt_polar_spectrogram.h	(revision 8127)
@@ -60,7 +60,4 @@
     bool testPaintAttribute( PaintAttribute ) const;
 
-    void setRenderThreadCount( uint numThreads );
-    uint renderThreadCount() const;
-
     virtual int rtti() const;
 
Index: trunk/BNC/qwtpolar/qwtpolar.pro
===================================================================
--- trunk/BNC/qwtpolar/qwtpolar.pro	(revision 7990)
+++ trunk/BNC/qwtpolar/qwtpolar.pro	(revision 8127)
@@ -6,4 +6,8 @@
 CONFIG += release
 DEFINES += QWT_POLAR_NO_SVG
+greaterThan(QT_MAJOR_VERSION, 4) {
+    QT += printsupport
+    QT += concurrent
+}
 
 INCLUDEPATH += ../qwt
@@ -45,3 +49,2 @@
     qwt_polar_renderer.cpp \
     qwt_polar_plot.cpp
-
