QwtThermo(3)

πŸ’… QwtThermo β€” NAME

okay so bestie, this is QwtThermo(3) from the Library Functions Manual β€” it's the Thermometer Widget, and honestly? it's giving main character energy for a Qt widget. ✨


🌸 SYNOPSIS

#include <qwt_thermo.h>

Inherits QwtAbstractScale. (so yes, it's part of the whole Qwt scale family, iykyk 🫢)


πŸŽ€ Public Types

  • enum ScalePosition β€” { NoScale, LeadingScale, TrailingScale }
  • enum OriginMode β€” { OriginMinimum, OriginMaximum, OriginCustom }

⭐ Public Slots

  • virtual void setValue (double)

πŸ’– Public Member Functions

  • QwtThermo (QWidget *parent=NULL)
  • virtual ~QwtThermo () β€” Destructor.
  • void setOrientation (Qt::Orientation) β€” Set the orientation.
  • Qt::Orientation orientation () const
  • void setScalePosition (ScalePosition) β€” Change the position of the scale.
  • ScalePosition scalePosition () const
  • void setSpacing (int) β€” Change the spacing between pipe and scale.
  • int spacing () const
  • void setBorderWidth (int)
  • int borderWidth () const
  • void setOriginMode (OriginMode) β€” Change how the origin is determined.
  • OriginMode originMode () const
  • void setOrigin (double) β€” Specifies the custom origin.
  • double origin () const
  • void setFillBrush (const QBrush &) β€” Change the brush of the liquid.
  • QBrush fillBrush () const
  • void setAlarmBrush (const QBrush &) β€” Specify the liquid brush above the alarm threshold.
  • QBrush alarmBrush () const
  • void setAlarmLevel (double)
  • double alarmLevel () const
  • void setAlarmEnabled (bool) β€” Enable or disable the alarm threshold.
  • bool alarmEnabled () const
  • void setColorMap (QwtColorMap *) β€” Assign a color map for the fill color.
  • QwtColorMap * colorMap ()
  • const QwtColorMap * colorMap () const
  • void setPipeWidth (int)
  • int pipeWidth () const
  • void setRangeFlags (QwtInterval::BorderFlags) β€” Exclude/Include min/max values.
  • QwtInterval::BorderFlags rangeFlags () const
  • double value () const β€” Return the value.
  • virtual QSize sizeHint () const override
  • virtual QSize minimumSizeHint () const override
  • void setScaleDraw (QwtScaleDraw *) β€” Set a scale draw.
  • const QwtScaleDraw * scaleDraw () const

πŸ¦‹ Public Member Functions inherited from QwtAbstractScale

  • QwtAbstractScale (QWidget *parent=NULL)
  • virtual ~QwtAbstractScale () β€” Destructor.
  • void setScale (double lowerBound, double upperBound) β€” Specify a scale.
  • void setScale (const QwtInterval &) β€” Specify a scale.
  • void setScale (const QwtScaleDiv &) β€” Specify a scale.
  • const QwtScaleDiv & scaleDiv () const
  • void setLowerBound (double value)
  • double lowerBound () const
  • void setUpperBound (double value)
  • double upperBound () const
  • void setScaleStepSize (double stepSize) β€” Set the step size used for calculating a scale division.
  • double scaleStepSize () const
  • void setScaleMaxMajor (int ticks) β€” Set the maximum number of major tick intervals.
  • int scaleMaxMinor () const
  • void setScaleMaxMinor (int ticks) β€” Set the maximum number of minor tick intervals.
  • int scaleMaxMajor () const
  • void setScaleEngine (QwtScaleEngine *) β€” Set a scale engine.
  • const QwtScaleEngine * scaleEngine () const
  • QwtScaleEngine * scaleEngine ()
  • int transform (double) const
  • double invTransform (int) const
  • bool isInverted () const
  • double minimum () const
  • double maximum () const
  • const QwtScaleMap & scaleMap () const

πŸ’œ Protected Member Functions

  • virtual void drawLiquid (QPainter *, const QRect &) const
  • virtual void scaleChange () override β€” Notify a scale change.
  • virtual void paintEvent (QPaintEvent *) override
  • virtual void resizeEvent (QResizeEvent *) override
  • virtual void changeEvent (QEvent *) override
  • QwtScaleDraw * scaleDraw ()
  • QRect pipeRect () const
  • QRect fillRect (const QRect &) const β€” Calculate the filled rectangle of the pipe.
  • QRect alarmRect (const QRect &) const β€” Calculate the alarm rectangle of the pipe.

🌈 Protected Member Functions inherited from QwtAbstractScale

  • void rescale (double lowerBound, double upperBound, double stepSize)
  • void setAbstractScaleDraw (QwtAbstractScaleDraw *) β€” Set a scale draw.
  • const QwtAbstractScaleDraw * abstractScaleDraw () const
  • QwtAbstractScaleDraw * abstractScaleDraw ()
  • void updateScaleDraw ()

✨ Detailed Description

<h2>πŸ”₯ The Thermometer Widget.</h2>

So QwtThermo is that widget that displays a value in an interval β€” like an actual thermometer, but make it fashion πŸ’…. It supports:

  • a horizontal or vertical layout;
  • a range;
  • a scale;
  • an alarm level.

The fill colors might be calculated from an optional color map. If no color map has been assigned, QwtThermo uses the following colors/brushes from the widget palette:

  • QPalette::Base β€” Background of the pipe
  • QPalette::ButtonText β€” Fill brush below the alarm level
  • QPalette::Highlight β€” Fill brush for the values above the alarm level
  • QPalette::WindowText β€” For the axis of the scale
  • QPalette::Text β€” For the labels of the scale
fr fr this is Definition at line 46 of file qwt_thermo.h. no cap. 🫢

🧚 Member Enumeration Documentation

πŸ’« enum QwtThermo::OriginMode

Origin mode. This property specifies where the beginning of the liquid is placed (like, where the thermometer starts filling from, bestie πŸ“).

See also: setOriginMode(), setOrigin()

Enumerator

  • OriginMinimum β€” The origin is the minimum of the scale.
  • OriginMaximum β€” The origin is the maximum of the scale.
  • OriginCustom β€” The origin is specified using the origin() property.
Definition at line 91 of file qwt_thermo.h.

🌸 enum QwtThermo::ScalePosition

Position of the scale πŸ‘‘

See also: setScalePosition(), setOrientation()

Enumerator

  • NoScale β€” The slider has no scale.
  • LeadingScale β€” The scale is right of a vertical or below of a horizontal slider.
  • TrailingScale β€” The scale is left of a vertical or above of a horizontal slider.
Definition at line 73 of file qwt_thermo.h.

πŸŽ€ Constructor & Destructor Documentation

πŸ’– QwtThermo::QwtThermo (QWidget * parent = NULL) [explicit]

Constructor ✨

Parameters

  • parent β€” Parent widget
Definition at line 121 of file qwt_thermo.cpp.

πŸ’œ QwtThermo::~QwtThermo () [virtual]

Destructor. (saying bye to your thermometer, sad but iconic 😭)

Definition at line 137 of file qwt_thermo.cpp.

πŸ’… Member Function Documentation πŸ’…

Okay bestie, this is the full member-function roster in the exact order the docs gave it to us β€” every signature, parameter, warning, and definition line is staying put. Grab a lil snack. πŸ“


QBrush QwtThermo::alarmBrush () const

This one hands you the liquid brush that shows up above the alarm threshold β€” specifically the QPalette::Highlight brush. πŸ’–

  • Returns: Liquid brush (QPalette::Highlight) above the alarm threshold.
  • See also: setAlarmBrush(), QWidget::palette()
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 761 of file qwt_thermo.cpp.


bool QwtThermo::alarmEnabled () const

Tells you if the alarm threshold is turned on. true means enabled, bestie. βœ…

  • Returns: True, when the alarm threshold is enabled.
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 837 of file qwt_thermo.cpp.


double QwtThermo::alarmLevel () const

Gives you the alarm threshold value itself. 🌑️

  • Returns: Alarm threshold.
  • See also: setAlarmLevel()
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 789 of file qwt_thermo.cpp.


QRect QwtThermo::alarmRect (const QRect & fillRect) const [protected]

Calculates the alarm rectangle of the pipe. Very geometry, very slay. πŸ“

  • Parameters:
    • fillRect β€” Filled rectangle in the pipe
  • Returns: Rectangle to be filled with the alarm brush
  • See also: pipeRect(), fillRect(), alarmLevel(), alarmBrush()

Definition at line 944 of file qwt_thermo.cpp.


int QwtThermo::borderWidth () const

Returns how wide the thermometer pipe’s border is. πŸŽ€

  • Returns: Border width of the thermometer pipe.
  • See also: setBorderWidth()

Definition at line 671 of file qwt_thermo.cpp.


void QwtThermo::changeEvent (QEvent * event) [override], [protected], [virtual]

Qt change event handler β€” it handles the change event, periodt. πŸ¦‹

  • Parameters:
    • event β€” Event
  • Reimplemented from: QwtAbstractScale

Definition at line 277 of file qwt_thermo.cpp.


QwtColorMap * QwtThermo::colorMap ()

Returns the color map used for the fill color. 🌈

  • Returns: Color map for the fill color
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 697 of file qwt_thermo.cpp.


const QwtColorMap * QwtThermo::colorMap () const

Same color-map energy, but the const version. Still giving fill color realness. ✨

  • Returns: Color map for the fill color
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 707 of file qwt_thermo.cpp.


void QwtThermo::drawLiquid (QPainter * painter, const QRect & pipeRect) const [protected], [virtual]

Redraws the liquid inside the thermometer pipe. This is the literal glow-up moment. πŸ’§

  • Parameters:
    • painter β€” Painter
    • pipeRect β€” Bounding rectangle of the pipe without borders

Definition at line 546 of file qwt_thermo.cpp.


QBrush QwtThermo::fillBrush () const

Gives you the liquid brush β€” the QPalette::ButtonText one. πŸ–ŒοΈ

  • Returns: Liquid (QPalette::ButtonText) brush.
  • See also: setFillBrush(), QWidget::palette()

Definition at line 731 of file qwt_thermo.cpp.


QRect QwtThermo::fillRect (const QRect & pipeRect) const [protected]

Calculates the filled rectangle of the pipe. Geometry bestie behavior. πŸ“

  • Parameters:
    • pipeRect β€” Rectangle of the pipe
  • Returns: Rectangle to be filled (fill and alarm brush)
  • See also: pipeRect(), alarmRect()

Definition at line 897 of file qwt_thermo.cpp.


QSize QwtThermo::minimumSizeHint () const [override], [virtual]

Returns the minimum size hint. Cute li’l widget needs a minimum, okay? 🧚

  • Returns: Minimum size hint
⚠️ Warning: The return value depends on the font and the scale.
  • See also: sizeHint()

Definition at line 856 of file qwt_thermo.cpp.


Qt::Orientation QwtThermo::orientation () const

Returns the orientation. Horizontal? Vertical? Iconic either way. πŸ’«

  • Returns: Orientation
  • See also: setOrientation()

Definition at line 455 of file qwt_thermo.cpp.


double QwtThermo::origin () const

Returns the origin of the thermo when OriginCustom is enabled. 🌱

  • Returns: Origin of the thermo, when OriginCustom is enabled
  • See also: setOrigin(), setOriginMode(), originMode()

Definition at line 504 of file qwt_thermo.cpp.


QwtThermo::OriginMode QwtThermo::originMode () const

Tells you the mode used to determine the origin. Main-character origin energy only. πŸ‘‘

  • Returns: Mode, how the origin is determined.
  • See also: setOriginMode(), serOrigin(), origin()

Definition at line 477 of file qwt_thermo.cpp.


void QwtThermo::paintEvent (QPaintEvent * event) [override], [protected], [virtual]

Paint event handler. It paints. It handles. It slays. 🎨

  • Parameters:
    • event β€” Paint event

Definition at line 235 of file qwt_thermo.cpp.


QRect QwtThermo::pipeRect () const [protected]

Returns the bounding rectangle of the pipe β€” without borders β€” in widget coordinates. πŸ“¦

  • Returns: Bounding rectangle of the pipe (without borders) in widget coordinates

Definition at line 385 of file qwt_thermo.cpp.


int QwtThermo::pipeWidth () const

Returns the width of the pipe. That’s it, that’s the function. 🎯

  • Returns: Width of the pipe.
  • See also: setPipeWidth()

Definition at line 813 of file qwt_thermo.cpp.


QwtInterval::BorderFlags QwtThermo::rangeFlags () const

Returns the range flags. 🚩

  • Returns: Range flags
  • See also: setRangeFlags()

Definition at line 170 of file qwt_thermo.cpp.


void QwtThermo::resizeEvent (QResizeEvent * event) [override], [protected], [virtual]

Resize event handler β€” catching that resize moment. πŸ¦‹

  • Parameters:
    • event β€” Resize event

Definition at line 267 of file qwt_thermo.cpp.


void QwtThermo::scaleChange () [override], [protected], [virtual]

Notifies a scale change. Tell the people, bestie. πŸ“£

  • Reimplemented from: QwtAbstractScale

Definition at line 536 of file qwt_thermo.cpp.


QwtScaleDraw * QwtThermo::scaleDraw () [protected]

Returns the scale draw of the thermo. Non-const version, doing its thing. πŸŽ€

  • Returns: the scale draw of the thermo
  • See also: setScaleDraw()

Definition at line 226 of file qwt_thermo.cpp.


const QwtScaleDraw * QwtThermo::scaleDraw () const

Returns the scale draw of the thermo β€” const edition. Same scale-draw icon behavior. ⭐

  • Returns: the scale draw of the thermo
  • See also: setScaleDraw()

Definition at line 217 of file qwt_thermo.cpp.


QwtThermo::ScalePosition QwtThermo::scalePosition () const

Returns the scale position. Where’s the scale? Right there. πŸ“

  • Returns: Scale position.
  • See also: setScalePosition()

Definition at line 530 of file qwt_thermo.cpp.


void QwtThermo::setAlarmBrush (const QBrush & brush)

Specifies the liquid brush above the alarm threshold. Changes the QPalette::Highlight brush of the palette. πŸ’…

  • Parameters:
    • brush β€” New brush.
  • See also: alarmBrush(), QWidget::setPalette()
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 747 of file qwt_thermo.cpp.


void QwtThermo::setAlarmEnabled (bool on)

Enables or disables the alarm threshold. Yes, the docs say true is β€œdisabled” and false is β€œenabled” β€” bestie, we are just relaying the assignment. 😭

  • Parameters:
    • on β€” true (disabled) or false (enabled)
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 825 of file qwt_thermo.cpp.


void QwtThermo::setAlarmLevel (double level)

Specifies the alarm threshold. Set that level. 🚨

  • Parameters:
    • level β€” Alarm threshold
  • See also: alarmLevel()
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 775 of file qwt_thermo.cpp.


void QwtThermo::setBorderWidth (int width)

Sets the border width of the pipe. Chunky or thin, your call. πŸ–ΌοΈ

  • Parameters:
    • width β€” Border width
  • See also: borderWidth()

Definition at line 655 of file qwt_thermo.cpp.


void QwtThermo::setColorMap (QwtColorMap * colorMap)

Assigns a color map for the fill color. 🌈

  • Parameters:
    • colorMap β€” Color map
⚠️ Warning: The alarm threshold has no effect, when a color map has been assigned.

Definition at line 683 of file qwt_thermo.cpp.


void QwtThermo::setFillBrush (const QBrush & brush)

Changes the brush of the liquid. Changes the QPalette::ButtonText brush of the palette. πŸ–ŒοΈ

  • Parameters:
    • brush β€” New brush.
  • See also: fillBrush(), QWidget::setPalette()

Definition at line 720 of file qwt_thermo.cpp.


void QwtThermo::setOrientation (Qt::Orientation orientation)

Sets the orientation. πŸ“

  • Parameters:
    • orientation β€” Allowed values are Qt::Horizontal and Qt::Vertical.
  • See also: orientation(), scalePosition()

Definition at line 432 of file qwt_thermo.cpp.


void QwtThermo::setOrigin (double origin)

Specifies the custom origin. If originMode is set to OriginCustom, this property controls where the liquid starts. 🌊

  • Parameters:
    • origin β€” New origin level
  • See also: setOriginMode(), originMode(), origin()

Definition at line 491 of file qwt_thermo.cpp.


void QwtThermo::setOriginMode (OriginMode m)

Changes how the origin is determined. 🌱

  • See also: originMode(), serOrigin(), origin()

Definition at line 464 of file qwt_thermo.cpp.


void QwtThermo::setPipeWidth (int width)

Changes the width of the pipe. Thicker pipe, different vibe. πŸ’«

  • Parameters:
    • width β€” Width of the pipe
  • See also: pipeWidth()

Definition at line 800 of file qwt_thermo.cpp.


void QwtThermo::setRangeFlags (QwtInterval::BorderFlags flags)

Excludes/includes min/max values. According to the flags, minValue() and maxValue() are included/excluded from the pipe. In case of an excluded value, the corresponding tick is painted 1 pixel off of the pipeRect().

F.e. when a minimum of 0.0 has to be displayed as an empty pipe, the minValue() needs to be excluded. 🚩

  • Parameters:
    • flags β€” Range flags
  • See also: rangeFlags()

Definition at line 157 of file qwt_thermo.cpp.


void QwtThermo::setScaleDraw (QwtScaleDraw * scaleDraw)

Sets a scale draw. For changing the labels of the scales, it is necessary to derive from QwtScaleDraw and overload QwtScaleDraw::label(). πŸŽ€

  • Parameters:
    • scaleDraw β€” ScaleDraw object, that has to be created with new and will be deleted in ~QwtThermo() or the next call of setScaleDraw().

Definition at line 207 of file qwt_thermo.cpp.


void QwtThermo::setScalePosition (ScalePosition scalePosition)

Changes the position of the scale. Move it, place it, scale-position it. πŸ“

  • Parameters:
    • scalePosition β€” Position of the scale.
  • See also: ScalePosition, scalePosition()

Definition at line 515 of file qwt_thermo.cpp.


void QwtThermo::setSpacing (int spacing)

Changes the spacing between pipe and scale. A spacing of 0 means that the backbone of the scale is below the pipe.

The default setting is 3 pixels. πŸŽ€

  • Parameters:
    • spacing β€” Number of pixels
  • See also: spacing();

Definition at line 629 of file qwt_thermo.cpp.


void QwtThermo::setValue (double value) [virtual], [slot]

Sets the current value. The main event, honestly. πŸ”₯

  • Parameters:
    • value β€” New Value
  • See also: value()

Definition at line 181 of file qwt_thermo.cpp.


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

Returns the minimum size hint. Cute size-hint behavior. 🧚

  • Returns: the minimum size hint
  • See also: minimumSizeHint()

Definition at line 846 of file qwt_thermo.cpp.


int QwtThermo::spacing () const

Returns the number of pixels between pipe and scale. πŸ“

  • Returns: Number of pixels between pipe and scale
  • See also: setSpacing()

Definition at line 645 of file qwt_thermo.cpp.


double QwtThermo::value () const

Returns the value. That’s the whole vibe. πŸ’œ

  • Returns: Return the value.

Definition at line 191 of file qwt_thermo.cpp.


🌟 Author 🌟

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


Okay bestie, that’s the whole member-function lineup! 🫢 This page is auto-generated by Doxygen for the Qwt User's Guide straight from the source code β€” footer source/version vibes: Qwt User's Guide + QwtThermo(3). The date isn’t printed in this footer copy, so consider this your cute sign-off instead. πŸŽ€βœ¨

πŸ“¦ where this page comes from