#include <qwt_dial.h>
List of all members.
Public Types |
enum | ScaleComponent {
Backbone = 0x01,
Ticks = 0x02,
Labels = 0x04
} |
typedef QFlags< ScaleComponent > | ScaleComponents |
Public Member Functions |
QPointF | center () const |
virtual void | draw (QPainter *, const QPalette &) const |
void | enableComponent (ScaleComponent, bool enable=true) |
virtual double | extent (const QFont &) const |
bool | hasComponent (ScaleComponent) const |
virtual QwtText | label (double value) const |
double | maxTickLength () const |
double | minimumExtent () const |
void | moveCenter (double x, double y) |
void | moveCenter (const QPointF &) |
double | penWidth () const |
| QwtDialScaleDraw (QwtDial *) |
int | radius () const |
const QwtScaleDiv & | scaleDiv () const |
const QwtScaleMap & | scaleMap () const |
QwtScaleMap & | scaleMap () |
void | setAngleRange (double angle1, double angle2) |
void | setMinimumExtent (double) |
void | setPenWidth (double) |
void | setPenWidth (int width) |
void | setRadius (int radius) |
void | setScaleDiv (const QwtScaleDiv &s) |
void | setSpacing (double margin) |
void | setTickLength (QwtScaleDiv::TickType, double length) |
void | setTransformation (QwtScaleTransformation *) |
double | spacing () const |
double | tickLength (QwtScaleDiv::TickType) const |
Protected Member Functions |
virtual void | drawBackbone (QPainter *p) const |
virtual void | drawLabel (QPainter *p, double val) const |
virtual void | drawTick (QPainter *p, double val, double len) const |
void | invalidateCache () |
const QwtText & | tickLabel (const QFont &, double value) const |
Detailed Description
A special scale draw made for QwtDial.
- See also:
- QwtDial, QwtCompass
Member Typedef Documentation
Member Enumeration Documentation
Components of a scale
- See also:
- enableComponent(), hasComponent
- Enumerator:
Backbone |
Backbone = the line where the ticks are located.
|
Ticks |
Ticks.
|
Labels |
Labels.
|
Constructor & Destructor Documentation
Member Function Documentation
Get the center of the scale.
Draw the scale.
- Parameters:
-
painter | The painter |
palette | Palette, text color is used for the labels, foreground color for ticks and backbone |
En/Disable a component of the scale
- Parameters:
-
component | Scale component |
enable | On/Off |
- See also:
- hasComponent()
Calculate the extent of the scale
The extent is the distance between the baseline to the outermost pixel of the scale draw. radius() + extent() is an upper limit for the radius of the bounding circle.
- Parameters:
-
font | Font used for painting the labels |
- See also:
- setMinimumExtent(), minimumExtent()
- Warning:
- The implemented algo is not too smart and calculates only an upper limit, that might be a few pixels too large
Implements QwtAbstractScaleDraw.
Move the center of the scale draw, leaving the radius unchanged.
Move the center of the scale draw, leaving the radius unchanged
- Parameters:
-
- See also:
- setRadius()
Get the radius
Radius is the radius of the backbone without ticks and labels.
- See also:
- setRadius(), extent()
- Returns:
- Map how to translate between scale and pixel values
- Returns:
- Map how to translate between scale and pixel values
Adjust the baseline circle segment for round scales.
The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The default setting is [ -135, 135 ]. An angle of 0 degrees corresponds to the 12 o'clock position, and positive angles count in a clockwise direction.
- Parameters:
-
angle1 | |
angle2 | boundaries of the angle interval in degrees. |
- Warning:
-
The angle range is limited to [-360, 360] degrees. Angles exceeding this range will be clipped.
-
For angles more than 359 degrees above or below min(angle1, angle2), scale marks will not be drawn.
-
If you need a counterclockwise scale, use QwtScaleDiv::setRange
Set a minimum for the extent.
The extent is calculated from the coomponents of the scale draw. In situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale), setting an upper limit as minimum extent will avoid jumps of the layout.
- Parameters:
-
- See also:
- extent(), minimumExtent()
Specify the width of the scale pen.
- Parameters:
-
- See also:
- penWidth()
Change of radius the scale
Radius is the radius of the backbone without ticks and labels.
- Parameters:
-
- See also:
- moveCenter()
Change the scale division
- Parameters:
-
Set the spacing between tick and labels.
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
- Parameters:
-
- See also:
- spacing()
Set the length of the ticks
- Parameters:
-
tickType | Tick type |
length | New length |
- Warning:
- the length is limited to [0..1000]
Change the transformation of the scale
- Parameters:
-
transformation | New scale transformation |
Get the spacing.
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
- See also:
- setSpacing()
Convert a value into its representing label and cache it.
The conversion between value and label is called very often in the layout and painting code. Unfortunately the calculation of the label sizes might be slow (really slow for rich text in Qt4), so it's necessary to cache the labels.
- Parameters:
-
- Returns:
- Tick label