QwtKnob (3) - Linux Manuals
NAME
QwtKnob -
SYNOPSIS
#include <qwt_knob.h>
Public Types
enum KnobStyle { Flat, Raised, Sunken, Styled }
Style of the knob surface.
enum MarkerStyle { NoMarker = -1, Tick, Triangle, Dot, Nub, Notch }
Marker type.
Public Member Functions
QwtKnob (QWidget *parent=NULL)
Constructor.
virtual ~QwtKnob ()
Destructor.
void setAlignment (Qt::Alignment)
Set the alignment of the knob.
Qt::Alignment alignment () const
void setKnobWidth (int)
Change the knob's width.
int knobWidth () const
Return the width of the knob.
void setNumTurns (int)
Set the number of turns.
int numTurns () const
void setTotalAngle (double angle)
Set the total angle by which the knob can be turned.
double totalAngle () const
void setKnobStyle (KnobStyle)
Set the knob type.
KnobStyle knobStyle () const
void setBorderWidth (int bw)
Set the knob's border width.
int borderWidth () const
Return the border width.
void setMarkerStyle (MarkerStyle)
Set the marker type of the knob.
MarkerStyle markerStyle () const
void setMarkerSize (int)
Set the size of the marker.
int markerSize () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
void setScaleDraw (QwtRoundScaleDraw *)
const QwtRoundScaleDraw * scaleDraw () const
QwtRoundScaleDraw * scaleDraw ()
QRect knobRect () const
Protected Member Functions
virtual void paintEvent (QPaintEvent *)
virtual void changeEvent (QEvent *)
virtual void drawKnob (QPainter *, const QRectF &) const
Draw the knob.
virtual void drawFocusIndicator (QPainter *) const
virtual void drawMarker (QPainter *, const QRectF &, double arc) const
Draw the marker at the knob's front.
virtual double scrolledTo (const QPoint &) const
Determine the value for a new position of the mouse.
virtual bool isScrollPosition (const QPoint &) const
Determine what to do when the user presses a mouse button.
Additional Inherited Members
Detailed Description
The Knob Widget.
The QwtKnob widget imitates look and behavior of a volume knob on a radio. It looks similar to QDial - not to QwtDial.
The value range of a knob might be divided into several turns.
The layout of the knob depends on the knobWidth().
- •
- width > 0 The diameter of the knob is fixed and the knob is aligned according to the alignment() flags inside of the contentsRect().
- •
- width <= 0 The knob is extended to the minimum of width/height of the contentsRect() and aligned in the other direction according to alignment().
Setting a fixed knobWidth() is helpful to align several knobs with different scale labels.
Style of the knob surface. Depending on the KnobStyle the surface of the knob is filled from the brushes of the widget palette().
See Also:
Enumerator
Marker type. The marker indicates the current value on the knob The default setting is a Notch marker.
See Also:
Enumerator
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.
Parameters:
See Also:
Returns:
See Also:
Parameters:
Parameters:
Draw the knob.
Parameters:
Draw the marker at the knob's front.
Parameters:
Determine what to do when the user presses a mouse button.
Parameters:
Return values:
See Also:
Returns:
See Also:
Returns:
See Also:
Returns:
See Also:
Returns:
See Also:
Returns:
See Also:
Returns:
When the total angle is below 360° numTurns() is ceiled to 1.
See Also:
Parameters:
Returns:
See Also:
Returns:
See Also:
Determine the value for a new position of the mouse.
Parameters:
Returns:
See Also:
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
Parameters:
See Also:
Set the knob's border width.
Parameters:
Set the knob type.
Parameters:
See Also:
Change the knob's width. Setting a fixed value for the diameter of the knob is helpful for aligning several knobs in a row.
Parameters:
See Also:
Note:
Set the size of the marker. When setting a size <= 0 the marker will automatically scaled to 40% of the radius of the knob.
See Also:
Set the marker type of the knob.
Parameters:
See Also:
Set the number of turns. When numTurns > 1 the knob can be turned several times around its axis
See Also:
For changing the labels of the scales, it is necessary to derive from QwtRoundScaleDraw and overload QwtRoundScaleDraw::label().
See Also:
Set the total angle by which the knob can be turned.
Parameters:
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.
See Also:
Returns:
Returns:
See Also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Member Enumeration Documentation
enum QwtKnob::KnobStyle
enum QwtKnob::MarkerStyle
Constructor & Destructor Documentation
QwtKnob::QwtKnob (QWidget *parent = NULL) [explicit]
Member Function Documentation
Qt::Alignment QwtKnob::alignment () const
void QwtKnob::changeEvent (QEvent *event) [protected], [virtual]
Handle QEvent::StyleChange and QEvent::FontChange;
void QwtKnob::drawFocusIndicator (QPainter *painter) const [protected], [virtual]
Draw the focus indicator
void QwtKnob::drawKnob (QPainter *painter, const QRectF &knobRect) const [protected], [virtual]
knobRect Bounding rectangle of the knob (without scale)
void QwtKnob::drawMarker (QPainter *painter, const QRectF &rect, doubleangle) const [protected], [virtual]
rect Bounding rectangle of the knob without scale
angle Angle of the marker in degrees ( clockwise, 0 at the 12 o'clock position )
bool QwtKnob::isScrollPosition (const QPoint &pos) const [protected], [virtual]
QRect QwtKnob::knobRect () const
Calculate the bounding rectangle of the knob without the scale
QwtKnob::KnobStyle QwtKnob::knobStyle () const
int QwtKnob::markerSize () const
QwtKnob::MarkerStyle QwtKnob::markerStyle () const
QSize QwtKnob::minimumSizeHint () const [virtual]
int QwtKnob::numTurns () const
void QwtKnob::paintEvent (QPaintEvent *event) [protected], [virtual]
Repaint the knob
const QwtRoundScaleDraw * QwtKnob::scaleDraw () const
QwtRoundScaleDraw * QwtKnob::scaleDraw ()
double QwtKnob::scrolledTo (const QPoint &pos) const [protected], [virtual]
void QwtKnob::setAlignment (Qt::Alignmentalignment)
void QwtKnob::setBorderWidth (intborderWidth)
void QwtKnob::setKnobStyle (KnobStyleknobStyle)
void QwtKnob::setKnobWidth (intwidth)
void QwtKnob::setMarkerSize (intsize)
void QwtKnob::setMarkerStyle (MarkerStylemarkerStyle)
void QwtKnob::setNumTurns (intnumTurns)
void QwtKnob::setScaleDraw (QwtRoundScaleDraw *scaleDraw)
Change the scale draw of the knob
void QwtKnob::setTotalAngle (doubleangle)
QSize QwtKnob::sizeHint () const [virtual]
double QwtKnob::totalAngle () const
Author