Index: trunk/BNC/qwt/qwt_wheel.cpp
===================================================================
--- trunk/BNC/qwt/qwt_wheel.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_wheel.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -11,4 +11,6 @@
 #include "qwt_math.h"
 #include "qwt_painter.h"
+#include "qwt.h"
+
 #include <qevent.h>
 #include <qdrawutil.h>
@@ -16,42 +18,36 @@
 #include <qstyle.h>
 #include <qstyleoption.h>
-#include <qapplication.h>
-#include <qdatetime.h>
-
-#if QT_VERSION < 0x040601
-#define qFabs(x) ::fabs(x)
-#define qFastSin(x) ::sin(x)
-#define qExp(x) ::exp(x)
-#endif
+#include <qelapsedtimer.h>
+#include <qmath.h>
 
 class QwtWheel::PrivateData
 {
-public:
-    PrivateData():
-        orientation( Qt::Horizontal ),
-        viewAngle( 175.0 ),
-        totalAngle( 360.0 ),
-        tickCount( 10 ),
-        wheelBorderWidth( 2 ),
-        borderWidth( 2 ),
-        wheelWidth( 20 ),
-        isScrolling( false ),
-        mouseOffset( 0.0 ),
-        tracking( true ),
-        pendingValueChanged( false ),
-        updateInterval( 50 ),
-        mass( 0.0 ),
-        timerId( 0 ),
-        speed( 0.0 ),
-        mouseValue( 0.0 ),
-        flyingValue( 0.0 ),
-        minimum( 0.0 ),
-        maximum( 100.0 ),
-        singleStep( 1.0 ),
-        pageStepCount( 1 ),
-        stepAlignment( true ),
-        value( 0.0 ),
-        inverted( false ),
-        wrapping( false )
+  public:
+    PrivateData()
+        : orientation( Qt::Horizontal )
+        , viewAngle( 175.0 )
+        , totalAngle( 360.0 )
+        , tickCount( 10 )
+        , wheelBorderWidth( 2 )
+        , borderWidth( 2 )
+        , wheelWidth( 20 )
+        , mouseOffset( 0.0 )
+        , updateInterval( 50 )
+        , mass( 0.0 )
+        , timerId( 0 )
+        , speed( 0.0 )
+        , mouseValue( 0.0 )
+        , flyingValue( 0.0 )
+        , minimum( 0.0 )
+        , maximum( 100.0 )
+        , singleStep( 1.0 )
+        , pageStepCount( 1 )
+        , value( 0.0 )
+        , isScrolling( false )
+        , tracking( true )
+        , stepAlignment( true )
+        , pendingValueChanged( false )
+        , inverted( false )
+        , wrapping( false )
     {
     }
@@ -65,9 +61,5 @@
     int wheelWidth;
 
-    bool isScrolling;
     double mouseOffset;
-
-    bool tracking;
-    bool pendingValueChanged; // when not tracking
 
     int updateInterval;
@@ -76,5 +68,5 @@
     // for the flying wheel effect
     int timerId;
-    QTime time;
+    QElapsedTimer timer;
     double speed;
     double mouseValue;
@@ -86,8 +78,11 @@
     double singleStep;
     int pageStepCount;
+
+    double value;
+
+    bool isScrolling;
+    bool tracking;
     bool stepAlignment;
-
-    double value;
-
+    bool pendingValueChanged; // when not tracking
     bool inverted;
     bool wrapping;
@@ -95,8 +90,8 @@
 
 //! Constructor
-QwtWheel::QwtWheel( QWidget *parent ):
+QwtWheel::QwtWheel( QWidget* parent ):
     QWidget( parent )
 {
-    d_data = new PrivateData;
+    m_data = new PrivateData;
 
     setFocusPolicy( Qt::StrongFocus );
@@ -108,53 +103,53 @@
 QwtWheel::~QwtWheel()
 {
-    delete d_data;
-}
-
-/*!
-  \brief En/Disable tracking
-
-  If tracking is enabled (the default), the wheel emits the valueChanged()
-  signal while the wheel is moving. If tracking is disabled, the wheel
-  emits the valueChanged() signal only when the wheel movement is terminated.
-
-  The wheelMoved() signal is emitted regardless id tracking is enabled or not.
-
-  \param enable On/Off
-  \sa isTracking()
+    delete m_data;
+}
+
+/*!
+   \brief En/Disable tracking
+
+   If tracking is enabled (the default), the wheel emits the valueChanged()
+   signal while the wheel is moving. If tracking is disabled, the wheel
+   emits the valueChanged() signal only when the wheel movement is terminated.
+
+   The wheelMoved() signal is emitted regardless id tracking is enabled or not.
+
+   \param enable On/Off
+   \sa isTracking()
  */
 void QwtWheel::setTracking( bool enable )
 {
-    d_data->tracking = enable;
-}
-
-/*!
-  \return True, when tracking is enabled
-  \sa setTracking(), valueChanged(), wheelMoved()
-*/
+    m_data->tracking = enable;
+}
+
+/*!
+   \return True, when tracking is enabled
+   \sa setTracking(), valueChanged(), wheelMoved()
+ */
 bool QwtWheel::isTracking() const
 {
-    return d_data->tracking;
-}
-
-/*!
-  \brief Specify the update interval when the wheel is flying
-
-  Default and minimum value is 50 ms.
-
-  \param interval Interval in milliseconds
-  \sa updateInterval(), setMass(), setTracking()
-*/
+    return m_data->tracking;
+}
+
+/*!
+   \brief Specify the update interval when the wheel is flying
+
+   Default and minimum value is 50 ms.
+
+   \param interval Interval in milliseconds
+   \sa updateInterval(), setMass(), setTracking()
+ */
 void QwtWheel::setUpdateInterval( int interval )
 {
-    d_data->updateInterval = qMax( interval, 50 );
-}
-
-/*!
-  \return Update interval when the wheel is flying
-  \sa setUpdateInterval(), mass(), isTracking()
+    m_data->updateInterval = qMax( interval, 50 );
+}
+
+/*!
+   \return Update interval when the wheel is flying
+   \sa setUpdateInterval(), mass(), isTracking()
  */
 int QwtWheel::updateInterval() const
 {
-    return d_data->updateInterval;
+    return m_data->updateInterval;
 }
 
@@ -165,18 +160,18 @@
 
    \param event Mouse event
-*/
-void QwtWheel::mousePressEvent( QMouseEvent *event )
+ */
+void QwtWheel::mousePressEvent( QMouseEvent* event )
 {
     stopFlying();
 
-    d_data->isScrolling = wheelRect().contains( event->pos() );
-
-    if ( d_data->isScrolling )
-    {
-        d_data->time.start();
-        d_data->speed = 0.0;
-        d_data->mouseValue = valueAt( event->pos() );
-        d_data->mouseOffset = d_data->mouseValue - d_data->value;
-        d_data->pendingValueChanged = false;
+    m_data->isScrolling = wheelRect().contains( event->pos() );
+
+    if ( m_data->isScrolling )
+    {
+        m_data->timer.start();
+        m_data->speed = 0.0;
+        m_data->mouseValue = valueAt( event->pos() );
+        m_data->mouseOffset = m_data->mouseValue - m_data->value;
+        m_data->pendingValueChanged = false;
 
         Q_EMIT wheelPressed();
@@ -190,15 +185,15 @@
 
    \param event Mouse event
-*/
-void QwtWheel::mouseMoveEvent( QMouseEvent *event )
-{
-    if ( !d_data->isScrolling )
+ */
+void QwtWheel::mouseMoveEvent( QMouseEvent* event )
+{
+    if ( !m_data->isScrolling )
         return;
 
     double mouseValue = valueAt( event->pos() );
 
-    if ( d_data->mass > 0.0 )
-    {
-        double ms = d_data->time.restart();
+    if ( m_data->mass > 0.0 )
+    {
+        double ms = m_data->timer.restart();
 
         // the interval when mouse move events are posted are somehow
@@ -207,25 +202,25 @@
         ms = qMax( ms, 5.0 );
 
-        d_data->speed = ( mouseValue - d_data->mouseValue ) / ms;
-    }
-
-    d_data->mouseValue = mouseValue;
-
-    double value = boundedValue( mouseValue - d_data->mouseOffset );
-    if ( d_data->stepAlignment )
+        m_data->speed = ( mouseValue - m_data->mouseValue ) / ms;
+    }
+
+    m_data->mouseValue = mouseValue;
+
+    double value = boundedValue( mouseValue - m_data->mouseOffset );
+    if ( m_data->stepAlignment )
         value = alignedValue( value );
 
-    if ( value != d_data->value )
-    {
-        d_data->value = value;
+    if ( value != m_data->value )
+    {
+        m_data->value = value;
 
         update();
 
-        Q_EMIT wheelMoved( d_data->value );
-
-        if ( d_data->tracking )
-            Q_EMIT valueChanged( d_data->value );
+        Q_EMIT wheelMoved( m_data->value );
+
+        if ( m_data->tracking )
+            Q_EMIT valueChanged( m_data->value );
         else
-            d_data->pendingValueChanged = true;
+            m_data->pendingValueChanged = true;
     }
 }
@@ -238,21 +233,21 @@
 
    \param event Mouse event
-*/
-
-void QwtWheel::mouseReleaseEvent( QMouseEvent *event )
+ */
+
+void QwtWheel::mouseReleaseEvent( QMouseEvent* event )
 {
     Q_UNUSED( event );
 
-    if ( !d_data->isScrolling )
+    if ( !m_data->isScrolling )
         return;
 
-    d_data->isScrolling = false;
+    m_data->isScrolling = false;
 
     bool startFlying = false;
 
-    if ( d_data->mass > 0.0 )
-    {
-        const int ms = d_data->time.elapsed();
-        if ( ( qFabs( d_data->speed ) > 0.0 ) && ( ms < 50 ) )
+    if ( m_data->mass > 0.0 )
+    {
+        const qint64 ms = m_data->timer.elapsed();
+        if ( ( std::fabs( m_data->speed ) > 0.0 ) && ( ms < 50 ) )
             startFlying = true;
     }
@@ -260,17 +255,17 @@
     if ( startFlying )
     {
-        d_data->flyingValue =
-            boundedValue( d_data->mouseValue - d_data->mouseOffset );
-
-        d_data->timerId = startTimer( d_data->updateInterval );
+        m_data->flyingValue =
+            boundedValue( m_data->mouseValue - m_data->mouseOffset );
+
+        m_data->timerId = startTimer( m_data->updateInterval );
     }
     else
     {
-        if ( d_data->pendingValueChanged )
-            Q_EMIT valueChanged( d_data->value );
-    }
-
-    d_data->pendingValueChanged = false;
-    d_data->mouseOffset = 0.0;
+        if ( m_data->pendingValueChanged )
+            Q_EMIT valueChanged( m_data->value );
+    }
+
+    m_data->pendingValueChanged = false;
+    m_data->mouseOffset = 0.0;
 
     Q_EMIT wheelReleased();
@@ -278,15 +273,15 @@
 
 /*!
-  \brief Qt timer event
-
-  The flying wheel effect is implemented using a timer
-
-  \param event Timer event
-
-  \sa updateInterval()
- */
-void QwtWheel::timerEvent( QTimerEvent *event )
-{
-    if ( event->timerId() != d_data->timerId )
+   \brief Qt timer event
+
+   The flying wheel effect is implemented using a timer
+
+   \param event Timer event
+
+   \sa updateInterval()
+ */
+void QwtWheel::timerEvent( QTimerEvent* event )
+{
+    if ( event->timerId() != m_data->timerId )
     {
         QWidget::timerEvent( event );
@@ -294,40 +289,51 @@
     }
 
-    d_data->speed *= qExp( -d_data->updateInterval * 0.001 / d_data->mass );
-
-    d_data->flyingValue += d_data->speed * d_data->updateInterval;
-    d_data->flyingValue = boundedValue( d_data->flyingValue );
-
-    double value = d_data->flyingValue;
-    if ( d_data->stepAlignment )
+    m_data->speed *= std::exp( -m_data->updateInterval * 0.001 / m_data->mass );
+
+    m_data->flyingValue += m_data->speed * m_data->updateInterval;
+    m_data->flyingValue = boundedValue( m_data->flyingValue );
+
+    double value = m_data->flyingValue;
+    if ( m_data->stepAlignment )
         value = alignedValue( value );
 
-    if ( qFabs( d_data->speed ) < 0.001 * d_data->singleStep )
-    {
-        // stop if d_data->speed < one step per second
+    if ( std::fabs( m_data->speed ) < 0.001 * m_data->singleStep )
+    {
+        // stop if m_data->speed < one step per second
         stopFlying();
     }
 
-    if ( value != d_data->value )
-    {
-        d_data->value = value;
+    if ( value != m_data->value )
+    {
+        m_data->value = value;
         update();
 
-        if ( d_data->tracking || d_data->timerId == 0 )
-            Q_EMIT valueChanged( d_data->value );
-    }
-}
-
-
-/*!
-  \brief Handle wheel events
-
-  In/Decrement the value
-
-  \param event Wheel event
-*/
-void QwtWheel::wheelEvent( QWheelEvent *event )
-{
-    if ( !wheelRect().contains( event->pos() ) )
+        if ( m_data->tracking || m_data->timerId == 0 )
+            Q_EMIT valueChanged( m_data->value );
+    }
+}
+
+
+/*!
+   \brief Handle wheel events
+
+   In/Decrement the value
+
+   \param event Wheel event
+ */
+void QwtWheel::wheelEvent( QWheelEvent* event )
+{
+#if QT_VERSION < 0x050e00
+    const QPoint wheelPos = event->pos();
+    const int wheelDelta = event->delta();
+#else
+    const QPoint wheelPos = event->position().toPoint();
+
+    const QPoint delta = event->angleDelta();
+    const int wheelDelta = ( qAbs( delta.x() ) > qAbs( delta.y() ) )
+        ? delta.x() : delta.y();
+#endif
+
+    if ( !wheelRect().contains( wheelPos ) )
     {
         event->ignore();
@@ -335,5 +341,5 @@
     }
 
-    if ( d_data->isScrolling )
+    if ( m_data->isScrolling )
         return;
 
@@ -342,66 +348,66 @@
     double increment = 0.0;
 
-    if ( ( event->modifiers() & Qt::ControlModifier) ||
+    if ( ( event->modifiers() & Qt::ControlModifier ) ||
         ( event->modifiers() & Qt::ShiftModifier ) )
     {
         // one page regardless of delta
-        increment = d_data->singleStep * d_data->pageStepCount;
-        if ( event->delta() < 0 )
+        increment = m_data->singleStep * m_data->pageStepCount;
+        if ( wheelDelta < 0 )
             increment = -increment;
     }
     else
     {
-        const int numSteps = event->delta() / 120;
-        increment = d_data->singleStep * numSteps;
-    }
-
-    if ( d_data->orientation == Qt::Vertical && d_data->inverted )
+        const int numSteps = wheelDelta / 120;
+        increment = m_data->singleStep * numSteps;
+    }
+
+    if ( m_data->orientation == Qt::Vertical && m_data->inverted )
         increment = -increment;
 
-    double value = boundedValue( d_data->value + increment );
-
-    if ( d_data->stepAlignment )
+    double value = boundedValue( m_data->value + increment );
+
+    if ( m_data->stepAlignment )
         value = alignedValue( value );
 
-    if ( value != d_data->value )
-    {
-        d_data->value = value;
+    if ( value != m_data->value )
+    {
+        m_data->value = value;
         update();
 
-        Q_EMIT valueChanged( d_data->value );
-        Q_EMIT wheelMoved( d_data->value );
-    }
-}
-
-/*!
-  Handle key events
-
-  - Qt::Key_Home\n
+        Q_EMIT valueChanged( m_data->value );
+        Q_EMIT wheelMoved( m_data->value );
+    }
+}
+
+/*!
+   Handle key events
+
+   - Qt::Key_Home\n
     Step to minimum()
 
-  - Qt::Key_End\n
+   - Qt::Key_End\n
     Step to maximum()
 
-  - Qt::Key_Up\n
+   - Qt::Key_Up\n
     In case of a horizontal or not inverted vertical wheel the value
     will be incremented by the step size. For an inverted vertical wheel
     the value will be decremented by the step size.
 
-  - Qt::Key_Down\n
+   - Qt::Key_Down\n
     In case of a horizontal or not inverted vertical wheel the value
     will be decremented by the step size. For an inverted vertical wheel
     the value will be incremented by the step size.
 
-  - Qt::Key_PageUp\n
+   - Qt::Key_PageUp\n
     The value will be incremented by pageStepSize() * singleStepSize().
 
-  - Qt::Key_PageDown\n
+   - Qt::Key_PageDown\n
     The value will be decremented by pageStepSize() * singleStepSize().
 
-  \param event Key event
-*/
-void QwtWheel::keyPressEvent( QKeyEvent *event )
-{
-    if ( d_data->isScrolling )
+   \param event Key event
+ */
+void QwtWheel::keyPressEvent( QKeyEvent* event )
+{
+    if ( m_data->isScrolling )
     {
         // don't interfere mouse scrolling
@@ -409,5 +415,5 @@
     }
 
-    double value = d_data->value;
+    double value = m_data->value;
     double increment = 0.0;
 
@@ -416,8 +422,8 @@
         case Qt::Key_Down:
         {
-            if ( d_data->orientation == Qt::Vertical && d_data->inverted )
-                increment = d_data->singleStep;
+            if ( m_data->orientation == Qt::Vertical && m_data->inverted )
+                increment = m_data->singleStep;
             else
-                increment = -d_data->singleStep;
+                increment = -m_data->singleStep;
 
             break;
@@ -425,8 +431,8 @@
         case Qt::Key_Up:
         {
-            if ( d_data->orientation == Qt::Vertical && d_data->inverted )
-                increment = -d_data->singleStep;
+            if ( m_data->orientation == Qt::Vertical && m_data->inverted )
+                increment = -m_data->singleStep;
             else
-                increment = d_data->singleStep;
+                increment = m_data->singleStep;
 
             break;
@@ -434,10 +440,10 @@
         case Qt::Key_Left:
         {
-            if ( d_data->orientation == Qt::Horizontal )
+            if ( m_data->orientation == Qt::Horizontal )
             {
-                if ( d_data->inverted )
-                    increment = d_data->singleStep;
+                if ( m_data->inverted )
+                    increment = m_data->singleStep;
                 else
-                    increment = -d_data->singleStep;
+                    increment = -m_data->singleStep;
             }
             break;
@@ -445,10 +451,10 @@
         case Qt::Key_Right:
         {
-            if ( d_data->orientation == Qt::Horizontal )
+            if ( m_data->orientation == Qt::Horizontal )
             {
-                if ( d_data->inverted )
-                    increment = -d_data->singleStep;
+                if ( m_data->inverted )
+                    increment = -m_data->singleStep;
                 else
-                    increment = d_data->singleStep;
+                    increment = m_data->singleStep;
             }
             break;
@@ -456,26 +462,26 @@
         case Qt::Key_PageUp:
         {
-            increment = d_data->pageStepCount * d_data->singleStep;
+            increment = m_data->pageStepCount * m_data->singleStep;
             break;
         }
         case Qt::Key_PageDown:
         {
-            increment = -d_data->pageStepCount * d_data->singleStep;
+            increment = -m_data->pageStepCount * m_data->singleStep;
             break;
         }
         case Qt::Key_Home:
         {
-            value = d_data->minimum;
+            value = m_data->minimum;
             break;
         }
         case Qt::Key_End:
         {
-            value = d_data->maximum;
+            value = m_data->maximum;
             break;
         }
         default:;
-        {
-            event->ignore();
-        }
+            {
+                event->ignore();
+            }
     }
 
@@ -485,37 +491,37 @@
     if ( increment != 0.0 )
     {
-        value = boundedValue( d_data->value + increment );
-
-        if ( d_data->stepAlignment )
+        value = boundedValue( m_data->value + increment );
+
+        if ( m_data->stepAlignment )
             value = alignedValue( value );
     }
 
-    if ( value != d_data->value )
-    {
-        d_data->value = value;
+    if ( value != m_data->value )
+    {
+        m_data->value = value;
         update();
 
-        Q_EMIT valueChanged( d_data->value );
-        Q_EMIT wheelMoved( d_data->value );
-    }
-}
-
-/*!
-  \brief Adjust the number of grooves in the wheel's surface.
-
-  The number of grooves is limited to 6 <= count <= 50.
-  Values outside this range will be clipped.
-  The default value is 10.
-
-  \param count Number of grooves per 360 degrees
-  \sa tickCount()
-*/
+        Q_EMIT valueChanged( m_data->value );
+        Q_EMIT wheelMoved( m_data->value );
+    }
+}
+
+/*!
+   \brief Adjust the number of grooves in the wheel's surface.
+
+   The number of grooves is limited to 6 <= count <= 50.
+   Values outside this range will be clipped.
+   The default value is 10.
+
+   \param count Number of grooves per 360 degrees
+   \sa tickCount()
+ */
 void QwtWheel::setTickCount( int count )
 {
     count = qBound( 6, count, 50 );
 
-    if ( count != d_data->tickCount )
-    {
-        d_data->tickCount = qBound( 6, count, 50 );
+    if ( count != m_data->tickCount )
+    {
+        m_data->tickCount = qBound( 6, count, 50 );
         update();
     }
@@ -523,29 +529,29 @@
 
 /*!
-  \return Number of grooves in the wheel's surface.
-  \sa setTickCnt()
-*/
+   \return Number of grooves in the wheel's surface.
+   \sa setTickCnt()
+ */
 int QwtWheel::tickCount() const
 {
-    return d_data->tickCount;
-}
-
-/*!
-  \brief Set the wheel border width of the wheel.
-
-  The wheel border must not be smaller than 1
-  and is limited in dependence on the wheel's size.
-  Values outside the allowed range will be clipped.
-
-  The wheel border defaults to 2.
-
-  \param borderWidth Border width
-  \sa internalBorder()
-*/
+    return m_data->tickCount;
+}
+
+/*!
+   \brief Set the wheel border width of the wheel.
+
+   The wheel border must not be smaller than 1
+   and is limited in dependence on the wheel's size.
+   Values outside the allowed range will be clipped.
+
+   The wheel border defaults to 2.
+
+   \param borderWidth Border width
+   \sa internalBorder()
+ */
 void QwtWheel::setWheelBorderWidth( int borderWidth )
 {
     const int d = qMin( width(), height() ) / 3;
     borderWidth = qMin( borderWidth, d );
-    d_data->wheelBorderWidth = qMax( borderWidth, 1 );
+    m_data->wheelBorderWidth = qMax( borderWidth, 1 );
     update();
 }
@@ -554,21 +560,21 @@
    \return Wheel border width
    \sa setWheelBorderWidth()
-*/
+ */
 int QwtWheel::wheelBorderWidth() const
 {
-    return d_data->wheelBorderWidth;
-}
-
-/*!
-  \brief Set the border width
-
-  The border defaults to 2.
-
-  \param width Border width
-  \sa borderWidth()
-*/
+    return m_data->wheelBorderWidth;
+}
+
+/*!
+   \brief Set the border width
+
+   The border defaults to 2.
+
+   \param width Border width
+   \sa borderWidth()
+ */
 void QwtWheel::setBorderWidth( int width )
 {
-    d_data->borderWidth = qMax( width, 0 );
+    m_data->borderWidth = qMax( width, 0 );
     update();
 }
@@ -577,32 +583,32 @@
    \return Border width
    \sa setBorderWidth()
-*/
+ */
 int QwtWheel::borderWidth() const
 {
-    return d_data->borderWidth;
+    return m_data->borderWidth;
 }
 
 /*!
    \return Rectangle of the wheel without the outer border
-*/
+ */
 QRect QwtWheel::wheelRect() const
 {
-    const int bw = d_data->borderWidth;
+    const int bw = m_data->borderWidth;
     return contentsRect().adjusted( bw, bw, -bw, -bw );
 }
 
 /*!
-  \brief Set the total angle which the wheel can be turned.
-
-  One full turn of the wheel corresponds to an angle of
-  360 degrees. A total angle of n*360 degrees means
-  that the wheel has to be turned n times around its axis
-  to get from the minimum value to the maximum value.
-
-  The default setting of the total angle is 360 degrees.
-
-  \param angle total angle in degrees
-  \sa totalAngle()
-*/
+   \brief Set the total angle which the wheel can be turned.
+
+   One full turn of the wheel corresponds to an angle of
+   360 degrees. A total angle of n*360 degrees means
+   that the wheel has to be turned n times around its axis
+   to get from the minimum value to the maximum value.
+
+   The default setting of the total angle is 360 degrees.
+
+   \param angle total angle in degrees
+   \sa totalAngle()
+ */
 void QwtWheel::setTotalAngle( double angle )
 {
@@ -610,28 +616,28 @@
         angle = 0.0;
 
-    d_data->totalAngle = angle;
+    m_data->totalAngle = angle;
     update();
 }
 
 /*!
-  \return Total angle which the wheel can be turned.
-  \sa setTotalAngle()
-*/
+   \return Total angle which the wheel can be turned.
+   \sa setTotalAngle()
+ */
 double QwtWheel::totalAngle() const
 {
-    return d_data->totalAngle;
-}
-
-/*!
-  \brief Set the wheel's orientation.
-
-  The default orientation is Qt::Horizontal.
-
-  \param orientation Qt::Horizontal or Qt::Vertical.
-  \sa orientation()
-*/
+    return m_data->totalAngle;
+}
+
+/*!
+   \brief Set the wheel's orientation.
+
+   The default orientation is Qt::Horizontal.
+
+   \param orientation Qt::Horizontal or Qt::Vertical.
+   \sa orientation()
+ */
 void QwtWheel::setOrientation( Qt::Orientation orientation )
 {
-    if ( d_data->orientation == orientation )
+    if ( m_data->orientation == orientation )
         return;
 
@@ -645,54 +651,54 @@
     }
 
-    d_data->orientation = orientation;
+    m_data->orientation = orientation;
     update();
 }
 
 /*!
-  \return Orientation
-  \sa setOrientation()
-*/
+   \return Orientation
+   \sa setOrientation()
+ */
 Qt::Orientation QwtWheel::orientation() const
 {
-    return d_data->orientation;
-}
-
-/*!
-  \brief Specify the visible portion of the wheel.
-
-  You may use this function for fine-tuning the appearance of
-  the wheel. The default value is 175 degrees. The value is
-  limited from 10 to 175 degrees.
-
-  \param angle Visible angle in degrees
-  \sa viewAngle(), setTotalAngle()
-*/
+    return m_data->orientation;
+}
+
+/*!
+   \brief Specify the visible portion of the wheel.
+
+   You may use this function for fine-tuning the appearance of
+   the wheel. The default value is 175 degrees. The value is
+   limited from 10 to 175 degrees.
+
+   \param angle Visible angle in degrees
+   \sa viewAngle(), setTotalAngle()
+ */
 void QwtWheel::setViewAngle( double angle )
 {
-    d_data->viewAngle = qBound( 10.0, angle, 175.0 );
+    m_data->viewAngle = qBound( 10.0, angle, 175.0 );
     update();
 }
 
 /*!
-  \return Visible portion of the wheel
-  \sa setViewAngle(), totalAngle()
-*/
+   \return Visible portion of the wheel
+   \sa setViewAngle(), totalAngle()
+ */
 double QwtWheel::viewAngle() const
 {
-    return d_data->viewAngle;
-}
-
-/*!
-  Determine the value corresponding to a specified point
-
-  \param pos Position
-  \return Value corresponding to pos
-*/
-double QwtWheel::valueAt( const QPoint &pos ) const
+    return m_data->viewAngle;
+}
+
+/*!
+   Determine the value corresponding to a specified point
+
+   \param pos Position
+   \return Value corresponding to pos
+ */
+double QwtWheel::valueAt( const QPoint& pos ) const
 {
     const QRectF rect = wheelRect();
 
     double w, dx;
-    if ( d_data->orientation == Qt::Vertical )
+    if ( m_data->orientation == Qt::Vertical )
     {
         w = rect.height();
@@ -708,5 +714,5 @@
         return 0.0;
 
-    if ( d_data->inverted )
+    if ( m_data->inverted )
     {
         dx = w - dx;
@@ -715,9 +721,9 @@
     // w pixels is an arc of viewAngle degrees,
     // so we convert change in pixels to change in angle
-    const double ang = dx * d_data->viewAngle / w;
+    const double ang = dx * m_data->viewAngle / w;
 
     // value range maps to totalAngle degrees,
     // so convert the change in angle to a change in value
-    const double val = ang * ( maximum() - minimum() ) / d_data->totalAngle;
+    const double val = ang * ( maximum() - minimum() ) / m_data->totalAngle;
 
     return val;
@@ -727,6 +733,6 @@
    \brief Qt Paint Event
    \param event Paint event
-*/
-void QwtWheel::paintEvent( QPaintEvent *event )
+ */
+void QwtWheel::paintEvent( QPaintEvent* event )
 {
     QPainter painter( this );
@@ -734,9 +740,9 @@
 
     QStyleOption opt;
-    opt.init(this);
+    opt.initFrom(this);
     style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
 
     qDrawShadePanel( &painter,
-        contentsRect(), palette(), true, d_data->borderWidth );
+        contentsRect(), palette(), true, m_data->borderWidth );
 
     drawWheelBackground( &painter, wheelRect() );
@@ -752,7 +758,7 @@
    \param painter Painter
    \param rect Geometry for the wheel
-*/
+ */
 void QwtWheel::drawWheelBackground(
-    QPainter *painter, const QRectF &rect )
+    QPainter* painter, const QRectF& rect )
 {
     painter->save();
@@ -762,5 +768,5 @@
     //  draw shaded background
     QLinearGradient gradient( rect.topLeft(),
-        ( d_data->orientation == Qt::Horizontal ) ? rect.topRight() : rect.bottomLeft() );
+        ( m_data->orientation == Qt::Horizontal ) ? rect.topRight() : rect.bottomLeft() );
     gradient.setColorAt( 0.0, pal.color( QPalette::Button ) );
     gradient.setColorAt( 0.2, pal.color( QPalette::Midlight ) );
@@ -773,11 +779,11 @@
 
     const QPen lightPen( palette().color( QPalette::Light ),
-        d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
+        m_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
     const QPen darkPen( pal.color( QPalette::Dark ),
-        d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
-
-    const double bw2 = 0.5 * d_data->wheelBorderWidth;
-
-    if ( d_data->orientation == Qt::Horizontal )
+        m_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
+
+    const double bw2 = 0.5 * m_data->wheelBorderWidth;
+
+    if ( m_data->orientation == Qt::Horizontal )
     {
         painter->setPen( lightPen );
@@ -808,10 +814,10 @@
    \param painter Painter
    \param rect Geometry for the wheel
-*/
-void QwtWheel::drawTicks( QPainter *painter, const QRectF &rect )
-{
-    const double range = d_data->maximum - d_data->minimum;
-
-    if ( range == 0.0 || d_data->totalAngle == 0.0 )
+ */
+void QwtWheel::drawTicks( QPainter* painter, const QRectF& rect )
+{
+    const double range = m_data->maximum - m_data->minimum;
+
+    if ( range == 0.0 || m_data->totalAngle == 0.0 )
     {
         return;
@@ -823,20 +829,20 @@
         0, Qt::SolidLine, Qt::FlatCap );
 
-    const double cnvFactor = qAbs( d_data->totalAngle / range );
-    const double halfIntv = 0.5 * d_data->viewAngle / cnvFactor;
+    const double cnvFactor = qAbs( m_data->totalAngle / range );
+    const double halfIntv = 0.5 * m_data->viewAngle / cnvFactor;
     const double loValue = value() - halfIntv;
     const double hiValue = value() + halfIntv;
-    const double tickWidth = 360.0 / double( d_data->tickCount ) / cnvFactor;
-    const double sinArc = qFastSin( d_data->viewAngle * M_PI / 360.0 );
-
-    if ( d_data->orientation == Qt::Horizontal )
+    const double tickWidth = 360.0 / double( m_data->tickCount ) / cnvFactor;
+    const double sinArc = qFastSin( m_data->viewAngle * M_PI / 360.0 );
+
+    if ( m_data->orientation == Qt::Horizontal )
     {
         const double radius = rect.width() * 0.5;
 
-        double l1 = rect.top() + d_data->wheelBorderWidth;
-        double l2 = rect.bottom() - d_data->wheelBorderWidth - 1;
+        double l1 = rect.top() + m_data->wheelBorderWidth;
+        double l2 = rect.bottom() - m_data->wheelBorderWidth - 1;
 
         // draw one point over the border if border > 1
-        if ( d_data->wheelBorderWidth > 1 )
+        if ( m_data->wheelBorderWidth > 1 )
         {
             l1--;
@@ -848,5 +854,5 @@
 
         // draw tick marks
-        for ( double tickValue = ::ceil( loValue / tickWidth ) * tickWidth;
+        for ( double tickValue = std::ceil( loValue / tickWidth ) * tickWidth;
             tickValue < hiValue; tickValue += tickWidth )
         {
@@ -857,5 +863,5 @@
 
             double tickPos;
-            if ( d_data->inverted )
+            if ( m_data->inverted )
                 tickPos = rect.left() + off;
             else
@@ -865,5 +871,5 @@
             {
                 painter->setPen( darkPen );
-                painter->drawLine( QPointF( tickPos - 1 , l1 ),
+                painter->drawLine( QPointF( tickPos - 1, l1 ),
                     QPointF( tickPos - 1,  l2 ) );
                 painter->setPen( lightPen );
@@ -877,8 +883,8 @@
         const double radius = rect.height() * 0.5;
 
-        double l1 = rect.left() + d_data->wheelBorderWidth;
-        double l2 = rect.right() - d_data->wheelBorderWidth - 1;
-
-        if ( d_data->wheelBorderWidth > 1 )
+        double l1 = rect.left() + m_data->wheelBorderWidth;
+        double l2 = rect.right() - m_data->wheelBorderWidth - 1;
+
+        if ( m_data->wheelBorderWidth > 1 )
         {
             l1--;
@@ -889,5 +895,5 @@
         const double minpos = rect.top() + 2;
 
-        for ( double tickValue = ::ceil( loValue / tickWidth ) * tickWidth;
+        for ( double tickValue = std::ceil( loValue / tickWidth ) * tickWidth;
             tickValue < hiValue; tickValue += tickWidth )
         {
@@ -899,5 +905,5 @@
             double tickPos;
 
-            if ( d_data->inverted )
+            if ( m_data->inverted )
                 tickPos = rect.bottom() - off;
             else
@@ -918,45 +924,45 @@
 
 /*!
-  \brief Set the width of the wheel
-
-  Corresponds to the wheel height for horizontal orientation,
-  and the wheel width for vertical orientation.
-
-  \param width the wheel's width
-  \sa wheelWidth()
-*/
+   \brief Set the width of the wheel
+
+   Corresponds to the wheel height for horizontal orientation,
+   and the wheel width for vertical orientation.
+
+   \param width the wheel's width
+   \sa wheelWidth()
+ */
 void QwtWheel::setWheelWidth( int width )
 {
-    d_data->wheelWidth = width;
+    m_data->wheelWidth = width;
     update();
 }
 
 /*!
-  \return Width of the wheel
-  \sa setWheelWidth()
-*/
+   \return Width of the wheel
+   \sa setWheelWidth()
+ */
 int QwtWheel::wheelWidth() const
 {
-    return d_data->wheelWidth;
-}
-
-/*!
-  \return a size hint
-*/
+    return m_data->wheelWidth;
+}
+
+/*!
+   \return a size hint
+ */
 QSize QwtWheel::sizeHint() const
 {
     const QSize hint = minimumSizeHint();
-    return hint.expandedTo( QApplication::globalStrut() );
-}
-
-/*!
-  \return Minimum size hint
-  \warning The return value is based on the wheel width.
-*/
+    return qwtExpandedToGlobalStrut( hint );
+}
+
+/*!
+   \return Minimum size hint
+   \warning The return value is based on the wheel width.
+ */
 QSize QwtWheel::minimumSizeHint() const
 {
-    QSize sz( 3 * d_data->wheelWidth + 2 * d_data->borderWidth,
-        d_data->wheelWidth + 2 * d_data->borderWidth );
-    if ( d_data->orientation != Qt::Horizontal )
+    QSize sz( 3 * m_data->wheelWidth + 2 * m_data->borderWidth,
+        m_data->wheelWidth + 2 * m_data->borderWidth );
+    if ( m_data->orientation != Qt::Horizontal )
         sz.transpose();
 
@@ -965,116 +971,116 @@
 
 /*!
-  \brief Set the step size of the counter
-
-  A value <= 0.0 disables stepping
-
-  \param stepSize Single step size
-  \sa singleStep(), setPageStepCount()
-*/
+   \brief Set the step size of the counter
+
+   A value <= 0.0 disables stepping
+
+   \param stepSize Single step size
+   \sa singleStep(), setPageStepCount()
+ */
 void QwtWheel::setSingleStep( double stepSize )
 {
-    d_data->singleStep = qMax( stepSize, 0.0 );
-}
-
-/*!
-  \return Single step size
-  \sa setSingleStep()
+    m_data->singleStep = qwtMaxF( stepSize, 0.0 );
+}
+
+/*!
+   \return Single step size
+   \sa setSingleStep()
  */
 double QwtWheel::singleStep() const
 {
-    return d_data->singleStep;
-}
-
-/*!
-  \brief En/Disable step alignment
-
-  When step alignment is enabled value changes initiated by
-  user input ( mouse, keyboard, wheel ) are aligned to
-  the multiples of the single step.
-
-  \param on On/Off
-  \sa stepAlignment(), setSingleStep()
+    return m_data->singleStep;
+}
+
+/*!
+   \brief En/Disable step alignment
+
+   When step alignment is enabled value changes initiated by
+   user input ( mouse, keyboard, wheel ) are aligned to
+   the multiples of the single step.
+
+   \param on On/Off
+   \sa stepAlignment(), setSingleStep()
  */
 void QwtWheel::setStepAlignment( bool on )
 {
-    if ( on != d_data->stepAlignment )
-    {
-        d_data->stepAlignment = on;
-    }
-}
-
-/*!
-  \return True, when the step alignment is enabled
-  \sa setStepAlignment(), singleStep()
+    if ( on != m_data->stepAlignment )
+    {
+        m_data->stepAlignment = on;
+    }
+}
+
+/*!
+   \return True, when the step alignment is enabled
+   \sa setStepAlignment(), singleStep()
  */
 bool QwtWheel::stepAlignment() const
 {
-    return d_data->stepAlignment;
-}
-
-/*!
-  \brief Set the page step count
-
-  pageStepCount is a multiplicator for the single step size
-  that typically corresponds to the user pressing PageUp or PageDown.
-
-  A value of 0 disables page stepping.
-
-  The default value is 1.
-
-  \param count Multiplicator for the single step size
-  \sa pageStepCount(), setSingleStep()
+    return m_data->stepAlignment;
+}
+
+/*!
+   \brief Set the page step count
+
+   pageStepCount is a multiplicator for the single step size
+   that typically corresponds to the user pressing PageUp or PageDown.
+
+   A value of 0 disables page stepping.
+
+   The default value is 1.
+
+   \param count Multiplicator for the single step size
+   \sa pageStepCount(), setSingleStep()
  */
 void QwtWheel::setPageStepCount( int count )
 {
-    d_data->pageStepCount = qMax( 0, count );
-}
-
-/*!
-  \return Page step count
-  \sa setPageStepCount(), singleStep()
+    m_data->pageStepCount = qMax( 0, count );
+}
+
+/*!
+   \return Page step count
+   \sa setPageStepCount(), singleStep()
  */
 int QwtWheel::pageStepCount() const
 {
-    return d_data->pageStepCount;
-}
-
-/*!
-  \brief Set the minimum and maximum values
-
-  The maximum is adjusted if necessary to ensure that the range remains valid.
-  The value might be modified to be inside of the range.
-
-  \param min Minimum value
-  \param max Maximum value
-
-  \sa minimum(), maximum()
+    return m_data->pageStepCount;
+}
+
+/*!
+   \brief Set the minimum and maximum values
+
+   The maximum is adjusted if necessary to ensure that the range remains valid.
+   The value might be modified to be inside of the range.
+
+   \param min Minimum value
+   \param max Maximum value
+
+   \sa minimum(), maximum()
  */
 void QwtWheel::setRange( double min, double max )
 {
-    max = qMax( min, max );
-
-    if ( d_data->minimum == min && d_data->maximum == max )
+    max = qwtMaxF( min, max );
+
+    if ( m_data->minimum == min && m_data->maximum == max )
         return;
 
-    d_data->minimum = min;
-    d_data->maximum = max;
-
-    if ( d_data->value < min || d_data->value > max )
-    {
-        d_data->value = qBound( min, d_data->value, max );
+    m_data->minimum = min;
+    m_data->maximum = max;
+
+    if ( m_data->value < min || m_data->value > max )
+    {
+        m_data->value = qBound( min, m_data->value, max );
 
         update();
-        Q_EMIT valueChanged( d_data->value );
-    }
-}
-/*!
-  Set the minimum value of the range
-
-  \param value Minimum value
-  \sa setRange(), setMaximum(), minimum()
-
-  \note The maximum is adjusted if necessary to ensure that the range remains valid.
-*/
+        Q_EMIT valueChanged( m_data->value );
+    }
+}
+/*!
+   Set the minimum value of the range
+
+   \param value Minimum value
+   \sa setRange(), setMaximum(), minimum()
+
+   \note The maximum is adjusted if necessary to ensure that the range remains valid.
+ */
 void QwtWheel::setMinimum( double value )
 {
@@ -1083,18 +1089,18 @@
 
 /*!
-  \return The minimum of the range
-  \sa setRange(), setMinimum(), maximum()
-*/
+   \return The minimum of the range
+   \sa setRange(), setMinimum(), maximum()
+ */
 double QwtWheel::minimum() const
 {
-    return d_data->minimum;
-}
-
-/*!
-  Set the maximum value of the range
-
-  \param value Maximum value
-  \sa setRange(), setMinimum(), maximum()
-*/
+    return m_data->minimum;
+}
+
+/*!
+   Set the maximum value of the range
+
+   \param value Maximum value
+   \sa setRange(), setMinimum(), maximum()
+ */
 void QwtWheel::setMaximum( double value )
 {
@@ -1103,61 +1109,61 @@
 
 /*!
-  \return The maximum of the range
-  \sa setRange(), setMaximum(), minimum()
-*/
+   \return The maximum of the range
+   \sa setRange(), setMaximum(), minimum()
+ */
 double QwtWheel::maximum() const
 {
-    return d_data->maximum;
-}
-
-/*!
-  \brief Set a new value without adjusting to the step raster
-
-  \param value New value
-
-  \sa value(), valueChanged()
-  \warning The value is clipped when it lies outside the range.
-*/
+    return m_data->maximum;
+}
+
+/*!
+   \brief Set a new value without adjusting to the step raster
+
+   \param value New value
+
+   \sa value(), valueChanged()
+   \warning The value is clipped when it lies outside the range.
+ */
 void QwtWheel::setValue( double value )
 {
     stopFlying();
-    d_data->isScrolling = false;
-
-    value = qBound( d_data->minimum, value, d_data->maximum );
-
-    if ( d_data->value != value )
-    {
-        d_data->value = value;
+    m_data->isScrolling = false;
+
+    value = qBound( m_data->minimum, value, m_data->maximum );
+
+    if ( m_data->value != value )
+    {
+        m_data->value = value;
 
         update();
-        Q_EMIT valueChanged( d_data->value );
-    }
-}
-
-/*!
-  \return Current value of the wheel
-  \sa setValue(), valueChanged()
+        Q_EMIT valueChanged( m_data->value );
+    }
+}
+
+/*!
+   \return Current value of the wheel
+   \sa setValue(), valueChanged()
  */
 double QwtWheel::value() const
 {
-    return d_data->value;
-}
-
-/*!
-  \brief En/Disable inverted appearance
-
-  An inverted wheel increases its values in the opposite direction.
-  The direction of an inverted horizontal wheel will be from right to left
-  an inverted vertical wheel will increase from bottom to top.
-
-  \param on En/Disable inverted appearance
-  \sa isInverted()
+    return m_data->value;
+}
+
+/*!
+   \brief En/Disable inverted appearance
+
+   An inverted wheel increases its values in the opposite direction.
+   The direction of an inverted horizontal wheel will be from right to left
+   an inverted vertical wheel will increase from bottom to top.
+
+   \param on En/Disable inverted appearance
+   \sa isInverted()
 
  */
 void QwtWheel::setInverted( bool on )
 {
-    if ( d_data->inverted != on )
-    {
-        d_data->inverted = on;
+    if ( m_data->inverted != on )
+    {
+        m_data->inverted = on;
         update();
     }
@@ -1165,74 +1171,74 @@
 
 /*!
-  \return True, when the wheel is inverted
-  \sa setInverted()
+   \return True, when the wheel is inverted
+   \sa setInverted()
  */
 bool QwtWheel::isInverted() const
 {
-    return d_data->inverted;
-}
-
-/*!
-  \brief En/Disable wrapping
-
-  If wrapping is true stepping up from maximum() value will take
-  you to the minimum() value and vice versa.
-
-  \param on En/Disable wrapping
-  \sa wrapping()
+    return m_data->inverted;
+}
+
+/*!
+   \brief En/Disable wrapping
+
+   If wrapping is true stepping up from maximum() value will take
+   you to the minimum() value and vice versa.
+
+   \param on En/Disable wrapping
+   \sa wrapping()
  */
 void QwtWheel::setWrapping( bool on )
 {
-    d_data->wrapping = on;
-}
-
-/*!
-  \return True, when wrapping is set
-  \sa setWrapping()
+    m_data->wrapping = on;
+}
+
+/*!
+   \return True, when wrapping is set
+   \sa setWrapping()
  */
 bool QwtWheel::wrapping() const
 {
-    return d_data->wrapping;
-}
-
-/*!
-  \brief Set the slider's mass for flywheel effect.
-
-  If the slider's mass is greater then 0, it will continue
-  to move after the mouse button has been released. Its speed
-  decreases with time at a rate depending on the slider's mass.
-  A large mass means that it will continue to move for a
-  long time.
-
-  Derived widgets may overload this function to make it public.
-
-  \param mass New mass in kg
-
-  \bug If the mass is smaller than 1g, it is set to zero.
+    return m_data->wrapping;
+}
+
+/*!
+   \brief Set the slider's mass for flywheel effect.
+
+   If the slider's mass is greater then 0, it will continue
+   to move after the mouse button has been released. Its speed
+   decreases with time at a rate depending on the slider's mass.
+   A large mass means that it will continue to move for a
+   long time.
+
+   Derived widgets may overload this function to make it public.
+
+   \param mass New mass in kg
+
+   \bug If the mass is smaller than 1g, it is set to zero.
        The maximal mass is limited to 100kg.
-  \sa mass()
-*/
+   \sa mass()
+ */
 void QwtWheel::setMass( double mass )
 {
     if ( mass < 0.001 )
     {
-        d_data->mass = 0.0;
+        m_data->mass = 0.0;
     }
     else
     {
-        d_data->mass = qMin( 100.0, mass );
-    }
-
-    if ( d_data->mass <= 0.0 )
+        m_data->mass = qwtMinF( 100.0, mass );
+    }
+
+    if ( m_data->mass <= 0.0 )
         stopFlying();
 }
 
 /*!
-  \return mass
-  \sa setMass()
-*/
+   \return mass
+   \sa setMass()
+ */
 double QwtWheel::mass() const
 {
-    return d_data->mass;
+    return m_data->mass;
 }
 
@@ -1240,9 +1246,9 @@
 void QwtWheel::stopFlying()
 {
-    if ( d_data->timerId != 0 )
-    {
-        killTimer( d_data->timerId );
-        d_data->timerId = 0;
-        d_data->speed = 0.0;
+    if ( m_data->timerId != 0 )
+    {
+        killTimer( m_data->timerId );
+        m_data->timerId = 0;
+        m_data->speed = 0.0;
     }
 }
@@ -1250,20 +1256,20 @@
 double QwtWheel::boundedValue( double value ) const
 {
-    const double range = d_data->maximum - d_data->minimum;
-
-    if ( d_data->wrapping && range >= 0.0 )
-    {
-        if ( value < d_data->minimum )
-        {
-            value += ::ceil( ( d_data->minimum - value ) / range ) * range;
-        }
-        else if ( value > d_data->maximum )
-        {
-            value -= ::ceil( ( value - d_data->maximum ) / range ) * range;
+    const double range = m_data->maximum - m_data->minimum;
+
+    if ( m_data->wrapping && range >= 0.0 )
+    {
+        if ( value < m_data->minimum )
+        {
+            value += std::ceil( ( m_data->minimum - value ) / range ) * range;
+        }
+        else if ( value > m_data->maximum )
+        {
+            value -= std::ceil( ( value - m_data->maximum ) / range ) * range;
         }
     }
     else
     {
-        value = qBound( d_data->minimum, value, d_data->maximum );
+        value = qBound( m_data->minimum, value, m_data->maximum );
     }
 
@@ -1273,10 +1279,10 @@
 double QwtWheel::alignedValue( double value ) const
 {
-    const double stepSize = d_data->singleStep;
+    const double stepSize = m_data->singleStep;
 
     if ( stepSize > 0.0 )
     {
-        value = d_data->minimum +
-            qRound( ( value - d_data->minimum ) / stepSize ) * stepSize;
+        value = m_data->minimum +
+            qRound( ( value - m_data->minimum ) / stepSize ) * stepSize;
 
         if ( stepSize > 1e-12 )
@@ -1287,8 +1293,8 @@
                 value = 0.0;
             }
-            else if ( qFuzzyCompare( value, d_data->maximum ) )
+            else if ( qFuzzyCompare( value, m_data->maximum ) )
             {
                 // correct rounding error at the border
-                value = d_data->maximum;
+                value = m_data->maximum;
             }
         }
@@ -1298,2 +1304,3 @@
 }
 
+#include "moc_qwt_wheel.cpp"
