This Widget can be used to decorate composite widgets with a scale.
Definition at line 34 of file qwt_scale_widget.h.
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) |
|
Create a scale with the position QwtScaleWidget::Left.
Definition at line 64 of file qwt_scale_widget.cpp. |
|
Constructor.
Definition at line 88 of file qwt_scale_widget.cpp. |
|
Destructor.
Definition at line 96 of file qwt_scale_widget.cpp. |
|
Definition at line 218 of file qwt_scale_widget.cpp. References QwtScaleDraw::alignment(), and scaleDraw(). |
|
Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.
Definition at line 747 of file qwt_scale_widget.cpp. References titleHeightForWidth(). Referenced by minimumSizeHint(). |
|
draw the scale
Definition at line 428 of file qwt_scale_widget.cpp. References colorBarRect(), and drawColorBar(). Referenced by paintEvent(). |
|
Rotate and paint a title according to its position into a given rectangle.
Definition at line 622 of file qwt_scale_widget.cpp. References QwtText::draw(), QwtText::setRenderFlags(), and title(). |
|
Definition at line 376 of file qwt_scale_widget.cpp. Referenced by QwtPlot::canvasMap(). |
|
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 775 of file qwt_scale_widget.cpp. Referenced by layoutScale(), and minimumSizeHint(). |
|
Get the minimum value for the distances of the scale's endpoints from the widget borders.
Definition at line 806 of file qwt_scale_widget.cpp. |
|
Recalculate the scale's geometry and layout based on.
Definition at line 552 of file qwt_scale_widget.cpp. References colorBarWidth(), and getBorderDistHint(). Referenced by resizeEvent(), scaleChange(), setAlignment(), setBorderDist(), setColorBarEnabled(), setColorBarWidth(), setColorMap(), setLabelRotation(), setMargin(), setPenWidth(), setScaleDiv(), setScaleDraw(), setSpacing(), and setTitle(). |
|
Definition at line 385 of file qwt_scale_widget.cpp. |
|
Definition at line 698 of file qwt_scale_widget.cpp. References dimForLength(), and getBorderDistHint(). Referenced by QwtPlotLayout::minimumSizeHint(), sizeHint(), and QwtPlot::sizeHint(). |
|
paintEvent
Definition at line 410 of file qwt_scale_widget.cpp. References draw(). |
|
Definition at line 403 of file qwt_scale_widget.cpp. |
|
resizeEvent
Definition at line 542 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 682 of file qwt_scale_widget.cpp. References layoutScale(). |
|
Signal emitted, whenever the scale divison changes.
Referenced by setScaleDiv(). |
|
scaleDraw of this scale
Definition at line 349 of file qwt_scale_widget.cpp. |
|
scaleDraw of this scale
Definition at line 340 of file qwt_scale_widget.cpp. Referenced by alignment(), QwtPlot::axisScaleDraw(), QwtPlot::printScale(), and QwtPlot::sizeHint(). |
|
Change the alignment
Definition at line 187 of file qwt_scale_widget.cpp. References layoutScale(). |
|
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 234 of file qwt_scale_widget.cpp. References layoutScale(). |
|
Change the alignment for the labels.
Definition at line 299 of file qwt_scale_widget.cpp. |
|
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation().
Definition at line 311 of file qwt_scale_widget.cpp. References layoutScale(). Referenced by QwtPlot::setAxisLabelRotation(). |
|
Specify the margin to the colorBar/base line.
Definition at line 249 of file qwt_scale_widget.cpp. References layoutScale(). |
|
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 794 of file qwt_scale_widget.cpp. |
|
Specify the width of the scale pen.
Definition at line 279 of file qwt_scale_widget.cpp. References layoutScale(). |
|
Assign a scale division. The scale division determines where to set the tick marks.
Definition at line 840 of file qwt_scale_widget.cpp. References layoutScale(), QwtAbstractScaleDraw::map(), QwtAbstractScaleDraw::scaleDiv(), scaleDivChanged(), QwtAbstractScaleDraw::setScaleDiv(), QwtAbstractScaleDraw::setTransformation(), QwtScaleMap::transformation(), and QwtScaleTransformation::type(). |
|
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 322 of file qwt_scale_widget.cpp. References layoutScale(), and QwtScaleDraw::setAlignment(). Referenced by QwtPlot::setAxisScaleDraw(). |
|
Specify the distance between color bar, scale and title.
Definition at line 264 of file qwt_scale_widget.cpp. References layoutScale(). |
|
Give title new text contents.
Definition at line 168 of file qwt_scale_widget.cpp. References layoutScale(), QwtText::renderFlags(), QwtText::setRenderFlags(), and title(). |
|
Definition at line 690 of file qwt_scale_widget.cpp. References minimumSizeHint(). |
|
Definition at line 394 of file qwt_scale_widget.cpp. Referenced by QwtPlot::printScale(). |
|
Definition at line 367 of file qwt_scale_widget.cpp. Referenced by QwtPlot::canvasMap(). |
|
Definition at line 358 of file qwt_scale_widget.cpp. Referenced by QwtPlot::axisTitle(), drawTitle(), and setTitle(). |
|
Find the height of the title for a given width.
Definition at line 733 of file qwt_scale_widget.cpp. Referenced by dimForLength(). |