This Widget can be used to decorate composite widgets with a scale.
Definition at line 33 of file qwt_scale_widget.h.
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 | setBaselineDist (int bd) |
int | baseLineDist () const |
void | setTitleDist (int td) |
int | titleDist () const |
void | setScaleDiv (const QwtScaleTransformation &, const QwtScaleDiv &sd) |
void | setScaleDraw (QwtScaleDraw *) |
const QwtScaleDraw * | scaleDraw () const |
QwtScaleDraw * | scaleDraw () |
void | setLabelAlignment (int) |
void | setLabelRotation (double rotation) |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
int | titleHeightForWidth (int width) const |
int | dimForLength (int length, const QFont &scaleFont) const |
void | drawTitle (QPainter *painter, QwtScaleDraw::Alignment, const QRect &rect) const |
void | setAlignment (QwtScaleDraw::Alignment) |
QwtScaleDraw::Alignment | alignment () const |
Protected Member Functions | |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual void | fontChange (const QFont &oldfont) |
void | draw (QPainter *p) const |
void | scaleChange () |
void | layoutScale (bool update=true) |
|
Create a scale with the position QwtScaleWidget::Left.
Definition at line 52 of file qwt_scale_widget.cpp. |
|
Constructor.
Definition at line 63 of file qwt_scale_widget.cpp. |
|
Destructor.
Definition at line 71 of file qwt_scale_widget.cpp. |
|
Definition at line 188 of file qwt_scale_widget.cpp. References QwtScaleDraw::alignment(), and scaleDraw(). |
|
Definition at line 338 of file qwt_scale_widget.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.
Definition at line 607 of file qwt_scale_widget.cpp. References titleHeightForWidth(). Referenced by minimumSizeHint(). |
|
draw the scale
Definition at line 373 of file qwt_scale_widget.cpp. References drawTitle(). Referenced by paintEvent(). |
|
Rotate and paint a title according to its position into a given rectangle.
Definition at line 482 of file qwt_scale_widget.cpp. References QwtText::draw(), QwtText::setFlags(), and title(). Referenced by draw(), and QwtPlot::printScale(). |
|
Definition at line 329 of file qwt_scale_widget.cpp. Referenced by QwtPlot::canvasMap(), and QwtPlot::print(). |
|
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 679 of file qwt_scale_widget.cpp. References layoutScale(). |
|
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.
Definition at line 632 of file qwt_scale_widget.cpp. Referenced by QwtPlotPrintFilter::apply(), layoutScale(), minimumSizeHint(), QwtPlotLayout::minimumSizeHint(), QwtPlot::print(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
Get the minimum value for the distances of the scale's endpoints from the widget borders.
Definition at line 663 of file qwt_scale_widget.cpp. |
|
Recalculate the scale's geometry and layout based on.
Definition at line 429 of file qwt_scale_widget.cpp. References getBorderDistHint(). Referenced by fontChange(), resizeEvent(), scaleChange(), setAlignment(), setBaselineDist(), setBorderDist(), setLabelRotation(), setScaleDiv(), setScaleDraw(), setTitle(), and setTitleDist(). |
|
Definition at line 559 of file qwt_scale_widget.cpp. References dimForLength(), getBorderDistHint(), and qwtMax. Referenced by QwtPlotLayout::minimumSizeHint(), sizeHint(), and QwtPlot::sizeHint(). |
|
paintEvent
Definition at line 355 of file qwt_scale_widget.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
resizeEvent
Definition at line 419 of file qwt_scale_widget.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 543 of file qwt_scale_widget.cpp. References layoutScale(). |
|
scaleDraw of this scale
Definition at line 302 of file qwt_scale_widget.cpp. |
|
scaleDraw of this scale
Definition at line 293 of file qwt_scale_widget.cpp. Referenced by alignment(), QwtPlot::axisScaleDraw(), QwtPlotLayout::minimumSizeHint(), QwtPlot::printScale(), and QwtPlot::sizeHint(). |
|
Change the alignment
Definition at line 157 of file qwt_scale_widget.cpp. References layoutScale(). |
|
Specify the border distance of the scale's base line.
Definition at line 219 of file qwt_scale_widget.cpp. References layoutScale(), and qwtMax. 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.
Definition at line 204 of file qwt_scale_widget.cpp. References layoutScale(). Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::updateAxes(). |
|
Change the alignment for the labels.
Definition at line 250 of file qwt_scale_widget.cpp. |
|
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation().
Definition at line 264 of file qwt_scale_widget.cpp. References layoutScale(). Referenced by QwtPlot::setAxisLabelRotation(). |
|
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.
Definition at line 651 of file qwt_scale_widget.cpp. |
|
Assign a scale division. The scale division determines where to set the tick marks.
Definition at line 697 of file qwt_scale_widget.cpp. References layoutScale(). Referenced by QwtPlot::updateAxes(). |
|
Set a scale draw sd has to be created with new and will be deleted in QwtScaleWidget::~QwtScale or the next call of QwtScaleWidget::setScaleDraw.
Definition at line 275 of file qwt_scale_widget.cpp. References layoutScale(). Referenced by QwtPlot::setAxisScaleDraw(). |
|
Give title new text contents.
Definition at line 138 of file qwt_scale_widget.cpp. References QwtText::flags(), layoutScale(), and QwtText::setFlags(). |
|
Specify the distance between scale and title.
Definition at line 234 of file qwt_scale_widget.cpp. References layoutScale(), and qwtMax. |
|
Definition at line 551 of file qwt_scale_widget.cpp. References minimumSizeHint(). |
|
Definition at line 320 of file qwt_scale_widget.cpp. Referenced by QwtPlot::canvasMap(), and QwtPlot::print(). |
|
Definition at line 311 of file qwt_scale_widget.cpp. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::axisTitle(), and drawTitle(). |
|
Definition at line 347 of file qwt_scale_widget.cpp. |
|
Find the height of the title for a given width.
Definition at line 593 of file qwt_scale_widget.cpp. Referenced by dimForLength(). |