This Widget can be used to decorate composite widgets with a scale.
Definition at line 34 of file qwt_scale.h.
Public Types | |
enum | Position { Left, Right, Top, Bottom } |
Public Member Functions | |
QwtScale (QWidget *parent=0, const char *name=0) | |
QwtScale (Position, QWidget *parent=0, 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 | setTitleDist (int td) |
int | titleDist () 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 | titleHeightForWidth (int width) const |
int | dimForLength (int length, const QFontMetrics &scaleFontMetrics) const |
void | drawTitle (QPainter *painter, QwtScaleDraw::Orientation o, const QRect &rect) const |
void | setPosition (Position o) |
Position | position () const |
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) |
|
Position of the scale
Referenced by position(). |
|
Create a scale with the position QwtScale::Left.
|
|
Constructor.
|
|
Destructor. Definition at line 48 of file qwt_scale.cpp. |
|
Referenced by 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.
References QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), QwtScaleDraw::orientation(), QwtText::text(), and titleHeightForWidth(). Referenced by minimumSizeHint(). |
|
draw the scale Definition at line 426 of file qwt_scale.cpp. References QwtScaleDraw::draw(), drawTitle(), and QwtScaleDraw::orientation(). Referenced by paintEvent(). |
|
Rotate and paint a title according to its position into a given rectangle.
References QwtText::alignment(), QwtText::draw(), and QwtText::setAlignment(). Referenced by draw(), and QwtPlot::printScale(). |
|
Referenced by QwtPlot::canvasMap(). |
|
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.
References layoutScale(). |
|
Format character and precision have the same meaning as for the QString class.
References QwtScaleDraw::labelFormat(). Referenced by QwtPlot::axisLabelFormat(). |
|
Recalculate the scale's geometry and layout based on. Definition at line 468 of file qwt_scale.cpp. References QwtScaleDraw::maxHeight(), QwtScaleDraw::maxWidth(), minBorderDist(), QwtScaleDraw::orientation(), and QwtScaleDraw::setGeometry(). Referenced by fontChange(), resizeEvent(), scaleChange(), setBaselineDist(), setBorderDist(), setLabelAlignment(), setLabelFormat(), setLabelRotation(), setPosition(), setScaleDiv(), setScaleDraw(), setTitle(), setTitleAlignment(), setTitleDist(), 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.
References QwtScaleDraw::minBorderDist(). Referenced by QwtPlotPrintFilter::apply(), layoutScale(), minimumSizeHint(), QwtPlotLayout::minimumSizeHint(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
References dimForLength(), minBorderDist(), QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), and QwtScaleDraw::orientation(). Referenced by QwtPlotLayout::minimumSizeHint(), sizeHint(), and QwtPlot::sizeHint(). |
|
paintEvent Definition at line 413 of file qwt_scale.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
References QwtScaleDraw::orientation(), Position, and scaleDraw(). |
|
resizeEvent Definition at line 458 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 591 of file qwt_scale.cpp. References layoutScale(). |
|
scaleDraw of this scale
Referenced by QwtPlot::axisScaleDraw(), QwtPlotLayout::minimumSizeHint(), position(), QwtPlot::printScale(), and QwtPlot::sizeHint(). |
|
Specify the border distance of the scale's base line.
References layoutScale(). Referenced by QwtPlot::print(). |
|
Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance.
References layoutScale(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
Change the alignment for the labels. See QwtScaleDraw::setLabelAlignment(). Definition at line 278 of file qwt_scale.cpp.References 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.
References layoutScale(), and QwtScaleDraw::setLabelFormat(). Referenced by QwtPlot::setAxisLabelFormat(). |
|
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation(). Definition at line 289 of file qwt_scale.cpp. References layoutScale(), and QwtScaleDraw::setLabelRotation(). Referenced by QwtPlot::setAxisLabelRotation(). |
|
Assign a position.
References layoutScale(), and QwtScaleDraw::setGeometry(). |
|
Assign a scale division. The scale division determines where to set the tick marks.
References layoutScale(), QwtScaleDraw::scaleDiv(), and QwtScaleDraw::setScale(). Referenced by 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 300 of file qwt_scale.cpp. References layoutScale(). Referenced by QwtPlot::setAxisScaleDraw(). |
|
Give title new text contents.
References QwtText::alignment(), QwtText::color(), QwtText::font(), layoutScale(), QwtText::makeText(), and title(). Referenced by QwtPlot::setAxisTitle(). |
|
Change the title alignment.
References layoutScale(), and QwtText::setAlignment(). Referenced by QwtPlot::setAxisTitleAlignment(). |
|
Change the title color.
References QwtText::setColor(). Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset(). |
|
Specify the distance between scale and title.
References layoutScale(). |
|
Change the title font.
References QwtText::font(), layoutScale(), and QwtText::setFont(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setAxisTitleFont(). |
|
References minimumSizeHint(). |
|
References QwtScaleDraw::orientation(). |
|
Referenced by QwtPlot::canvasMap(), and QwtPlot::print(). |
|
References QwtText::text(). Referenced by QwtPlot::axisTitle(), and setTitle(). |
|
References QwtText::alignment(). Referenced by QwtPlot::axisTitleAlignment(). |
|
References QwtText::color(). Referenced by QwtPlotPrintFilter::apply(). |
|
|
|
References QwtText::font(). Referenced by QwtPlotPrintFilter::apply(), and QwtPlot::axisTitleFont(). |
|
Find the height of the title for a given width.
References QwtText::heightForWidth(). Referenced by dimForLength(). |