- bookworm 6.1.4-2
- testing 6.1.4-2
- unstable 6.1.4-2
- experimental 6.2.0-1
QwtScaleWidget(3) | Qwt User's Guide | QwtScaleWidget(3) |
NAME¶
QwtScaleWidget - A Widget which contains a scale.
SYNOPSIS¶
#include <qwt_scale_widget.h>
Inherits QWidget.
Public Types¶
enum LayoutFlag { TitleInverted = 1 }
Layout flags of the title. typedef QFlags< LayoutFlag >
LayoutFlags
Signals¶
void scaleDivChanged ()
Signal emitted, whenever the scale division changes.
Public Member Functions¶
QwtScaleWidget (QWidget *parent=NULL)
Create a scale with the position QwtScaleWidget::Left. QwtScaleWidget
(QwtScaleDraw::Alignment, QWidget *parent=NULL)
Constructor. virtual ~QwtScaleWidget ()
Destructor. void setTitle (const QString &title)
void setTitle (const QwtText &title)
QwtText title () const
void setLayoutFlag (LayoutFlag, bool on)
bool testLayoutFlag (LayoutFlag) const
void setBorderDist (int dist1, int dist2)
int startBorderDist () const
int endBorderDist () const
void getBorderDistHint (int &start, int &end) const
Calculate a hint for the border distances. void getMinBorderDist (int
&start, int &end) const
void setMinBorderDist (int start, int end)
void setMargin (int)
Specify the margin to the colorBar/base line. int margin () const
void setSpacing (int)
Specify the distance between color bar, scale and title. int spacing ()
const
void setScaleDiv (const QwtScaleDiv &)
Assign a scale division. void setTransformation (QwtTransform *)
void setScaleDraw (QwtScaleDraw *)
const QwtScaleDraw * scaleDraw () const
QwtScaleDraw * scaleDraw ()
void setLabelAlignment (Qt::Alignment)
Change the alignment for the labels. void setLabelRotation (double
rotation)
Change the rotation for the labels. See
QwtScaleDraw::setLabelRotation(). void setColorBarEnabled
(bool)
bool isColorBarEnabled () const
void setColorBarWidth (int)
int colorBarWidth () const
void setColorMap (const QwtInterval &, QwtColorMap *)
QwtInterval colorBarInterval () const
const QwtColorMap * colorMap () const
virtual QSize sizeHint () const override
virtual QSize minimumSizeHint () const override
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. dim is the height, length the
width seen in direction of the title. void drawColorBar (QPainter *,
const QRectF &) const
void drawTitle (QPainter *, QwtScaleDraw::Alignment, const
QRectF &rect) const
void setAlignment (QwtScaleDraw::Alignment)
QwtScaleDraw::Alignment alignment () const
QRectF colorBarRect (const QRectF &) const
Protected Member Functions¶
virtual void paintEvent (QPaintEvent *) override
paintEvent virtual void resizeEvent (QResizeEvent *) override
virtual void changeEvent (QEvent *) override
void draw (QPainter *) const
draw the scale void scaleChange ()
Notify a change of the scale. void layoutScale (bool
update_geometry=true)
Detailed Description¶
A Widget which contains a scale.
This Widget can be used to decorate composite widgets with a scale.
Definition at line 34 of file qwt_scale_widget.h.
Member Typedef Documentation¶
typedef QFlags<LayoutFlag > QwtScaleWidget::LayoutFlags¶
An ORed combination of LayoutFlag values.
Definition at line 49 of file qwt_scale_widget.h.
Member Enumeration Documentation¶
enum QwtScaleWidget::LayoutFlag¶
Layout flags of the title.
Enumerator
- TitleInverted
- The title of vertical scales is painted from top to bottom. Otherwise it is painted from bottom to top.
Definition at line 40 of file qwt_scale_widget.h.
Constructor & Destructor Documentation¶
QwtScaleWidget::QwtScaleWidget (QWidget * parent = NULL) [explicit]¶
Create a scale with the position QwtScaleWidget::Left.
Parameters
Definition at line 68 of file qwt_scale_widget.cpp.
QwtScaleWidget::QwtScaleWidget (QwtScaleDraw::Alignment align, QWidget * parent = NULL) [explicit]¶
Constructor.
Parameters
parent Parent widget
Definition at line 79 of file qwt_scale_widget.cpp.
Member Function Documentation¶
QwtScaleDraw::Alignment QwtScaleWidget::alignment () const¶
Returns
See also
Definition at line 234 of file qwt_scale_widget.cpp.
void QwtScaleWidget::changeEvent (QEvent * event) [override], [protected], [virtual]¶
Change Event handler
Parameters
Invalidates internal caches if necessary
Definition at line 519 of file qwt_scale_widget.cpp.
QwtInterval QwtScaleWidget::colorBarInterval () const¶
Returns
See also
Definition at line 941 of file qwt_scale_widget.cpp.
QRectF QwtScaleWidget::colorBarRect (const QRectF & rect) const¶
Calculate the the rectangle for the color bar
Parameters
Returns
Definition at line 462 of file qwt_scale_widget.cpp.
int QwtScaleWidget::colorBarWidth () const¶
Returns
See also
Definition at line 932 of file qwt_scale_widget.cpp.
const QwtColorMap * QwtScaleWidget::colorMap () const¶
Returns
See also
Definition at line 974 of file qwt_scale_widget.cpp.
int QwtScaleWidget::dimForLength (int length, const QFont & scaleFont) const¶
Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.
Parameters
scaleFont Font of the scale
Returns
Definition at line 781 of file qwt_scale_widget.cpp.
void QwtScaleWidget::drawColorBar (QPainter * painter, const QRectF & rect) const¶
Draw the color bar of the scale widget
Parameters
rect Bounding rectangle for the color bar
See also
Definition at line 624 of file qwt_scale_widget.cpp.
void QwtScaleWidget::drawTitle (QPainter * painter, QwtScaleDraw::Alignment align, const QRectF & rect) const¶
Rotate and paint a title according to its position into a given rectangle.
Parameters
align Alignment
rect Bounding rectangle
Definition at line 644 of file qwt_scale_widget.cpp.
int QwtScaleWidget::endBorderDist () const¶
Returns
See also
Definition at line 389 of file qwt_scale_widget.cpp.
void QwtScaleWidget::getBorderDistHint (int & start, int & end) const¶
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.
Parameters
end Return parameter for the border width at the end of the scale
Warning
- •
- The minimum border distance depends on the font.
See also
Definition at line 814 of file qwt_scale_widget.cpp.
void QwtScaleWidget::getMinBorderDist (int & start, int & end) const¶
Get the minimum value for the distances of the scale's endpoints from the widget borders.
Parameters
end Return parameter for the border width at the end of the scale
See also
Definition at line 852 of file qwt_scale_widget.cpp.
bool QwtScaleWidget::isColorBarEnabled () const¶
Returns
See also
Definition at line 907 of file qwt_scale_widget.cpp.
void QwtScaleWidget::layoutScale (bool update_geometry = true) [protected]¶
Recalculate the scale's geometry and layout based on the current geometry and fonts.
Parameters
Definition at line 547 of file qwt_scale_widget.cpp.
int QwtScaleWidget::margin () const¶
Returns
See also
Definition at line 398 of file qwt_scale_widget.cpp.
QSize QwtScaleWidget::minimumSizeHint () const [override], [virtual]¶
Returns
Definition at line 732 of file qwt_scale_widget.cpp.
void QwtScaleWidget::resizeEvent (QResizeEvent * event) [override], [protected], [virtual]¶
Event handler for resize events
Parameters
Definition at line 533 of file qwt_scale_widget.cpp.
void QwtScaleWidget::scaleChange () [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.
Definition at line 716 of file qwt_scale_widget.cpp.
QwtScaleDraw * QwtScaleWidget::scaleDraw ()¶
Returns
See also
Definition at line 362 of file qwt_scale_widget.cpp.
const QwtScaleDraw * QwtScaleWidget::scaleDraw () const¶
Returns
See also
Definition at line 353 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setAlignment (QwtScaleDraw::Alignment alignment)¶
Change the alignment
Parameters
See also
Definition at line 209 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setBorderDist (int dist1, int dist2)¶
Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance.
Parameters
dist2 Right or bottom distance
See also
Definition at line 250 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setColorBarEnabled (bool on)¶
En/disable a color bar associated to the scale
See also
Definition at line 894 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setColorBarWidth (int width)¶
Set the width of the color bar
Parameters
See also
Definition at line 918 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setColorMap (const QwtInterval & interval, QwtColorMap * colorMap)¶
Set the color map and value interval, that are used for displaying the color bar.
Parameters
colorMap Color map
See also
Definition at line 955 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setLabelAlignment (Qt::Alignment alignment)¶
Change the alignment for the labels.
See also
Definition at line 295 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setLabelRotation (double rotation)¶
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation().
Parameters
See also
Definition at line 308 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setLayoutFlag (LayoutFlag flag, bool on)¶
Toggle an layout flag
Parameters
on true/false
See also
Definition at line 141 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setMargin (int margin)¶
Specify the margin to the colorBar/base line.
Parameters
See also
Definition at line 265 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setMinBorderDist (int start, int end)¶
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.
Parameters
end Minimum for the end border
See also
Definition at line 835 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setScaleDiv (const QwtScaleDiv & scaleDiv)¶
Assign a scale division. The scale division determines where to set the tick marks.
Parameters
See also
Definition at line 866 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setScaleDraw (QwtScaleDraw * scaleDraw)¶
Set a scale draw
scaleDraw has to be created with new and will be deleted in ~QwtScaleWidget() or the next call of setScaleDraw(). scaleDraw will be initialized with the attributes of the previous scaleDraw object.
Parameters
See also
Definition at line 325 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setSpacing (int spacing)¶
Specify the distance between color bar, scale and title.
Parameters
See also
Definition at line 280 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setTitle (const QString & title)¶
Give title new text contents
Parameters
See also
Definition at line 172 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setTitle (const QwtText & title)¶
Give title new text contents
Parameters
See also
Warning
Definition at line 190 of file qwt_scale_widget.cpp.
void QwtScaleWidget::setTransformation (QwtTransform * transformation)¶
Set the transformation
Parameters
See also
Definition at line 884 of file qwt_scale_widget.cpp.
QSize QwtScaleWidget::sizeHint () const [override], [virtual]¶
Returns
Definition at line 724 of file qwt_scale_widget.cpp.
int QwtScaleWidget::spacing () const¶
Returns
See also
Definition at line 407 of file qwt_scale_widget.cpp.
int QwtScaleWidget::startBorderDist () const¶
Returns
See also
Definition at line 380 of file qwt_scale_widget.cpp.
bool QwtScaleWidget::testLayoutFlag (LayoutFlag flag) const¶
Test a layout flag
Parameters
Returns
See also
Definition at line 161 of file qwt_scale_widget.cpp.
QwtText QwtScaleWidget::title () const¶
Returns
See also
Definition at line 371 of file qwt_scale_widget.cpp.
int QwtScaleWidget::titleHeightForWidth (int width) const¶
Find the height of the title for a given width.
Parameters
Returns
Definition at line 767 of file qwt_scale_widget.cpp.
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |