#include <qwt_scale.h>
Public Types | |
| enum | Position { Left, Right, Top, Bottom } |
Public Member Functions | |
| QwtScale (Position, QWidget *parent, const char *name=0) | |
| virtual | ~QwtScale () |
| void | setTitle (const QString &title) |
| const QString & | title () const |
| void | setTitleColor (const QColor &c) |
| const QColor & | titleColor () const |
| void | setTitleFont (const QFont &f) |
| const QFont & | titleFont () const |
| void | setTitleAlignment (int flags) |
| int | titleAlignment () const |
| void | setBorderDist (int start, int end) |
| int | startBorderDist () const |
| int | endBorderDist () const |
| void | minBorderDist (int &start, int &end) const |
| void | setBaselineDist (int bd) |
| int | baseLineDist () const |
| void | setScaleDiv (const QwtScaleDiv &sd) |
| void | setScaleDraw (QwtScaleDraw *) |
| const QwtScaleDraw * | scaleDraw () const |
| void | setLabelFormat (char f, int prec, int fieldWidth) |
| void | labelFormat (char &f, int &prec, int &fieldWidth) const |
| void | setLabelAlignment (int align) |
| void | setLabelRotation (double rotation) |
| virtual QSize | sizeHint () const |
| virtual QSize | minimumSizeHint () const |
| virtual QSizePolicy | sizePolicy () const |
| int | dimForLength (int length, const QFontMetrics &titleFontMetrics, const QFontMetrics &scaleFontMetrics) const |
| void | setPosition (Position o) |
| Position | position () const |
Static Public Member Functions | |
| void | drawTitle (QPainter *, QwtScaleDraw::Orientation o, const QRect &, int align, const QString &) |
Protected Member Functions | |
| void | draw (QPainter *p) const |
| void | paintEvent (QPaintEvent *e) |
| void | resizeEvent (QResizeEvent *e) |
| void | scaleChange () |
| void | fontChange (const QFont &oldfont) |
| void | layoutScale (bool update=TRUE) |
Private Attributes | |
| QwtScaleDraw * | d_scaleDraw |
| int | d_borderDist [2] |
| int | d_scaleLength |
| int | d_baseDist |
| int | d_titleOffset |
| QString | d_title |
| int | d_titleDist |
| QFont | d_titleFont |
| QColor | d_titleColor |
| int | d_titleAlign |
This Widget can be used to decorate composite widgets with a scale.
Definition at line 31 of file qwt_scale.h.
|
|
Position of the scale
Definition at line 46 of file qwt_scale.h. Referenced by position(). |
|
||||||||||||||||
|
Constructor.
Definition at line 26 of file qwt_scale.cpp. References QwtScaleDraw::Bottom, Bottom, d_baseDist, d_borderDist, d_scaleDraw, d_titleAlign, d_titleDist, d_titleOffset, QwtScaleDraw::Left, Left, QwtScaleDraw::Orientation, QwtScaleDraw::Right, Right, QwtScaleDraw::setGeometry(), QwtScaleDraw::Top, and Top. |
|
|
Destructor.
Definition at line 60 of file qwt_scale.cpp. References d_scaleDraw. |
|
|
Definition at line 351 of file qwt_scale.cpp. References d_baseDist. Referenced by QwtPlotLayoutData::init(), QwtPlotLayout::minimumSizeHint(), and QwtPlot::print(). |
|
||||||||||||||||
|
Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.
Definition at line 618 of file qwt_scale.cpp. References d_baseDist, d_scaleDraw, d_title, d_titleAlign, d_titleDist, QwtScaleDraw::Left, QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), QwtScaleDraw::orientation(), and QwtScaleDraw::Right. Referenced by QwtPlotLayoutData::init(), and minimumSizeHint(). |
|
|
draw the scale
Definition at line 372 of file qwt_scale.cpp. References QwtScaleDraw::Bottom, d_scaleDraw, d_title, d_titleAlign, d_titleColor, d_titleFont, d_titleOffset, QwtScaleDraw::draw(), drawTitle(), QwtScaleDraw::Left, QwtScaleDraw::orientation(), QwtScaleDraw::Right, and QwtScaleDraw::Top. Referenced by paintEvent(). |
|
||||||||||||||||||||||||
|
Rotate and paint a title according to its position into a given rectangle.
Definition at line 480 of file qwt_scale.cpp. References QwtScaleDraw::Bottom, QwtPainter::drawText(), QwtScaleDraw::Left, QwtScaleDraw::Right, and QwtScaleDraw::Top. Referenced by draw(), and QwtPlot::printScale(). |
|
|
Definition at line 342 of file qwt_scale.cpp. References d_borderDist. Referenced by QwtPlot::canvasMap(), and QwtPlotLayoutData::init(). |
|
|
Notify a change of the font. This virtual function may be overloaded by derived widgets. The default implementation resizes the scale and repaints the widget.
Definition at line 665 of file qwt_scale.cpp. References layoutScale(). |
|
||||||||||||||||
|
Format character and precision have the same meaning as for the QString class.
Definition at line 279 of file qwt_scale.cpp. References d_scaleDraw, and QwtScaleDraw::labelFormat(). Referenced by QwtPlot::axisLabelFormat(). |
|
|
Recalculate the scale's geometry and layout based on.
Definition at line 417 of file qwt_scale.cpp. References QwtScaleDraw::Bottom, d_baseDist, d_borderDist, d_scaleDraw, d_titleDist, d_titleOffset, QwtScaleDraw::Left, QwtScaleDraw::maxHeight(), QwtScaleDraw::maxWidth(), minBorderDist(), QwtScaleDraw::orientation(), QwtScaleDraw::Right, QwtScaleDraw::setGeometry(), and QwtScaleDraw::Top. Referenced by fontChange(), resizeEvent(), scaleChange(), setBaselineDist(), setBorderDist(), setLabelAlignment(), setLabelFormat(), setLabelRotation(), setPosition(), setScaleDiv(), setScaleDraw(), setTitle(), setTitleAlignment(), and setTitleFont(). |
|
||||||||||||
|
Determine the minimum Border distances. This member function returns the minimum distance of the scale's endpoints from the widget borders which is required for the mark labels to fit into the widget.
Definition at line 651 of file qwt_scale.cpp. References d_scaleDraw, and QwtScaleDraw::minBorderDist(). Referenced by QwtPlotPrintFilter::apply(), layoutScale(), minimumSizeHint(), QwtPlotLayout::minimumSizeHint(), QwtPlot::print(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
|
Definition at line 565 of file qwt_scale.cpp. References d_borderDist, d_scaleDraw, d_title, d_titleFont, dimForLength(), QwtScaleDraw::Left, minBorderDist(), QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), QwtScaleDraw::orientation(), qwtMax, and QwtScaleDraw::Right. Referenced by QwtPlotLayout::minimumSizeHint(), sizeHint(), and QwtPlot::sizeHint(). |
|
|
paintEvent
Definition at line 359 of file qwt_scale.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
|
Definition at line 115 of file qwt_scale.cpp. References Bottom, QwtScaleDraw::Bottom, QwtScaleDraw::Left, Left, QwtScaleDraw::orientation(), QwtScaleDraw::Orientation, Position, Right, QwtScaleDraw::Right, scaleDraw(), Top, and QwtScaleDraw::Top. |
|
|
paintEvent
Definition at line 407 of file qwt_scale.cpp. References layoutScale(). |
|
|
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. Definition at line 528 of file qwt_scale.cpp. References layoutScale(). |
|
|
scaleDraw of this scale
Definition at line 288 of file qwt_scale.cpp. References d_scaleDraw. Referenced by QwtPlot::axisScaleDraw(), QwtPlot::canvasMap(), QwtPlotLayoutData::init(), QwtPlotLayout::minimumSizeHint(), position(), QwtPlot::printScale(), and QwtPlot::sizeHint(). |
|
|
Specify the border distance of the scale's base line.
Definition at line 159 of file qwt_scale.cpp. References d_baseDist, layoutScale(), and qwtMax. Referenced by QwtPlot::initAxes(). |
|
||||||||||||
|
Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance.
Definition at line 144 of file qwt_scale.cpp. References d_borderDist, and layoutScale(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
|
Change the alignment for the labels. See QwtScaleDraw::setLabelAlignment(). Definition at line 233 of file qwt_scale.cpp. References d_scaleDraw, layoutScale(), and QwtScaleDraw::setLabelAlignment(). Referenced by QwtPlot::setAxisLabelAlignment(). |
|
||||||||||||||||
|
Set the number format for the major scale labels. Format character and precision have the same meaning as for the QString class.
Definition at line 220 of file qwt_scale.cpp. References d_scaleDraw, layoutScale(), and QwtScaleDraw::setLabelFormat(). Referenced by QwtPlot::setAxisLabelFormat(). |
|
|
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation().
Definition at line 244 of file qwt_scale.cpp. References d_scaleDraw, layoutScale(), and QwtScaleDraw::setLabelRotation(). Referenced by QwtPlot::setAxisLabelRotation(). |
|
|
Assign a position.
Definition at line 84 of file qwt_scale.cpp. References QwtScaleDraw::Bottom, Bottom, d_scaleDraw, layoutScale(), QwtScaleDraw::Left, Left, QwtScaleDraw::Orientation, QwtScaleDraw::Right, Right, QwtScaleDraw::setGeometry(), QwtScaleDraw::Top, and Top. |
|
|
Assign a scale division. The scale division determines where to set the tick marks.
Definition at line 679 of file qwt_scale.cpp. References d_scaleDraw, layoutScale(), QwtScaleDraw::scaleDiv(), and QwtScaleDraw::setScale(). Referenced by QwtPlot::initAxes(), and QwtPlot::updateAxes(). |
|
|
Set a scale draw sd has to be created with new and will be deleted in QwtScale::~QwtScale or the next call of QwtScale::setScaleDraw.
Definition at line 255 of file qwt_scale.cpp. References d_scaleDraw, and layoutScale(). Referenced by QwtPlot::setAxisScaleDraw(). |
|
|
Assign a title.
Definition at line 70 of file qwt_scale.cpp. References d_title, and layoutScale(). Referenced by QwtPlot::setAxisTitle(). |
|
|
Change the title alignment.
Definition at line 202 of file qwt_scale.cpp. References d_titleAlign, and layoutScale(). Referenced by QwtPlot::setAxisTitleAlignment(). |
|
|
Change the title color.
Definition at line 188 of file qwt_scale.cpp. References d_titleColor. Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset(). |
|
|
Change the title font.
Definition at line 174 of file qwt_scale.cpp. References d_titleFont, and layoutScale(). Referenced by QwtPlotPrintFilter::apply(), QwtPlot::initAxes(), QwtPlotPrintFilter::reset(), and QwtPlot::setAxisTitleFont(). |
|
|
Definition at line 557 of file qwt_scale.cpp. References minimumSizeHint(). |
|
|
Definition at line 537 of file qwt_scale.cpp. References d_scaleDraw, QwtScaleDraw::Left, QwtScaleDraw::orientation(), and QwtScaleDraw::Right. |
|
|
Definition at line 333 of file qwt_scale.cpp. References d_borderDist. Referenced by QwtPlot::canvasMap(), QwtPlotLayoutData::init(), and QwtPlot::print(). |
|
|
Definition at line 324 of file qwt_scale.cpp. References d_title. Referenced by QwtPlot::axisTitle(), QwtPlotLayoutData::init(), and QwtPlot::printScale(). |
|
|
Definition at line 297 of file qwt_scale.cpp. References d_titleAlign. Referenced by QwtPlot::axisTitleAlignment(), QwtPlotLayoutData::init(), and QwtPlot::printScale(). |
|
|
Definition at line 315 of file qwt_scale.cpp. References d_titleColor. Referenced by QwtPlotPrintFilter::apply(), and QwtPlot::printScale(). |
|
|
Definition at line 306 of file qwt_scale.cpp. References d_titleFont. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::axisTitleFont(), QwtPlotLayoutData::init(), and QwtPlot::printScale(). |
|
|
Definition at line 108 of file qwt_scale.h. Referenced by baseLineDist(), dimForLength(), layoutScale(), QwtScale(), and setBaselineDist(). |
|
|
Definition at line 106 of file qwt_scale.h. Referenced by endBorderDist(), layoutScale(), minimumSizeHint(), QwtScale(), setBorderDist(), and startBorderDist(). |
|
|
Definition at line 104 of file qwt_scale.h. Referenced by dimForLength(), draw(), labelFormat(), layoutScale(), minBorderDist(), minimumSizeHint(), QwtScale(), scaleDraw(), setLabelAlignment(), setLabelFormat(), setLabelRotation(), setPosition(), setScaleDiv(), setScaleDraw(), sizePolicy(), and ~QwtScale(). |
|
|
Definition at line 107 of file qwt_scale.h. |
|
|
Definition at line 111 of file qwt_scale.h. Referenced by dimForLength(), draw(), minimumSizeHint(), setTitle(), and title(). |
|
|
Definition at line 115 of file qwt_scale.h. Referenced by dimForLength(), draw(), QwtScale(), setTitleAlignment(), and titleAlignment(). |
|
|
Definition at line 114 of file qwt_scale.h. Referenced by draw(), setTitleColor(), and titleColor(). |
|
|
Definition at line 112 of file qwt_scale.h. Referenced by dimForLength(), layoutScale(), and QwtScale(). |
|
|
Definition at line 113 of file qwt_scale.h. Referenced by draw(), minimumSizeHint(), setTitleFont(), and titleFont(). |
|
|
Definition at line 110 of file qwt_scale.h. Referenced by draw(), layoutScale(), and QwtScale(). |
1.3.2