Index: trunk/BNC/qwt/qwt_knob.cpp
===================================================================
--- trunk/BNC/qwt/qwt_knob.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_knob.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -10,7 +10,9 @@
 #include "qwt_knob.h"
 #include "qwt_round_scale_draw.h"
-#include "qwt_math.h"
 #include "qwt_painter.h"
 #include "qwt_scale_map.h"
+#include "qwt_math.h"
+#include "qwt.h"
+
 #include <qpainter.h>
 #include <qpalette.h>
@@ -18,15 +20,8 @@
 #include <qstyleoption.h>
 #include <qevent.h>
+#include <qmargins.h>
 #include <qmath.h>
-#include <qapplication.h>
-
-#if QT_VERSION < 0x040601
-#define qAtan2(y, x) ::atan2(y, x)
-#define qFabs(x) ::fabs(x)
-#define qFastCos(x) qCos(x)
-#define qFastSin(x) qSin(x)
-#endif
-
-static QSize qwtKnobSizeHint( const QwtKnob *knob, int min )
+
+static QSize qwtKnobSizeHint( const QwtKnob* knob, int min )
 {
     int knobWidth = knob->knobWidth();
@@ -35,11 +30,9 @@
 
     // Add the scale radial thickness to the knobWidth
-    const int extent = qCeil( knob->scaleDraw()->extent( knob->font() ) );
+    const int extent = qwtCeil( knob->scaleDraw()->extent( knob->font() ) );
     const int d = 2 * ( extent + 4 ) + knobWidth;
 
-    int left, right, top, bottom;
-    knob->getContentsMargins( &left, &top, &right, &bottom );
-
-    return QSize( d + left + right, d + top + bottom );
+    const QMargins m = knob->contentsMargins();
+    return QSize( d + m.left() + m.right(), d + m.top() + m.bottom() );
 }
 
@@ -65,17 +58,17 @@
 class QwtKnob::PrivateData
 {
-public:
-    PrivateData():
-        knobStyle( QwtKnob::Raised ),
-        markerStyle( QwtKnob::Notch ),
-        borderWidth( 2 ),
-        borderDist( 4 ),
-        scaleDist( 4 ),
-        maxScaleTicks( 11 ),
-        knobWidth( 0 ),
-        alignment( Qt::AlignCenter ),
-        markerSize( 8 ),
-        totalAngle( 270.0 ),
-        mouseOffset( 0.0 )
+  public:
+    PrivateData()
+        : knobStyle( QwtKnob::Raised )
+        , markerStyle( QwtKnob::Notch )
+        , borderWidth( 2 )
+        , borderDist( 4 )
+        , scaleDist( 4 )
+        , maxScaleTicks( 11 )
+        , knobWidth( 0 )
+        , alignment( Qt::AlignCenter )
+        , markerSize( 8 )
+        , totalAngle( 270.0 )
+        , mouseOffset( 0.0 )
     {
     }
@@ -98,18 +91,18 @@
 
 /*!
-  \brief Constructor
-
-  Construct a knob with an angle of 270°. The style is
-  QwtKnob::Raised and the marker style is QwtKnob::Notch.
-  The width of the knob is set to 50 pixels.
-
-  \param parent Parent widget
-
-  \sa setTotalAngle()
-*/
-QwtKnob::QwtKnob( QWidget* parent ):
-    QwtAbstractSlider( parent )
-{
-    d_data = new PrivateData;
+   \brief Constructor
+
+   Construct a knob with an angle of 270°. The style is
+   QwtKnob::Raised and the marker style is QwtKnob::Notch.
+   The width of the knob is set to 50 pixels.
+
+   \param parent Parent widget
+
+   \sa setTotalAngle()
+ */
+QwtKnob::QwtKnob( QWidget* parent )
+    : QwtAbstractSlider( parent )
+{
+    m_data = new PrivateData;
 
     setScaleDraw( new QwtRoundScaleDraw() );
@@ -127,18 +120,18 @@
 QwtKnob::~QwtKnob()
 {
-    delete d_data;
-}
-
-/*!
-  \brief Set the knob type
-
-  \param knobStyle Knob type
-  \sa knobStyle(), setBorderWidth()
-*/
+    delete m_data;
+}
+
+/*!
+   \brief Set the knob type
+
+   \param knobStyle Knob type
+   \sa knobStyle(), setBorderWidth()
+ */
 void QwtKnob::setKnobStyle( KnobStyle knobStyle )
 {
-    if ( d_data->knobStyle != knobStyle )
-    {
-        d_data->knobStyle = knobStyle;
+    if ( m_data->knobStyle != knobStyle )
+    {
+        m_data->knobStyle = knobStyle;
         update();
     }
@@ -148,21 +141,21 @@
     \return Marker type of the knob
     \sa setKnobStyle(), setBorderWidth()
-*/
+ */
 QwtKnob::KnobStyle QwtKnob::knobStyle() const
 {
-    return d_data->knobStyle;
-}
-
-/*!
-  \brief Set the marker type of the knob
-
-  \param markerStyle Marker type
-  \sa markerStyle(), setMarkerSize()
-*/
+    return m_data->knobStyle;
+}
+
+/*!
+   \brief Set the marker type of the knob
+
+   \param markerStyle Marker type
+   \sa markerStyle(), setMarkerSize()
+ */
 void QwtKnob::setMarkerStyle( MarkerStyle markerStyle )
 {
-    if ( d_data->markerStyle != markerStyle )
-    {
-        d_data->markerStyle = markerStyle;
+    if ( m_data->markerStyle != markerStyle )
+    {
+        m_data->markerStyle = markerStyle;
         update();
     }
@@ -170,34 +163,34 @@
 
 /*!
-  \return Marker type of the knob
-  \sa setMarkerStyle(), setMarkerSize()
-*/
+   \return Marker type of the knob
+   \sa setMarkerStyle(), setMarkerSize()
+ */
 QwtKnob::MarkerStyle QwtKnob::markerStyle() const
 {
-    return d_data->markerStyle;
-}
-
-/*!
-  \brief Set the total angle by which the knob can be turned
-  \param angle Angle in degrees.
-
-  The angle has to be between [10, 360] degrees. Angles above
-  360 ( so that the knob can be turned several times around its axis )
-  have to be set using setNumTurns().
-
-  The default angle is 270 degrees.
-
-  \sa totalAngle(), setNumTurns()
-*/
+    return m_data->markerStyle;
+}
+
+/*!
+   \brief Set the total angle by which the knob can be turned
+   \param angle Angle in degrees.
+
+   The angle has to be between [10, 360] degrees. Angles above
+   360 ( so that the knob can be turned several times around its axis )
+   have to be set using setNumTurns().
+
+   The default angle is 270 degrees.
+
+   \sa totalAngle(), setNumTurns()
+ */
 void QwtKnob::setTotalAngle ( double angle )
 {
     angle = qBound( 10.0, angle, 360.0 );
 
-    if ( angle != d_data->totalAngle )
-    {
-        d_data->totalAngle = angle;
-
-        scaleDraw()->setAngleRange( -0.5 * d_data->totalAngle,
-            0.5 * d_data->totalAngle );
+    if ( angle != m_data->totalAngle )
+    {
+        m_data->totalAngle = angle;
+
+        scaleDraw()->setAngleRange( -0.5 * m_data->totalAngle,
+            0.5 * m_data->totalAngle );
 
         updateGeometry();
@@ -207,20 +200,20 @@
 
 /*!
-  \return the total angle
-  \sa setTotalAngle(), setNumTurns(), numTurns()
+   \return the total angle
+   \sa setTotalAngle(), setNumTurns(), numTurns()
  */
 double QwtKnob::totalAngle() const
 {
-    return d_data->totalAngle;
-}
-
-/*!
-  \brief Set the number of turns
-
-  When numTurns > 1 the knob can be turned several times around its axis
-  - otherwise the total angle is floored to 360°.
-
-  \sa numTurns(), totalAngle(), setTotalAngle()
-*/
+    return m_data->totalAngle;
+}
+
+/*!
+   \brief Set the number of turns
+
+   When numTurns > 1 the knob can be turned several times around its axis
+   - otherwise the total angle is floored to 360°.
+
+   \sa numTurns(), totalAngle(), setTotalAngle()
+ */
 
 void QwtKnob::setNumTurns( int numTurns )
@@ -228,14 +221,14 @@
     numTurns = qMax( numTurns, 1 );
 
-    if ( numTurns == 1 && d_data->totalAngle <= 360.0 )
+    if ( numTurns == 1 && m_data->totalAngle <= 360.0 )
         return;
 
     const double angle = numTurns * 360.0;
-    if ( angle != d_data->totalAngle )
-    {
-        d_data->totalAngle = angle;
-
-        scaleDraw()->setAngleRange( -0.5 * d_data->totalAngle,
-            0.5 * d_data->totalAngle );
+    if ( angle != m_data->totalAngle )
+    {
+        m_data->totalAngle = angle;
+
+        scaleDraw()->setAngleRange( -0.5 * m_data->totalAngle,
+            0.5 * m_data->totalAngle );
 
         updateGeometry();
@@ -245,12 +238,12 @@
 
 /*!
-  \return Number of turns.
-
-  When the total angle is below 360° numTurns() is ceiled to 1.
-  \sa setNumTurns(), setTotalAngle(), totalAngle()
+   \return Number of turns.
+
+   When the total angle is below 360° numTurns() is ceiled to 1.
+   \sa setNumTurns(), setTotalAngle(), totalAngle()
  */
 int QwtKnob::numTurns() const
 {
-    return qCeil( d_data->totalAngle / 360.0 );
+    return qwtCeil( m_data->totalAngle / 360.0 );
 }
 
@@ -263,9 +256,9 @@
 
    \sa scaleDraw()
-*/
-void QwtKnob::setScaleDraw( QwtRoundScaleDraw *scaleDraw )
+ */
+void QwtKnob::setScaleDraw( QwtRoundScaleDraw* scaleDraw )
 {
     setAbstractScaleDraw( scaleDraw );
-    setTotalAngle( d_data->totalAngle );
+    setTotalAngle( m_data->totalAngle );
 
     updateGeometry();
@@ -276,8 +269,8 @@
    \return the scale draw of the knob
    \sa setScaleDraw()
-*/
-const QwtRoundScaleDraw *QwtKnob::scaleDraw() const
-{
-    return static_cast<const QwtRoundScaleDraw *>( abstractScaleDraw() );
+ */
+const QwtRoundScaleDraw* QwtKnob::scaleDraw() const
+{
+    return static_cast< const QwtRoundScaleDraw* >( abstractScaleDraw() );
 }
 
@@ -285,15 +278,15 @@
    \return the scale draw of the knob
    \sa setScaleDraw()
-*/
-QwtRoundScaleDraw *QwtKnob::scaleDraw()
-{
-    return static_cast<QwtRoundScaleDraw *>( abstractScaleDraw() );
-}
-
-/*!
-  Calculate the bounding rectangle of the knob without the scale
-
-  \return Bounding rectangle of the knob
-  \sa knobWidth(), alignment(), QWidget::contentsRect()
+ */
+QwtRoundScaleDraw* QwtKnob::scaleDraw()
+{
+    return static_cast< QwtRoundScaleDraw* >( abstractScaleDraw() );
+}
+
+/*!
+   Calculate the bounding rectangle of the knob without the scale
+
+   \return Bounding rectangle of the knob
+   \sa knobWidth(), alignment(), QWidget::contentsRect()
  */
 QRect QwtKnob::knobRect() const
@@ -301,8 +294,8 @@
     const QRect cr = contentsRect();
 
-    const int extent = qCeil( scaleDraw()->extent( font() ) );
-    const int d = extent + d_data->scaleDist;
-
-    int w = d_data->knobWidth;
+    const int extent = qwtCeil( scaleDraw()->extent( font() ) );
+    const int d = extent + m_data->scaleDist;
+
+    int w = m_data->knobWidth;
     if ( w <= 0 )
     {
@@ -315,9 +308,9 @@
     QRect r( 0, 0, w, w );
 
-    if ( d_data->alignment & Qt::AlignLeft )
+    if ( m_data->alignment & Qt::AlignLeft )
     {
         r.moveLeft( cr.left() + d );
     }
-    else if ( d_data->alignment & Qt::AlignRight )
+    else if ( m_data->alignment & Qt::AlignRight )
     {
         r.moveRight( cr.right() - d );
@@ -328,9 +321,9 @@
     }
 
-    if ( d_data->alignment & Qt::AlignTop )
+    if ( m_data->alignment & Qt::AlignTop )
     {
         r.moveTop( cr.top() + d );
     }
-    else if ( d_data->alignment & Qt::AlignBottom )
+    else if ( m_data->alignment & Qt::AlignBottom )
     {
         r.moveBottom( cr.bottom() - d );
@@ -345,12 +338,12 @@
 
 /*!
-  \brief Determine what to do when the user presses a mouse button.
-
-  \param pos Mouse position
-
-  \retval True, when pos is inside the circle of the knob.
-  \sa scrolledTo()
-*/
-bool QwtKnob::isScrollPosition( const QPoint &pos ) const
+   \brief Determine what to do when the user presses a mouse button.
+
+   \param pos Mouse position
+
+   \retval True, when pos is inside the circle of the knob.
+   \sa scrolledTo()
+ */
+bool QwtKnob::isScrollPosition( const QPoint& pos ) const
 {
     const QRect kr = knobRect();
@@ -362,5 +355,5 @@
         const double valueAngle = qwtToDegrees( scaleMap().transform( value() ) );
 
-        d_data->mouseOffset = qwtNormalizeDegrees( angle - valueAngle );
+        m_data->mouseOffset = qwtNormalizeDegrees( angle - valueAngle );
 
         return true;
@@ -371,15 +364,15 @@
 
 /*!
-  \brief Determine the value for a new position of the mouse
-
-  \param pos Mouse position
-
-  \return Value for the mouse position
-  \sa isScrollPosition()
-*/
-double QwtKnob::scrolledTo( const QPoint &pos ) const
+   \brief Determine the value for a new position of the mouse
+
+   \param pos Mouse position
+
+   \return Value for the mouse position
+   \sa isScrollPosition()
+ */
+double QwtKnob::scrolledTo( const QPoint& pos ) const
 {
     double angle = QLineF( rect().center(), pos ).angle();
-    angle = qwtNormalizeDegrees( angle - d_data->mouseOffset );
+    angle = qwtNormalizeDegrees( angle - m_data->mouseOffset );
 
     if ( scaleMap().pDist() > 360.0 )
@@ -389,5 +382,5 @@
         const double v = scaleMap().transform( value() );
 
-        int numTurns = qFloor( ( v - scaleMap().p1() ) / 360.0 );
+        int numTurns = qwtFloor( ( v - scaleMap().p1() ) / 360.0 );
 
         double valueAngle = qwtNormalizeDegrees( v );
@@ -404,5 +397,5 @@
                 qBound( scaleMap().p1(), angle, scaleMap().p2() );
 
-            d_data->mouseOffset += ( boundedAngle - angle );
+            m_data->mouseOffset += ( boundedAngle - angle );
             angle = boundedAngle;
         }
@@ -423,5 +416,5 @@
                 boundedAngle = scaleMap().p1();
 
-            d_data->mouseOffset += ( boundedAngle - angle );
+            m_data->mouseOffset += ( boundedAngle - angle );
         }
 
@@ -433,8 +426,8 @@
 
 /*!
-  Handle QEvent::StyleChange and QEvent::FontChange;
-  \param event Change event
-*/
-void QwtKnob::changeEvent( QEvent *event )
+   Handle QEvent::StyleChange and QEvent::FontChange;
+   \param event Change event
+ */
+void QwtKnob::changeEvent( QEvent* event )
 {
     switch( event->type() )
@@ -453,8 +446,8 @@
 
 /*!
-  Repaint the knob
-  \param event Paint event
-*/
-void QwtKnob::paintEvent( QPaintEvent *event )
+   Repaint the knob
+   \param event Paint event
+ */
+void QwtKnob::paintEvent( QPaintEvent* event )
 {
     const QRectF knobRect = this->knobRect();
@@ -464,5 +457,5 @@
 
     QStyleOption opt;
-    opt.init(this);
+    opt.initFrom(this);
     style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
 
@@ -471,5 +464,5 @@
     if ( !knobRect.contains( event->region().boundingRect() ) )
     {
-        scaleDraw()->setRadius( 0.5 * knobRect.width() + d_data->scaleDist );
+        scaleDraw()->setRadius( 0.5 * knobRect.width() + m_data->scaleDist );
         scaleDraw()->moveCenter( knobRect.center() );
 
@@ -489,13 +482,13 @@
 
 /*!
-  \brief Draw the knob
-
-  \param painter painter
-  \param knobRect Bounding rectangle of the knob (without scale)
-*/
-void QwtKnob::drawKnob( QPainter *painter, const QRectF &knobRect ) const
+   \brief Draw the knob
+
+   \param painter painter
+   \param knobRect Bounding rectangle of the knob (without scale)
+ */
+void QwtKnob::drawKnob( QPainter* painter, const QRectF& knobRect ) const
 {
     double dim = qMin( knobRect.width(), knobRect.height() );
-    dim -= d_data->borderWidth * 0.5;
+    dim -= m_data->borderWidth * 0.5;
 
     QRectF aRect( 0, 0, dim, dim );
@@ -503,5 +496,5 @@
 
     QPen pen( Qt::NoPen );
-    if ( d_data->borderWidth > 0 )
+    if ( m_data->borderWidth > 0 )
     {
         QColor c1 = palette().color( QPalette::Light );
@@ -514,9 +507,9 @@
         gradient.setColorAt( 1.0, c2 );
 
-        pen = QPen( gradient, d_data->borderWidth );
+        pen = QPen( gradient, m_data->borderWidth );
     }
 
     QBrush brush;
-    switch( d_data->knobStyle )
+    switch( m_data->knobStyle )
     {
         case QwtKnob::Raised:
@@ -542,8 +535,8 @@
 
             const QColor c = palette().color( QPalette::Button );
-            gradient.setColorAt(0, c.lighter(110));
-            gradient.setColorAt(qreal(0.5), c);
-            gradient.setColorAt(qreal(0.501), c.darker(102));
-            gradient.setColorAt(1, c.darker(115));
+            gradient.setColorAt(0, c.lighter(110) );
+            gradient.setColorAt( 0.5, c);
+            gradient.setColorAt( 0.501, c.darker(102) );
+            gradient.setColorAt(1, c.darker(115) );
 
             brush = QBrush( gradient );
@@ -574,15 +567,15 @@
 
 /*!
-  \brief Draw the marker at the knob's front
-
-  \param painter Painter
-  \param rect Bounding rectangle of the knob without scale
-  \param angle Angle of the marker in degrees
+   \brief Draw the marker at the knob's front
+
+   \param painter Painter
+   \param rect Bounding rectangle of the knob without scale
+   \param angle Angle of the marker in degrees
                ( clockwise, 0 at the 12 o'clock position )
-*/
-void QwtKnob::drawMarker( QPainter *painter,
-    const QRectF &rect, double angle ) const
-{
-    if ( d_data->markerStyle == NoMarker || !isValid() )
+ */
+void QwtKnob::drawMarker( QPainter* painter,
+    const QRectF& rect, double angle ) const
+{
+    if ( m_data->markerStyle == NoMarker || !isValid() )
         return;
 
@@ -595,19 +588,18 @@
     const double margin = 4.0;
 
-    double radius = 0.5 * ( rect.width() - d_data->borderWidth ) - margin;
+    double radius = 0.5 * ( rect.width() - m_data->borderWidth ) - margin;
     if ( radius < 1.0 )
         radius = 1.0;
 
-    int markerSize = d_data->markerSize;
+    double markerSize = m_data->markerSize;
     if ( markerSize <= 0 )
         markerSize = qRound( 0.4 * radius );
 
-    switch ( d_data->markerStyle )
+    switch ( m_data->markerStyle )
     {
         case Notch:
         case Nub:
         {
-            const double dotWidth =
-                qMin( double( markerSize ), radius);
+            const double dotWidth = qwtMinF( markerSize, radius );
 
             const double dotCenterDist = radius - 0.5 * dotWidth;
@@ -623,5 +615,5 @@
                 QColor c2 = palette().color( QPalette::Mid );
 
-                if ( d_data->markerStyle == Notch )
+                if ( m_data->markerStyle == Notch )
                     qSwap( c1, c2 );
 
@@ -640,6 +632,5 @@
         case Dot:
         {
-            const double dotWidth =
-                qMin( double( markerSize ), radius);
+            const double dotWidth = qwtMinF( markerSize, radius);
 
             const double dotCenterDist = radius - 0.5 * dotWidth;
@@ -661,5 +652,5 @@
         case Tick:
         {
-            const double rb = qMax( radius - markerSize, 1.0 );
+            const double rb = qwtMaxF( radius - markerSize, 1.0 );
             const double re = radius;
 
@@ -676,5 +667,5 @@
         case Triangle:
         {
-            const double rb = qMax( radius - markerSize, 1.0 );
+            const double rb = qwtMaxF( radius - markerSize, 1.0 );
             const double re = radius;
 
@@ -701,12 +692,12 @@
 
 /*!
-  Draw the focus indicator
-  \param painter Painter
-*/
-void QwtKnob::drawFocusIndicator( QPainter *painter ) const
+   Draw the focus indicator
+   \param painter Painter
+ */
+void QwtKnob::drawFocusIndicator( QPainter* painter ) const
 {
     const QRect cr = contentsRect();
 
-    int w = d_data->knobWidth;
+    int w = m_data->knobWidth;
     if ( w <= 0 )
     {
@@ -716,5 +707,5 @@
     {
         const int extent = qCeil( scaleDraw()->extent( font() ) );
-        w += 2 * ( extent + d_data->scaleDist );
+        w += 2 * ( extent + m_data->scaleDist );
     }
 
@@ -726,20 +717,20 @@
 
 /*!
-  \brief Set the alignment of the knob
-
-  Similar to a QLabel::alignment() the flags decide how
-  to align the knob inside of contentsRect().
-
-  The default setting is Qt::AlignCenter
-
-  \param alignment Or'd alignment flags
-
-  \sa alignment(), setKnobWidth(), knobRect()
+   \brief Set the alignment of the knob
+
+   Similar to a QLabel::alignment() the flags decide how
+   to align the knob inside of contentsRect().
+
+   The default setting is Qt::AlignCenter
+
+   \param alignment Or'd alignment flags
+
+   \sa alignment(), setKnobWidth(), knobRect()
  */
 void QwtKnob::setAlignment( Qt::Alignment alignment )
 {
-    if ( d_data->alignment != alignment )
-    {
-        d_data->alignment = alignment;
+    if ( m_data->alignment != alignment )
+    {
+        m_data->alignment = alignment;
         update();
     }
@@ -747,28 +738,28 @@
 
 /*!
-  \return Alignment of the knob inside of contentsRect()
-  \sa setAlignment(), knobWidth(), knobRect()
+   \return Alignment of the knob inside of contentsRect()
+   \sa setAlignment(), knobWidth(), knobRect()
  */
 Qt::Alignment QwtKnob::alignment() const
 {
-    return d_data->alignment;
-}
-
-/*!
-  \brief Change the knob's width.
-
-  Setting a fixed value for the diameter of the knob
-  is helpful for aligning several knobs in a row.
-
-  \param width New width
-
-  \sa knobWidth(), setAlignment()
-  \note Modifies the sizePolicy()
-*/
+    return m_data->alignment;
+}
+
+/*!
+   \brief Change the knob's width.
+
+   Setting a fixed value for the diameter of the knob
+   is helpful for aligning several knobs in a row.
+
+   \param width New width
+
+   \sa knobWidth(), setAlignment()
+   \note Modifies the sizePolicy()
+ */
 void QwtKnob::setKnobWidth( int width )
 {
     width = qMax( width, 0 );
 
-    if ( width != d_data->knobWidth )
+    if ( width != m_data->knobWidth )
     {
         QSizePolicy::Policy policy;
@@ -780,5 +771,5 @@
         setSizePolicy( policy, policy );
 
-        d_data->knobWidth = width;
+        m_data->knobWidth = width;
 
         updateGeometry();
@@ -790,14 +781,14 @@
 int QwtKnob::knobWidth() const
 {
-    return d_data->knobWidth;
-}
-
-/*!
-  \brief Set the knob's border width
-  \param borderWidth new border width
-*/
+    return m_data->knobWidth;
+}
+
+/*!
+   \brief Set the knob's border width
+   \param borderWidth new border width
+ */
 void QwtKnob::setBorderWidth( int borderWidth )
 {
-    d_data->borderWidth = qMax( borderWidth, 0 );
+    m_data->borderWidth = qMax( borderWidth, 0 );
 
     updateGeometry();
@@ -808,20 +799,20 @@
 int QwtKnob::borderWidth() const
 {
-    return d_data->borderWidth;
-}
-
-/*!
-  \brief Set the size of the marker
-
-  When setting a size <= 0 the marker will
-  automatically scaled to 40% of the radius of the knob.
-
-  \sa markerSize(), markerStyle()
-*/
+    return m_data->borderWidth;
+}
+
+/*!
+   \brief Set the size of the marker
+
+   When setting a size <= 0 the marker will
+   automatically scaled to 40% of the radius of the knob.
+
+   \sa markerSize(), markerStyle()
+ */
 void QwtKnob::setMarkerSize( int size )
 {
-    if ( d_data->markerSize != size )
-    {
-        d_data->markerSize = size;
+    if ( m_data->markerSize != size )
+    {
+        m_data->markerSize = size;
         update();
     }
@@ -829,27 +820,29 @@
 
 /*!
-  \return Marker size
-  \sa setMarkerSize()
+   \return Marker size
+   \sa setMarkerSize()
  */
 int QwtKnob::markerSize() const
 {
-    return d_data->markerSize;
-}
-
-/*!
-  \return sizeHint()
-*/
+    return m_data->markerSize;
+}
+
+/*!
+   \return sizeHint()
+ */
 QSize QwtKnob::sizeHint() const
 {
     const QSize hint = qwtKnobSizeHint( this, 50 );
-    return hint.expandedTo( QApplication::globalStrut() );
-}
-
-/*!
-  \return Minimum size hint
-  \sa sizeHint()
-*/
+    return qwtExpandedToGlobalStrut( hint );
+}
+
+/*!
+   \return Minimum size hint
+   \sa sizeHint()
+ */
 QSize QwtKnob::minimumSizeHint() const
 {
     return qwtKnobSizeHint( this, 20 );
 }
+
+#include "moc_qwt_knob.cpp"
