Loading...
Searching...
No Matches
qwt_knob.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_KNOB_H
#define QWT_KNOB_H
#include "qwt_global.h"
#include "qwt_abstract_slider.h"
class QwtRoundScaleDraw;
class QWT_EXPORT QwtKnob : public QwtAbstractSlider
{
Q_OBJECT
Q_ENUMS ( KnobStyle MarkerStyle )
Q_PROPERTY( KnobStyle knobStyle READ knobStyle WRITE setKnobStyle )
Q_PROPERTY( int knobWidth READ knobWidth WRITE setKnobWidth )
Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment )
Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
Q_PROPERTY( int numTurns READ numTurns WRITE setNumTurns )
Q_PROPERTY( MarkerStyle markerStyle READ markerStyle WRITE setMarkerStyle )
Q_PROPERTY( int markerSize READ markerSize WRITE setMarkerSize )
Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
public:
enum KnobStyle
{
Flat,
Raised,
Sunken,
Styled
};
enum MarkerStyle
{
NoMarker = -1,
Tick,
Triangle,
Dot,
Nub,
Notch
};
explicit QwtKnob( QWidget* parent = NULL );
virtual ~QwtKnob();
void setAlignment( Qt::Alignment );
Qt::Alignment alignment() const;
void setKnobWidth( int );
int knobWidth() const;
void setNumTurns( int );
int numTurns() const;
void setTotalAngle ( double angle );
double totalAngle() const;
void setKnobStyle( KnobStyle );
KnobStyle knobStyle() const;
void setBorderWidth( int );
int borderWidth() const;
void setMarkerStyle( MarkerStyle );
MarkerStyle markerStyle() const;
void setMarkerSize( int );
int markerSize() const;
virtual QSize sizeHint() const QWT_OVERRIDE;
virtual QSize minimumSizeHint() const QWT_OVERRIDE;
void setScaleDraw( QwtRoundScaleDraw* );
const QwtRoundScaleDraw* scaleDraw() const;
QwtRoundScaleDraw* scaleDraw();
QRect knobRect() const;
protected:
virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
virtual void changeEvent( QEvent* ) QWT_OVERRIDE;
virtual void drawKnob( QPainter*, const QRectF& ) const;
virtual void drawFocusIndicator( QPainter* ) const;
virtual void drawMarker( QPainter*,
const QRectF&, double angle ) const;
virtual double scrolledTo( const QPoint& ) const QWT_OVERRIDE;
virtual bool isScrollPosition( const QPoint& ) const QWT_OVERRIDE;
private:
class PrivateData;
PrivateData* m_data;
};
#endif
QwtAbstractSlider
An abstract base class for slider widgets with a scale.
Definition qwt_abstract_slider.h:33
QwtKnob
The Knob Widget.
Definition qwt_knob.h:43
QwtKnob::MarkerStyle
MarkerStyle
Marker type.
Definition qwt_knob.h:96
QwtKnob::Nub
@ Nub
Definition qwt_knob.h:113
QwtKnob::Dot
@ Dot
Paint a circle in QPalette::ButtonText color.
Definition qwt_knob.h:107
QwtKnob::Tick
@ Tick
Paint a single tick in QPalette::ButtonText color.
Definition qwt_knob.h:101
QwtKnob::Triangle
@ Triangle
Paint a triangle in QPalette::ButtonText color.
Definition qwt_knob.h:104
QwtKnob::KnobStyle
KnobStyle
Style of the knob surface.
Definition qwt_knob.h:67
QwtKnob::Flat
@ Flat
Fill the knob with a brush from QPalette::Button.
Definition qwt_knob.h:69
QwtKnob::Sunken
@ Sunken
Definition qwt_knob.h:78
QwtKnob::Raised
@ Raised
Build a gradient from QPalette::Midlight and QPalette::Button.
Definition qwt_knob.h:72
QwtRoundScaleDraw
A class for drawing round scales.
Definition qwt_round_scale_draw.h:32