QwtScaleWidget(3)

NAME

okay bestie, welcome to QwtScaleWidget(3) from the Library Functions Manual β€” this is part 1, and the name is literally A Widget which contains a scale. πŸ’…


SYNOPSIS

#include <qwt_scale_widget.h>

It Inherits QWidget. β€” yes, fr fr.

Public Types

enum LayoutFlag { TitleInverted = 1 }
typedef QFlags< LayoutFlag > LayoutFlags

That LayoutFlag enum is all about layout flags of the title. The typedef is an ORed combo situation, but more on that below.

Signals

void scaleDivChanged ()

Signal emitted, whenever the scale division changes. πŸ‘‘

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 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
void getMinBorderDist (int &start, int &end) const
void setMinBorderDist (int start, int end)
void setMargin (int)
int margin () const
void setSpacing (int)
int spacing () const
void setScaleDiv (const QwtScaleDiv &)
void setTransformation (QwtTransform *)
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 QwtInterval &, QwtColorMap *)
QwtInterval colorBarInterval () const
const QwtColorMap * colorMap () const
virtual QSize sizeHint () const override
virtual QSize minimumSizeHint () const override
int titleHeightForWidth (int width) const
int dimForLength (int length, const QFont &scaleFont) const
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
virtual void resizeEvent (QResizeEvent *) override
virtual void changeEvent (QEvent *) override
void draw (QPainter *) const
void scaleChange ()
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:
      • parent β€” parent widget
    • Definition at line 68 of file qwt_scale_widget.cpp.
  • QwtScaleWidget::QwtScaleWidget (QwtScaleDraw::Alignment align, QWidget * parent = NULL) [explicit] β€” constructor.
    • Parameters:
      • align β€” alignment.
      • parent β€” parent widget
    • Definition at line 79 of file qwt_scale_widget.cpp.
  • QwtScaleWidget::~QwtScaleWidget () [virtual] β€” destructor.
    • Definition at line 86 of file qwt_scale_widget.cpp.

MEMBER FUNCTION DOCUMENTATION

  • QwtScaleDraw::Alignment QwtScaleWidget::alignment () const β€” returns the position.
    • Returns: position
    • See also: setPosition()
    • Definition at line 235 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::changeEvent (QEvent * event) [override], [protected], [virtual] β€” change Event handler.
    • Parameters:
      • event β€” change event
    • Invalidates internal caches if necessary.
    • Definition at line 520 of file qwt_scale_widget.cpp.
  • QwtInterval QwtScaleWidget::colorBarInterval () const β€” returns the value interval for the color bar.
    • Returns: value interval for the color bar
    • See also: setColorMap(), colorMap()
    • Definition at line 942 of file qwt_scale_widget.cpp.
  • QRectF QwtScaleWidget::colorBarRect (const QRectF & rect) const β€” calculate the the rectangle for the color bar.
    • Parameters:
      • rect β€” bounding rectangle for all components of the scale
    • Returns: rectangle for the color bar
    • Definition at line 463 of file qwt_scale_widget.cpp.
  • int QwtScaleWidget::colorBarWidth () const β€” returns the width of the color bar.
    • Returns: width of the color bar
    • See also: setColorBarEnabled(), setColorBarEnabled()
    • Definition at line 933 of file qwt_scale_widget.cpp.
  • const QwtColorMap * QwtScaleWidget::colorMap () const β€” returns the color map.
    • Returns: color map
    • See also: setColorMap(), colorBarInterval()
    • Definition at line 975 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:
      • length β€” width for horizontal, height for vertical scales
      • scaleFont β€” font of the scale
    • Returns: height for horizontal, width for vertical scales
    • Definition at line 782 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::draw (QPainter * painter) const [protected] β€” draw the scale.
    • Definition at line 431 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::drawColorBar (QPainter * painter, const QRectF & rect) const β€” draw the color bar of the scale widget.
    • Parameters:
      • painter β€” painter
      • rect β€” bounding rectangle for the color bar
    • See also: setColorBarEnabled()
    • Definition at line 625 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:
      • painter β€” painter
      • align β€” alignment
      • rect β€” bounding rectangle
    • Definition at line 645 of file qwt_scale_widget.cpp.
  • int QwtScaleWidget::endBorderDist () const β€” returns the end border distance.
    • Returns: end border distance
    • See also: setBorderDist()
    • Definition at line 390 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:
      • start β€” return parameter for the border width at the beginning of the scale
      • end β€” return parameter for the border width at the end of the scale
Warning: the minimum border distance depends on the font.
  • See also: setMinBorderDist(), getMinBorderDist(), setBorderDist()
  • Definition at line 815 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:
      • start β€” return parameter for the border width at the beginning of the scale
      • end β€” return parameter for the border width at the end of the scale
    • See also: setMinBorderDist(), getBorderDistHint()
    • Definition at line 853 of file qwt_scale_widget.cpp.
  • bool QwtScaleWidget::isColorBarEnabled () const β€” returns true when the color bar is enabled.
    • Returns: true, when the color bar is enabled
    • See also: setColorBarEnabled(), setColorBarWidth()
    • Definition at line 908 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:
      • update_geometry β€” notify the layout system and call update to redraw the scale
    • Definition at line 548 of file qwt_scale_widget.cpp.
  • int QwtScaleWidget::margin () const β€” returns the margin.
    • Returns: margin
    • See also: setMargin()
    • Definition at line 399 of file qwt_scale_widget.cpp.
  • QSize QwtScaleWidget::minimumSizeHint () const [override], [virtual] β€” returns a minimum size hint.
    • Returns: a minimum size hint
    • Definition at line 733 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::paintEvent (QPaintEvent * event) [override], [protected], [virtual] β€” paintEvent.
    • Definition at line 416 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::resizeEvent (QResizeEvent * event) [override], [protected], [virtual] β€” event handler for resize events.
    • Parameters:
      • event β€” resize event
    • Definition at line 534 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 717 of file qwt_scale_widget.cpp.
  • QwtScaleDraw * QwtScaleWidget::scaleDraw () β€” returns the scaleDraw of this scale.
    • Returns: scaleDraw of this scale
    • See also: QwtScaleDraw::setScaleDraw()
    • Definition at line 363 of file qwt_scale_widget.cpp.
  • const QwtScaleDraw * QwtScaleWidget::scaleDraw () const β€” returns the scaleDraw of this scale.
    • Returns: scaleDraw of this scale
    • See also: setScaleDraw(), QwtScaleDraw::setScaleDraw()
    • Definition at line 354 of file qwt_scale_widget.cpp.
  • void QwtScaleWidget::setAlignment (QwtScaleDraw::Alignment alignment) β€” change the alignment

Finishing setAlignment β€” the last little bits, bestie:

  • alignment β€” the new alignment πŸ’…
  • See also: alignment()
  • Defined at line 209 of qwt_scale_widget.cpp.

void QwtScaleWidget::setBorderDist (int dist1, int dist2)

Okay so this sets how far the scale’s endpoints sit from the widget’s borders. The actual borders will never be less than the minimum border distance β€” that’s the rule, no cap.

  • dist1 β€” left or top distance
  • dist2 β€” right or bottom distance
  • See also: borderDist()
  • Defined at line 251 of qwt_scale_widget.cpp.

void QwtScaleWidget::setColorBarEnabled (bool on)

En/disable a color bar associated to the scale. It’s giving β€œturn the color bar on or off,” periodt.

  • See also: isColorBarEnabled(), setColorBarWidth()
  • Defined at line 895 of qwt_scale_widget.cpp.

void QwtScaleWidget::setColorBarWidth (int width)

Set the width of the color bar. Slay, now it’s thick or thin as you like.

  • width β€” width
  • See also: colorBarWidth(), setColorBarEnabled()
  • Defined at line 919 of 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. This is the whole color vibe.

  • interval β€” value interval
  • colorMap β€” color map
  • See also: colorMap(), colorBarInterval()
  • Defined at line 956 of qwt_scale_widget.cpp.

void QwtScaleWidget::setLabelAlignment (Qt::Alignment alignment)

Change the alignment for the labels. Little labels, big alignment energy ✨

  • See also: QwtScaleDraw::setLabelAlignment(), setLabelRotation()
  • Defined at line 296 of qwt_scale_widget.cpp.

void QwtScaleWidget::setLabelRotation (double rotation)

Change the rotation for the labels. See QwtScaleDraw::setLabelRotation(). Rotate the labels, rotate the whole aesthetic πŸ’«

  • rotation β€” rotation
  • See also: QwtScaleDraw::setLabelRotation(), setLabelFlags()
  • Defined at line 309 of qwt_scale_widget.cpp.

void QwtScaleWidget::setLayoutFlag (LayoutFlag flag, bool on)

Toggle an layout flag β€” yes bestie, that’s exactly what it says.

  • flag β€” layout flag
  • on β€” true/false
  • See also: testLayoutFlag(), LayoutFlag
  • Defined at line 141 of qwt_scale_widget.cpp.

void QwtScaleWidget::setMargin (int margin)

Specify the margin to the colorBar/base line. Give it some breathing room 🫢

  • margin β€” margin
  • See also: margin()
  • Defined at line 266 of 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. No jumping scales on our watch πŸ’€

  • start β€” minimum for the start border
  • end β€” minimum for the end border
  • See also: getMinBorderDist(), getBorderDistHint()
  • Defined at line 836 of qwt_scale_widget.cpp.

void QwtScaleWidget::setScaleDiv (const QwtScaleDiv & scaleDiv)

Assign a scale division. The scale division determines where to set the tick marks. Tick placement is literally its whole job.

  • scaleDiv β€” scale division
  • See also: For more information about scale divisions, see QwtScaleDiv.
  • Defined at line 867 of qwt_scale_widget.cpp.

void QwtScaleWidget::setScaleDraw (QwtScaleDraw * scaleDraw)

Set a scale draw. Here’s the important tea: scaleDraw has to be created with new and will be deleted in ~QwtScaleWidget() or the next call of setScaleDraw(). Also, scaleDraw will be initialized with the attributes of the previous scaleDraw object. So it’s not starting from scratch, bestie.

  • scaleDraw β€” ScaleDraw object
  • See also: scaleDraw()
  • Defined at line 326 of qwt_scale_widget.cpp.

void QwtScaleWidget::setSpacing (int spacing)

Specify the distance between color bar, scale and title. Personal space, but for widgets 🌸

  • spacing β€” spacing
  • See also: spacing()
  • Defined at line 281 of qwt_scale_widget.cpp.

void QwtScaleWidget::setTitle (const QString & title)

Give title new text contents. New title, who dis? πŸ‘‘

  • title β€” new title
  • See also: title(), setTitle(const QwtText &);
  • Defined at line 172 of qwt_scale_widget.cpp.

void QwtScaleWidget::setTitle (const QwtText & title)

Give title new text contents. Same title energy, but with a QwtText.

  • title β€” new title
  • See also: title()
  • Defined at line 190 of qwt_scale_widget.cpp.
Warning: The title flags are interpreted in direction of the label. AlignTop, AlignBottom can’t be set as the title will always be aligned to the scale. So don’t try it, bestie 😭

void QwtScaleWidget::setTransformation (QwtTransform * transformation)

Set the transformation. Transformations are very main character energy.

  • transformation β€” transformation
  • See also: QwtAbstractScaleDraw::scaleDraw(), QwtScaleMap
  • Defined at line 885 of qwt_scale_widget.cpp.

QSize QwtScaleWidget::sizeHint () const [override], [virtual]

Returns a size hint. It’s lowkey telling you what size it wants to be.

  • Returns: a size hint
  • Defined at line 725 of qwt_scale_widget.cpp.

int QwtScaleWidget::spacing () const

Returns distance between scale and title. The gap, the space, the vibe check.

  • Returns: distance between scale and title
  • See also: setMargin()
  • Defined at line 408 of qwt_scale_widget.cpp.

int QwtScaleWidget::startBorderDist () const

Returns start border distance. Starting off strong.

  • Returns: start border distance
  • See also: setBorderDist()
  • Defined at line 381 of qwt_scale_widget.cpp.

bool QwtScaleWidget::testLayoutFlag (LayoutFlag flag) const

Test a layout flag. Is the flag on? Let’s find out πŸ”

  • flag β€” layout flag
  • Returns: true/false
  • See also: setLayoutFlag(), LayoutFlag
  • Defined at line 161 of qwt_scale_widget.cpp.

QwtText QwtScaleWidget::title () const

Returns title. The title said what it said.

  • Returns: title
  • See also: setTitle()
  • Defined at line 372 of qwt_scale_widget.cpp.

int QwtScaleWidget::titleHeightForWidth (int width) const

Find the height of the title for a given width. Math but make it fashion 🧚

  • width β€” width
  • Returns: height
  • Defined at line 768 of qwt_scale_widget.cpp.

✨ Author ✨

Generated automatically by Doxygen for Qwt User’s Guide from the source code.


And that’s the whole page, bestie β€” the footer is giving Qwt User's Guide / QwtScaleWidget(3), generated by Doxygen for the Qwt User’s Guide from the source code, and no date was printed, so we’re not gonna invent one. Periodt πŸ’–

πŸ“¦ where this page comes from