#include <Knob.h>
|
| | Knob (KnobType _knob_num, QWidget *_parent=nullptr, const QString &_name=QString()) |
| | Construct a Knob with the given style and no label.
|
| | Knob (KnobType knobNum, const QString &labelText, QWidget *parent=nullptr, LabelRendering labelRendering=LabelRendering::WidgetFont, const QString &name=QString()) |
| | Construct a Knob with the given style and label text.
|
| | Knob (KnobType knobNum, const QString &labelText, int labelPixelSize, QWidget *parent, const QString &name=QString()) |
| | Constructs a knob with a label font in the pixel size.
|
| | Knob (QWidget *_parent=nullptr, const QString &_name=QString()) |
| | default ctor
|
| | Knob (const Knob &other)=delete |
| const QString & | getLabel () const |
| void | setLabel (const QString &txt) |
| void | setTotalAngle (float angle) |
| float | innerRadius () const |
| void | setInnerRadius (float r) |
| float | outerRadius () const |
| void | setOuterRadius (float r) |
| KnobType | knobNum () const |
| void | setknobNum (KnobType k) |
| QPointF | centerPoint () const |
| float | centerPointX () const |
| void | setCenterPointX (float c) |
| float | centerPointY () const |
| void | setCenterPointY (float c) |
| float | lineWidth () const |
| void | setLineWidth (float w) |
| QColor | outerColor () const |
| void | setOuterColor (const QColor &c) |
| QColor | textColor () const |
| void | setTextColor (const QColor &c) |
| | FloatModelEditorBase (DirectionOfManipulation directionOfManipulation=DirectionOfManipulation::Vertical, QWidget *_parent=nullptr, const QString &_name=QString()) |
| | default ctor
|
| | FloatModelEditorBase (const FloatModelEditorBase &other)=delete |
| void | setHintText (const QString &txt_before, const QString &txt_after) |
| bool | isVolumeKnob () const |
| void | setVolumeKnob (const bool val) |
| | TypedModelView (Model *model, QWidget *_this) |
| FloatModel * | model () |
| const FloatModel * | model () const |
| | AutomatableModelView (Model *model, QWidget *_this) |
| | ~AutomatableModelView () override=default |
| AutomatableModel * | modelUntyped () |
| const AutomatableModel * | modelUntyped () const |
| void | setModel (Model *model, bool isOldModelValid=true) override |
| void | unsetModel () override |
| template<typename T> |
| T | value () const |
| void | setDescription (const QString &desc) |
| void | setUnit (const QString &unit) |
| void | addDefaultActions (QMenu *menu) |
| void | setConversionFactor (float factor) |
| float | getConversionFactor () |
| | ModelView (Model *model, QWidget *widget) |
| virtual | ~ModelView () |
| Model * | model () |
| const Model * | model () const |
| template<class T> |
| T * | castModel () |
| template<class T> |
| const T * | castModel () const |
◆ LabelRendering
Determines how the label of the knob is rendered.
Labels can be rendered using the font that is set for the knob or using a font with a fixed size which is determined by SMALL_FONT_SIZE.
| Enumerator |
|---|
| WidgetFont | Renders the label using the font that is set for the widget.
The space that's needed for the label is determined using the font metrics of the knob's font.
|
| LegacyFixedFontSize | Renders the labels in legacy mode. This uses a fixed font size and does not adhere to the font size that's set for the widget's font.
- Deprecated
- Do not use this mode in new code as it is considered deprecated and might be removed in the future.
|
◆ Knob() [1/5]
| lmms::gui::Knob::Knob |
( |
KnobType | _knob_num, |
|
|
QWidget * | _parent = nullptr, |
|
|
const QString & | _name = QString() ) |
Construct a Knob with the given style and no label.
- Parameters
-
| _knob_num | Style of the knob |
| _parent | Parent widget |
| _name | Object name of the widget |
◆ Knob() [2/5]
Construct a Knob with the given style and label text.
- Parameters
-
| knobNum | Style of the knob |
| labelText | Text for the label |
| parent | Parent widget |
| labelRendering | Determines if the label uses the widget font or a font with a fixed size of 12 pixels (LegacyFixedFontSize). The default is to use the widget font. |
| name | Object name of the widget |
◆ Knob() [3/5]
| lmms::gui::Knob::Knob |
( |
KnobType | knobNum, |
|
|
const QString & | labelText, |
|
|
int | labelPixelSize, |
|
|
QWidget * | parent, |
|
|
const QString & | name = QString() ) |
Constructs a knob with a label font in the pixel size.
- Parameters
-
| knobNum | Style of the knob |
| labelText | Text for the label |
| labelPixelSize | Pixel size for the label |
| parent | Parent widget |
| name | Object name of the widget |
◆ Knob() [4/5]
| lmms::gui::Knob::Knob |
( |
QWidget * | _parent = nullptr, |
|
|
const QString & | _name = QString() ) |
◆ Knob() [5/5]
| lmms::gui::Knob::Knob |
( |
const Knob & | other | ) |
|
|
delete |
◆ angleFromValue()
| int lmms::gui::Knob::angleFromValue |
( |
float | value, |
|
|
float | minValue, |
|
|
float | maxValue, |
|
|
float | totalAngle ) const |
|
inlineprivate |
◆ calculateLine()
| QLineF lmms::gui::Knob::calculateLine |
( |
const QPointF & | _mid, |
|
|
float | _radius, |
|
|
float | _innerRadius = 1 ) const |
|
private |
◆ centerPoint()
| QPointF lmms::gui::Knob::centerPoint |
( |
| ) |
const |
◆ centerPointX()
| float lmms::gui::Knob::centerPointX |
( |
| ) |
const |
◆ centerPointY()
| float lmms::gui::Knob::centerPointY |
( |
| ) |
const |
◆ changeEvent()
| void lmms::gui::Knob::changeEvent |
( |
QEvent * | ev | ) |
|
|
overrideprotected |
◆ drawKnob()
| void lmms::gui::Knob::drawKnob |
( |
QPainter * | _p | ) |
|
|
private |
◆ drawLabel()
| void lmms::gui::Knob::drawLabel |
( |
QPainter & | p | ) |
|
|
private |
◆ fixedFontSizeLabelRendering()
| bool lmms::gui::Knob::fixedFontSizeLabelRendering |
( |
| ) |
const |
|
inlineprotected |
Affects how the label of the knob is rendered.
The default mode returns false. The height of the label text is taken into account when a new fixed size is computed for the Knob. When the label text is painted the descent of the font is used to compute the base line. The default mode returns false.
Enabling fixed font size rendering mode leads to the following behavior:
- The height of the label is not taken into account when the new fixed height of the Knob is computed. Instead a fixed size of 10 is added for the label.
- When the knob is painted the baseline of the font is always set to 2 pixels away from the lower side of the Knob's rectangle.
- The label is always rendered with a size of SMALL_FONT_SIZE.
◆ getLabel()
| const QString & lmms::gui::Knob::getLabel |
( |
| ) |
const |
◆ initUi()
| void lmms::gui::Knob::initUi |
( |
const QString & | _name | ) |
|
|
private |
◆ innerRadius()
| float lmms::gui::Knob::innerRadius |
( |
| ) |
const |
◆ knobNum()
| KnobType lmms::gui::Knob::knobNum |
( |
| ) |
const |
◆ lineWidth()
| float lmms::gui::Knob::lineWidth |
( |
| ) |
const |
◆ onKnobNumUpdated()
| void lmms::gui::Knob::onKnobNumUpdated |
( |
| ) |
|
|
private |
to be called when you updated m_knobNum
◆ outerColor()
| QColor lmms::gui::Knob::outerColor |
( |
| ) |
const |
◆ outerRadius()
| float lmms::gui::Knob::outerRadius |
( |
| ) |
const |
◆ paintEvent()
| void lmms::gui::Knob::paintEvent |
( |
QPaintEvent * | | ) |
|
|
overrideprotected |
◆ setCenterPointX()
| void lmms::gui::Knob::setCenterPointX |
( |
float | c | ) |
|
◆ setCenterPointY()
| void lmms::gui::Knob::setCenterPointY |
( |
float | c | ) |
|
◆ setFixedFontSizeLabelRendering()
| void lmms::gui::Knob::setFixedFontSizeLabelRendering |
( |
| ) |
|
|
protected |
Set the button to legacy rendering mode which uses a fixed font size and that does not take the size of the widget's font into account.
This can be thought of as a legacy mode which reinstates the old behavior of the knob.
- See also
- fixedFontSizeLabelRendering().
◆ setInnerRadius()
| void lmms::gui::Knob::setInnerRadius |
( |
float | r | ) |
|
◆ setknobNum()
◆ setLabel()
| void lmms::gui::Knob::setLabel |
( |
const QString & | txt | ) |
|
◆ setLineWidth()
| void lmms::gui::Knob::setLineWidth |
( |
float | w | ) |
|
◆ setOuterColor()
| void lmms::gui::Knob::setOuterColor |
( |
const QColor & | c | ) |
|
◆ setOuterRadius()
| void lmms::gui::Knob::setOuterRadius |
( |
float | r | ) |
|
◆ setTextColor()
| void lmms::gui::Knob::setTextColor |
( |
const QColor & | c | ) |
|
◆ setTotalAngle()
| void lmms::gui::Knob::setTotalAngle |
( |
float | angle | ) |
|
◆ textColor()
| QColor lmms::gui::Knob::textColor |
( |
| ) |
const |
◆ updateAngle()
| bool lmms::gui::Knob::updateAngle |
( |
| ) |
|
|
private |
◆ updateFixedSize()
| void lmms::gui::Knob::updateFixedSize |
( |
| ) |
|
|
private |
◆ m_angle
| int lmms::gui::Knob::m_angle |
|
private |
◆ m_arcActiveColor
| QColor lmms::gui::Knob::m_arcActiveColor |
|
private |
◆ m_arcInactiveColor
| QColor lmms::gui::Knob::m_arcInactiveColor |
|
private |
◆ m_cache
| QImage lmms::gui::Knob::m_cache |
|
private |
◆ m_centerPoint
| QPointF lmms::gui::Knob::m_centerPoint |
|
private |
◆ m_fixedFontSizeLabelRendering
| bool lmms::gui::Knob::m_fixedFontSizeLabelRendering = false |
|
private |
◆ m_innerRadius
| float lmms::gui::Knob::m_innerRadius |
|
private |
◆ m_knobNum
◆ m_knobPixmap
| std::unique_ptr<QPixmap> lmms::gui::Knob::m_knobPixmap |
|
private |
◆ m_label
| QString lmms::gui::Knob::m_label |
|
private |
◆ m_lineActiveColor
| QColor lmms::gui::Knob::m_lineActiveColor |
|
private |
◆ m_lineInactiveColor
| QColor lmms::gui::Knob::m_lineInactiveColor |
|
private |
◆ m_lineWidth
| float lmms::gui::Knob::m_lineWidth |
|
private |
◆ m_outerColor
| QColor lmms::gui::Knob::m_outerColor |
|
private |
◆ m_outerRadius
| float lmms::gui::Knob::m_outerRadius |
|
private |
◆ m_textColor
| QColor lmms::gui::Knob::m_textColor |
|
private |
◆ m_totalAngle
| float lmms::gui::Knob::m_totalAngle |
|
private |
◆ arcActiveColor
| QColor lmms::gui::Knob::arcActiveColor |
◆ arcInactiveColor
| QColor lmms::gui::Knob::arcInactiveColor |
◆ centerPointX
| float lmms::gui::Knob::centerPointX |
|
readwrite |
◆ centerPointY
| float lmms::gui::Knob::centerPointY |
|
readwrite |
◆ innerRadius
| float lmms::gui::Knob::innerRadius |
|
readwrite |
◆ knobNum
◆ lineActiveColor
| QColor lmms::gui::Knob::lineActiveColor |
◆ lineInactiveColor
| QColor lmms::gui::Knob::lineInactiveColor |
◆ lineWidth
| float lmms::gui::Knob::lineWidth |
|
readwrite |
◆ outerColor
| QColor lmms::gui::Knob::outerColor |
|
readwrite |
◆ outerRadius
| float lmms::gui::Knob::outerRadius |
|
readwrite |
◆ textColor
| QColor lmms::gui::Knob::textColor |
|
readwrite |
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/include/Knob.h
- /home/runner/work/lmms-fork/lmms-fork/src/gui/widgets/Knob.cpp