QwtScaleWidget Class Reference
A Widget which contains a scale.
More...
#include <qwt_scale_widget.h>
List of all members.
Signals |
void | scaleDivChanged () |
Public Member Functions |
| QwtScaleWidget (QWidget *parent=NULL) |
| QwtScaleWidget (QwtScaleDraw::Alignment, QWidget *parent=NULL) |
virtual | ~QwtScaleWidget () |
void | setTitle (const QString &title) |
void | setTitle (const QwtText &title) |
QwtText | title () const |
void | setBorderDist (int start, int end) |
int | startBorderDist () const |
int | endBorderDist () const |
void | getBorderDistHint (int &start, int &end) const |
void | getMinBorderDist (int &start, int &end) const |
void | setMinBorderDist (int start, int end) |
void | setMargin (int) |
int | margin () const |
void | setSpacing (int td) |
int | spacing () const |
void | setPenWidth (int) |
int | penWidth () const |
void | setScaleDiv (QwtScaleTransformation *, const QwtScaleDiv &sd) |
void | setScaleDraw (QwtScaleDraw *) |
const QwtScaleDraw * | scaleDraw () const |
QwtScaleDraw * | scaleDraw () |
void | setLabelAlignment (Qt::Alignment) |
void | setLabelRotation (double rotation) |
void | setColorBarEnabled (bool) |
bool | isColorBarEnabled () const |
void | setColorBarWidth (int) |
int | colorBarWidth () const |
void | setColorMap (const QwtDoubleInterval &, const QwtColorMap &) |
QwtDoubleInterval | colorBarInterval () const |
const QwtColorMap & | colorMap () const |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
int | titleHeightForWidth (int width) const |
int | dimForLength (int length, const QFont &scaleFont) const |
void | drawColorBar (QPainter *painter, const QRect &rect) const |
void | drawTitle (QPainter *painter, QwtScaleDraw::Alignment, const QRect &rect) const |
void | setAlignment (QwtScaleDraw::Alignment) |
QwtScaleDraw::Alignment | alignment () const |
QRect | colorBarRect (const QRect &) const |
Protected Member Functions |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
void | draw (QPainter *p) const |
void | scaleChange () |
void | layoutScale (bool update=true) |
Detailed Description
A Widget which contains a scale.
This Widget can be used to decorate composite widgets with a scale.
Constructor & Destructor Documentation
QwtScaleWidget::QwtScaleWidget |
( |
QWidget * |
parent = NULL |
) |
[explicit] |
Create a scale with the position QwtScaleWidget::Left.
- Parameters:
-
Constructor.
- Parameters:
-
| align | Alignment. |
| parent | Parent widget |
QwtScaleWidget::~QwtScaleWidget |
( |
|
) |
[virtual] |
Member Function Documentation
- Returns:
- position
- See also:
- setPosition()
int QwtScaleWidget::dimForLength |
( |
int |
length, |
|
|
const QFont & |
scaleFont | |
|
) |
| | const |
Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.
- Parameters:
-
| length | width for horizontal, height for vertical scales |
| scaleFont | Font of the scale |
- Returns:
- height for horizontal, width for vertical scales
void QwtScaleWidget::draw |
( |
QPainter * |
p |
) |
const [protected] |
Rotate and paint a title according to its position into a given rectangle.
- Parameters:
-
| painter | Painter |
| align | Alignment |
| rect | Bounding rectangle |
int QwtScaleWidget::endBorderDist |
( |
|
) |
const |
void QwtScaleWidget::getBorderDistHint |
( |
int & |
start, |
|
|
int & |
end | |
|
) |
| | const |
Calculate a hint for the border distances.
This member function calculates the distance of the scale's endpoints from the widget borders which is required for the mark labels to fit into the widget. The maximum of this distance an the minimum border distance is returned.
- Warning:
-
The minimum border distance depends on the font.
- See also:
- setMinBorderDist(), getMinBorderDist(), setBorderDist()
void QwtScaleWidget::getMinBorderDist |
( |
int & |
start, |
|
|
int & |
end | |
|
) |
| | const |
void QwtScaleWidget::layoutScale |
( |
bool |
update = true |
) |
[protected] |
Recalculate the scale's geometry and layout based on.
int QwtScaleWidget::margin |
( |
|
) |
const |
QSize QwtScaleWidget::minimumSizeHint |
( |
|
) |
const [virtual] |
- Returns:
- a minimum size hint
void QwtScaleWidget::paintEvent |
( |
QPaintEvent * |
e |
) |
[protected, virtual] |
int QwtScaleWidget::penWidth |
( |
|
) |
const |
void QwtScaleWidget::resizeEvent |
( |
QResizeEvent * |
e |
) |
[protected, virtual] |
void QwtScaleWidget::scaleChange |
( |
|
) |
[protected] |
Notify a change of the scale.
This virtual function can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget.
void QwtScaleWidget::scaleDivChanged |
( |
|
) |
[signal] |
Signal emitted, whenever the scale divison changes.
scaleDraw of this scale
- See also:
- QwtScaleDraw::setScaleDraw()
scaleDraw of this scale
- See also:
- setScaleDraw(), QwtScaleDraw::setScaleDraw()
void QwtScaleWidget::setBorderDist |
( |
int |
dist1, |
|
|
int |
dist2 | |
|
) |
| | |
Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance.
- Parameters:
-
| dist1 | Left or top Distance |
| dist2 | Right or bottom distance |
- See also:
- borderDist()
void QwtScaleWidget::setLabelAlignment |
( |
Qt::Alignment |
alignment |
) |
|
void QwtScaleWidget::setLabelRotation |
( |
double |
rotation |
) |
|
void QwtScaleWidget::setMargin |
( |
int |
margin |
) |
|
Specify the margin to the colorBar/base line.
- Parameters:
-
- See also:
- margin()
void QwtScaleWidget::setMinBorderDist |
( |
int |
start, |
|
|
int |
end | |
|
) |
| | |
Set a minimum value for the distances of the scale's endpoints from the widget borders. This is useful to avoid that the scales are "jumping", when the tick labels or their positions change often.
- Parameters:
-
| start | Minimum for the start border |
| end | Minimum for the end border |
- See also:
- getMinBorderDist(), getBorderDistHint()
void QwtScaleWidget::setPenWidth |
( |
int |
width |
) |
|
Specify the width of the scale pen.
- Parameters:
-
- See also:
- penWidth()
Assign a scale division.
The scale division determines where to set the tick marks.
- Parameters:
-
| transformation | Transformation, needed to translate between scale and pixal values |
| scaleDiv | Scale Division |
- See also:
- For more information about scale divisions, see QwtScaleDiv.
void QwtScaleWidget::setSpacing |
( |
int |
spacing |
) |
|
Specify the distance between color bar, scale and title.
- Parameters:
-
- See also:
- spacing()
void QwtScaleWidget::setTitle |
( |
const QwtText & |
title |
) |
|
Give title new text contents
- Parameters:
-
- See also:
- title()
- Warning:
- The title flags are interpreted in direction of the label, AlignTop, AlignBottom can't be set as the title will always be aligned to the scale.
void QwtScaleWidget::setTitle |
( |
const QString & |
title |
) |
|
QSize QwtScaleWidget::sizeHint |
( |
|
) |
const [virtual] |
int QwtScaleWidget::spacing |
( |
|
) |
const |
- Returns:
- distance between scale and title
- See also:
- setMargin()
int QwtScaleWidget::startBorderDist |
( |
|
) |
const |
QwtText QwtScaleWidget::title |
( |
|
) |
const |
int QwtScaleWidget::titleHeightForWidth |
( |
int |
width |
) |
const |
Find the height of the title for a given width.
- Parameters:
-
- Returns:
- height Height
Generated on Wed Sep 2 18:37:27 2009 for Qwt User's Guide by
1.6.1