|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
A Widget which contains a scale. More...
#include <qwt_scale_widget.h>
Classes | |
| class | PrivateData |
Public Types | |
| enum | LayoutFlag { TitleInverted = 1 } |
| Layout flags of the title. More... | |
| enum | BuiltinActions { ActionNone = 0x00 , ActionWheelZoom = 0x01 , ActionClickPan = 0x02 , ActionAll = 0xFF } |
| Built-in actions . More... | |
Signals | |
| void | scaleDivChanged () |
| Signal emitted whenever the scale division changes . | |
| void | requestScaleRangeUpdate (double min, double max) |
| Request to change the axis scale division. | |
| void | selectionChanged (bool selected) |
| Signal emitted when the axis selection state changes. | |
Public Member Functions | |
| QwtScaleWidget (QWidget *parent=nullptr) | |
| Constructor. | |
| QwtScaleWidget (QwtScaleDraw::Alignment, QWidget *parent=nullptr) | |
| Constructor with alignment. | |
| virtual | ~QwtScaleWidget () |
| Destructor. | |
| void | setTitle (const QString &title) |
| Set the title. | |
| void | setTitle (const QwtText &title) |
| Set the title. | |
| QwtText | title () const |
| Get the title. | |
| void | setLayoutFlag (LayoutFlag, bool on) |
| Set a layout flag. | |
| bool | testLayoutFlag (LayoutFlag) const |
| Test a layout flag. | |
| void | setBorderDist (int dist1, int dist2) |
| Set the border distances. | |
| int | startBorderDist () const |
| Get the start border distance. | |
| int | endBorderDist () const |
| Get the end border distance. | |
| void | getBorderDistHint (int &start, int &end) const |
| Get the border distance hint. | |
| void | getMinBorderDist (int &start, int &end) const |
| Get the minimum border distances. | |
| void | setMinBorderDist (int start, int end) |
| Set the minimum border distances. | |
| int | startMinBorderDist () const |
| Get the minimum value for the distances of the scale's endpoints from the widget borders (left or top) | |
| int | endMinBorderDist () const |
| Get the minimum value for the distances of the scale's endpoints from the widget borders (right or bottom) | |
| void | setMargin (int) |
| Set the margin. | |
| int | margin () const |
| Get the margin. | |
| void | setSpacing (int) |
| Set the spacing. | |
| int | spacing () const |
| Get the distance between scale and title. | |
| void | setEdgeMargin (int offset) |
| Set the edge margin (offset between axis and plot canvas) | |
| int | edgeMargin () const |
| Get the edge margin. | |
| void | setScaleDiv (const QwtScaleDiv &) |
| Set the scale division. | |
| void | setTransformation (QwtTransform *) |
| Set the transformation. | |
| void | setScaleDraw (QwtScaleDraw *) |
| Set the scale draw. | |
| const QwtScaleDraw * | scaleDraw () const |
| Get the scale draw (const version) | |
| QwtScaleDraw * | scaleDraw () |
| Get the scale draw. | |
| void | setLabelAlignment (Qt::Alignment) |
| Set the label alignment. | |
| void | setLabelRotation (double rotation) |
| Set the label rotation. | |
| void | setColorBarEnabled (bool) |
| Enable/disable the color bar. | |
| bool | isColorBarEnabled () const |
| Check if color bar is enabled. | |
| void | setColorBarWidth (int) |
| Set the color bar width. | |
| int | colorBarWidth () const |
| Get the width of the color bar. | |
| void | setColorMap (const QwtInterval &, QwtColorMap *) |
| Set the color map. | |
| QwtInterval | colorBarInterval () const |
| Get the value interval for the color bar. | |
| const QwtColorMap * | colorMap () const |
| Get the color map. | |
| virtual QSize | sizeHint () const override |
| Get a size hint. | |
| virtual QSize | minimumSizeHint () const override |
| Get a minimum size hint. | |
| int | titleHeightForWidth (int width) const |
| Find the height of the title for a given width. | |
| int | dimForLength (int length, const QFont &scaleFont) const |
| Find the minimum dimension for a given length. | |
| void | drawColorBar (QPainter *, const QRectF &) const |
| Draw the color bar. | |
| void | drawTitle (QPainter *, QwtScaleDraw::Alignment, const QRectF &rect) const |
| Draw the title. | |
| void | setAlignment (QwtScaleDraw::Alignment) |
| Set the alignment. | |
| QwtScaleDraw::Alignment | alignment () const |
| Get the alignment. | |
| QRectF | colorBarRect (const QRectF &) const |
| Calculate the rectangle for the color bar. | |
| QRect | scaleRect () const |
| Get the rectangle for drawing the scale (excluding colorBar, margin, edgeMargin, borderDist) | |
| void | setTextColor (const QColor &c) |
| Set the text color (font color of the coordinate axis) | |
| QColor | textColor () const |
| Get the font color of the coordinate axis. | |
| void | setScaleColor (const QColor &c) |
| Set the scale color (color of the coordinate axis) | |
| QColor | scaleColor () const |
| Get the color of the coordinate axis. | |
| void | layoutScale (bool update_geometry=true) |
| Layout the scale. | |
| QwtAxisId | axisID () const |
| Get the axis ID for this scale widget. | |
| bool | isXAxis () const |
| Check if this is an X axis. | |
| bool | isYAxis () const |
| Check if this is a Y axis. | |
| void | setBuildinActions (BuiltinActionsFlags acts) |
| Enable/disable built-in actions. | |
| BuiltinActionsFlags | buildinActions () const |
| Get the built-in actions flags. | |
| bool | testBuildinActions (BuiltinActions ba) const |
| Test if a built-in action is active. | |
| void | setSelected (bool selected) |
| Set the selected state. | |
| bool | isSelected () const |
| Check if the current axis is selected. | |
| void | setSelectionColor (const QColor &color) |
| Set the selection color. | |
| QColor | selectionColor () const |
| Get the selection color. | |
| void | setZoomFactor (double factor) |
| Set the zoom factor (default 1.2) | |
| double | zoomFactor () const |
| Get the zoom factor. | |
| void | setSelectedPenWidthOffset (qreal offset=1) |
| Set the selected pen width offset. | |
| qreal | selectedPenWidthOffset () const |
| Get the current pen width offset for the axis when it is in selected state. | |
| bool | isOnScale (const QPoint &pos) const |
| Check if a point is on the scale area. | |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *) override |
| paintEvent | |
| virtual void | resizeEvent (QResizeEvent *) override |
| Event handler for resize events. | |
| virtual void | changeEvent (QEvent *) override |
| Change Event handler. | |
| void | draw (QPainter *) const |
| draw the scale | |
| void | scaleChange () |
| Notify a change of the scale. | |
A Widget which contains a scale.
|
explicit |
Constructor.
Create a scale with the position QwtScaleWidget::Left.
| QwtScaleDraw::Alignment QwtScaleWidget::alignment | ( | ) | const |
Get the alignment.
| QwtAxisId QwtScaleWidget::axisID | ( | ) | const |
Get the axis ID for this scale widget.
| QwtScaleWidget::BuiltinActionsFlags QwtScaleWidget::buildinActions | ( | ) | const |
Get the built-in actions flags.
|
overrideprotectedvirtual |
Change Event handler.
| event | Change event |
Invalidates internal caches if necessary
| QwtInterval QwtScaleWidget::colorBarInterval | ( | ) | const |
Get the value interval for the color bar.
| QRectF QwtScaleWidget::colorBarRect | ( | const QRectF & | rect | ) | const |
Calculate the rectangle for the color bar.
| int QwtScaleWidget::colorBarWidth | ( | ) | const |
Get the width of the color bar.
| const QwtColorMap * QwtScaleWidget::colorMap | ( | ) | const |
Get the color map.
| int QwtScaleWidget::dimForLength | ( | int | length, |
| const QFont & | scaleFont | ||
| ) | const |
Find the minimum dimension for a given length.
| void QwtScaleWidget::drawColorBar | ( | QPainter * | painter, |
| const QRectF & | rect | ||
| ) | const |
Draw the color bar.
Draw the color bar of the scale widget.
| void QwtScaleWidget::drawTitle | ( | QPainter * | painter, |
| QwtScaleDraw::Alignment | align, | ||
| const QRectF & | rect | ||
| ) | const |
Draw the title.
Rotate and paint a title according to its position into a given rectangle.
| int QwtScaleWidget::edgeMargin | ( | ) | const |
Get the edge margin.
| int QwtScaleWidget::endBorderDist | ( | ) | const |
Get the end border distance.
| int QwtScaleWidget::endMinBorderDist | ( | ) | const |
Get the minimum value for the distances of the scale's endpoints from the widget borders (right or bottom)
| void QwtScaleWidget::getBorderDistHint | ( | int & | start, |
| int & | end | ||
| ) | const |
Get the border distance hint.
Calculate a hint for the border distances.
| void QwtScaleWidget::getMinBorderDist | ( | int & | start, |
| int & | end | ||
| ) | const |
Get the minimum border distances.
Get the minimum value for the distances of the scale's endpoints from the widget borders.
| bool QwtScaleWidget::isColorBarEnabled | ( | ) | const |
Check if color bar is enabled.
| bool QwtScaleWidget::isOnScale | ( | const QPoint & | pos | ) | const |
Check if a point is on the scale area.
Check if a mouse position falls on the "pure scale area".
| bool QwtScaleWidget::isSelected | ( | ) | const |
Check if the current axis is selected.
| bool QwtScaleWidget::isXAxis | ( | ) | const |
Check if this is an X axis.
| bool QwtScaleWidget::isYAxis | ( | ) | const |
Check if this is a Y axis.
| void QwtScaleWidget::layoutScale | ( | bool | update_geometry = true | ) |
Layout the scale.
Recalculate the scale's geometry and layout based on the current geometry and fonts.
| int QwtScaleWidget::margin | ( | ) | const |
Get the margin.
|
overridevirtual |
Get a minimum size hint.
|
signal |
Request to change the axis scale division.
|
overrideprotectedvirtual |
Event handler for resize events.
| event | Resize event |
|
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.
| QColor QwtScaleWidget::scaleColor | ( | ) | const |
Get the color of the coordinate axis.
|
signal |
Signal emitted whenever the scale division changes .
| QwtScaleDraw * QwtScaleWidget::scaleDraw | ( | ) |
Get the scale draw.
| const QwtScaleDraw * QwtScaleWidget::scaleDraw | ( | ) | const |
Get the scale draw (const version)
| QRect QwtScaleWidget::scaleRect | ( | ) | const |
Get the rectangle for drawing the scale (excluding colorBar, margin, edgeMargin, borderDist)
| qreal QwtScaleWidget::selectedPenWidthOffset | ( | ) | const |
Get the current pen width offset for the axis when it is in selected state.
|
signal |
Signal emitted when the axis selection state changes.
| QColor QwtScaleWidget::selectionColor | ( | ) | const |
Get the selection color.
| void QwtScaleWidget::setAlignment | ( | QwtScaleDraw::Alignment | alignment | ) |
Set the alignment.
Change the alignment.
| void QwtScaleWidget::setBorderDist | ( | int | dist1, |
| int | dist2 | ||
| ) |
Set the border distances.
Specify distances of the scale's endpoints from the widget's borders.
| void QwtScaleWidget::setBuildinActions | ( | BuiltinActionsFlags | acts | ) |
Enable/disable built-in actions.
Set the built-in actions.
| void QwtScaleWidget::setColorBarEnabled | ( | bool | on | ) |
Enable/disable the color bar.
Enable/disable a color bar associated to the scale.
| void QwtScaleWidget::setColorBarWidth | ( | int | width | ) |
Set the color bar width.
Set the width of the color bar.
| void QwtScaleWidget::setColorMap | ( | const QwtInterval & | interval, |
| QwtColorMap * | colorMap | ||
| ) |
Set the color map.
Set the color map and value interval used for displaying the color bar.
| void QwtScaleWidget::setEdgeMargin | ( | int | offset | ) |
Set the edge margin (offset between axis and plot canvas)
Set the edge margin (offset between axis and plot canvas edge)
| void QwtScaleWidget::setLabelAlignment | ( | Qt::Alignment | alignment | ) |
Set the label alignment.
Change the alignment for the labels.
| void QwtScaleWidget::setLabelRotation | ( | double | rotation | ) |
Set the label rotation.
Change the rotation for the labels.
| void QwtScaleWidget::setLayoutFlag | ( | LayoutFlag | flag, |
| bool | on | ||
| ) |
Set a layout flag.
Toggle a layout flag.
| void QwtScaleWidget::setMargin | ( | int | margin | ) |
Set the margin.
Specify the margin to the colorBar/base line.
| void QwtScaleWidget::setMinBorderDist | ( | int | start, |
| int | end | ||
| ) |
Set the minimum border distances.
Set a minimum value for the distances of the scale's endpoints from the widget borders.
| void QwtScaleWidget::setScaleColor | ( | const QColor & | c | ) |
Set the scale color (color of the coordinate axis)
Set the color of the coordinate axis.
| void QwtScaleWidget::setScaleDiv | ( | const QwtScaleDiv & | scaleDiv | ) |
Set the scale division.
Assign a scale division.
| void QwtScaleWidget::setScaleDraw | ( | QwtScaleDraw * | scaleDraw | ) |
Set the scale draw.
Set a scale draw.
| void QwtScaleWidget::setSelected | ( | bool | selected | ) |
Set the selected state.
| void QwtScaleWidget::setSelectedPenWidthOffset | ( | qreal | offset = 1 | ) |
Set the selected pen width offset.
Set the pen width offset for the axis when it is in selected state.
| void QwtScaleWidget::setSelectionColor | ( | const QColor & | color | ) |
Set the selection color.
| void QwtScaleWidget::setSpacing | ( | int | spacing | ) |
Set the spacing.
Specify the distance between color bar, scale and title.
| void QwtScaleWidget::setTextColor | ( | const QColor & | c | ) |
Set the text color (font color of the coordinate axis)
Set the font color of the coordinate axis.
| void QwtScaleWidget::setTitle | ( | const QString & | title | ) |
Set the title.
Give title new text contents.
| void QwtScaleWidget::setTitle | ( | const QwtText & | title | ) |
Set the title.
Give title new text contents.
| void QwtScaleWidget::setTransformation | ( | QwtTransform * | transformation | ) |
Set the transformation.
| void QwtScaleWidget::setZoomFactor | ( | double | factor | ) |
Set the zoom factor (default 1.2)
|
overridevirtual |
Get a size hint.
| int QwtScaleWidget::spacing | ( | ) | const |
Get the distance between scale and title.
| int QwtScaleWidget::startBorderDist | ( | ) | const |
Get the start border distance.
| int QwtScaleWidget::startMinBorderDist | ( | ) | const |
Get the minimum value for the distances of the scale's endpoints from the widget borders (left or top)
| bool QwtScaleWidget::testBuildinActions | ( | QwtScaleWidget::BuiltinActions | ba | ) | const |
Test if a built-in action is active.
| bool QwtScaleWidget::testLayoutFlag | ( | LayoutFlag | flag | ) | const |
Test a layout flag.
| QColor QwtScaleWidget::textColor | ( | ) | const |
Get the font color of the coordinate axis.
| QwtText QwtScaleWidget::title | ( | ) | const |
Get the title.
| int QwtScaleWidget::titleHeightForWidth | ( | int | width | ) | const |
Find the height of the title for a given width.
| double QwtScaleWidget::zoomFactor | ( | ) | const |
Get the zoom factor.