qwt_wheel.h
Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_WHEEL_H
00011 #define QWT_WHEEL_H
00012 
00013 #include "qwt_global.h"
00014 #include <qwidget.h>
00015 
00027 class QWT_EXPORT QwtWheel: public QWidget
00028 {
00029     Q_OBJECT
00030 
00031     Q_PROPERTY( Qt::Orientation orientation
00032                 READ orientation WRITE setOrientation )
00033 
00034     Q_PROPERTY( double value READ value WRITE setValue NOTIFY valueChanged USER true  )
00035 
00036     Q_PROPERTY( double minimum READ minimum WRITE setMinimum )
00037     Q_PROPERTY( double maximum READ maximum WRITE setMaximum )
00038 
00039     Q_PROPERTY( double singleStep READ singleStep WRITE setSingleStep )
00040     Q_PROPERTY( int pageStepCount READ pageStepCount WRITE setPageStepCount )
00041     Q_PROPERTY( bool stepAlignment READ stepAlignment WRITE setStepAlignment )
00042 
00043     Q_PROPERTY( bool tracking READ isTracking WRITE setTracking )
00044     Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
00045     Q_PROPERTY( bool inverted READ isInverted WRITE setInverted )
00046 
00047     Q_PROPERTY( double mass READ mass WRITE setMass )
00048     Q_PROPERTY( int updateInterval READ updateInterval WRITE setUpdateInterval )
00049 
00050     Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
00051     Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
00052     Q_PROPERTY( int tickCount READ tickCount WRITE setTickCount )
00053     Q_PROPERTY( int wheelWidth READ wheelWidth WRITE setWheelWidth )
00054     Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
00055     Q_PROPERTY( int wheelBorderWidth READ wheelBorderWidth WRITE setWheelBorderWidth )
00056 
00057 public:
00058     explicit QwtWheel( QWidget *parent = NULL );
00059     virtual ~QwtWheel();
00060 
00061     double value() const;
00062 
00063     void setOrientation( Qt::Orientation );
00064     Qt::Orientation orientation() const;
00065 
00066     double totalAngle() const;
00067     double viewAngle() const;
00068 
00069     void setTickCount( int );
00070     int tickCount() const;
00071 
00072     void setWheelWidth( int );
00073     int wheelWidth() const;
00074 
00075     void setWheelBorderWidth( int );
00076     int wheelBorderWidth() const;
00077 
00078     void setBorderWidth( int );
00079     int borderWidth() const;
00080 
00081     void setInverted( bool tf );
00082     bool isInverted() const;
00083 
00084     void setWrapping( bool tf );
00085     bool wrapping() const;
00086 
00087     void setSingleStep( double );
00088     double singleStep() const;
00089 
00090     void setPageStepCount( int );
00091     int pageStepCount() const;
00092 
00093     void setStepAlignment( bool on );
00094     bool stepAlignment() const;
00095 
00096     void setRange( double vmin, double vmax );
00097 
00098     void setMinimum( double min );
00099     double minimum() const;
00100 
00101     void setMaximum( double max );
00102     double maximum() const;
00103 
00104     void setUpdateInterval( int );
00105     int updateInterval() const;
00106 
00107     void setTracking( bool enable );
00108     bool isTracking() const;
00109 
00110     double mass() const;
00111 
00112 public Q_SLOTS:
00113     void setValue( double );
00114     void setTotalAngle ( double );
00115     void setViewAngle( double );
00116     void setMass( double );
00117 
00118 Q_SIGNALS:
00119 
00129     void valueChanged( double value );
00130 
00135     void wheelPressed();
00136 
00140     void wheelReleased();
00141 
00148     void wheelMoved( double value );
00149 
00150 protected:
00151     virtual void paintEvent( QPaintEvent * );
00152     virtual void mousePressEvent( QMouseEvent * );
00153     virtual void mouseReleaseEvent( QMouseEvent * );
00154     virtual void mouseMoveEvent( QMouseEvent * );
00155     virtual void keyPressEvent( QKeyEvent * );
00156     virtual void wheelEvent( QWheelEvent * );
00157     virtual void timerEvent( QTimerEvent * );
00158 
00159     void stopFlying();
00160 
00161     QRect wheelRect() const;
00162 
00163     virtual QSize sizeHint() const;
00164     virtual QSize minimumSizeHint() const;
00165 
00166     virtual void drawTicks( QPainter *, const QRectF & );
00167     virtual void drawWheelBackground( QPainter *, const QRectF & );
00168 
00169     virtual double valueAt( const QPoint & ) const;
00170 
00171 private:
00172     double alignedValue( double ) const;
00173     double boundedValue( double ) const;
00174 
00175     class PrivateData;
00176     PrivateData *d_data;
00177 };
00178 
00179 #endif


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:57