20#ifndef LIBREPCB_EDITOR_LENGTHEDITBASE_H
21#define LIBREPCB_EDITOR_LENGTHEDITBASE_H
26#include "../widgets/numbereditbase.h"
52 static QVector<PositiveLength>
generic()
noexcept {
71 static QVector<PositiveLength>
pinLength() noexcept {
95 QWidget* parent =
nullptr) noexcept;
127 const QString& uniqueIdentifier) noexcept;
128 virtual
void stepBy(
int steps) override;
141 virtual QAbstractSpinBox::StepEnabled
stepEnabled() const override;
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The LengthEditBase class.
Definition: lengtheditbase.h:47
void updateSingleStepPredefined() noexcept
Definition: lengtheditbase.cpp:268
QSize minimumSizeHint() const override
Definition: lengtheditbase.cpp:179
const LengthUnit & getDisplayedUnit() const noexcept
Definition: lengtheditbase.cpp:93
void configureClientSettings(const QString &uniqueIdentifier) noexcept
Definition: lengtheditbase.cpp:139
Length mMaximum
Definition: lengtheditbase.h:160
void saveSelectedUnit() noexcept
Definition: lengtheditbase.cpp:360
void updateText() noexcept
Definition: lengtheditbase.cpp:307
LengthUnit extractUnitFromExpression(QString &expression) const noexcept
Definition: lengtheditbase.cpp:311
void changeUnitActionTriggered() noexcept
Definition: lengtheditbase.cpp:324
QSize sizeHint() const override
Definition: lengtheditbase.cpp:183
void setDefaultUnit(const LengthUnit &unit) noexcept
Definition: lengtheditbase.cpp:105
void resetUnit() noexcept
Definition: lengtheditbase.cpp:132
virtual void valueChangedImpl(const Length &diff) noexcept=0
LengthUnit mDefaultUnit
Definition: lengtheditbase.h:157
QPointer< QAction > mChangeUnitAction
Definition: lengtheditbase.h:156
QString getValueStr(const LengthUnit &unit) const noexcept
Definition: lengtheditbase.cpp:371
Length mSingleStepDown
Zero means "no step available".
Definition: lengtheditbase.h:165
Length mSingleStepUp
Zero means "no step available".
Definition: lengtheditbase.h:164
void updateSingleStepHalfDouble() noexcept
Definition: lengtheditbase.cpp:297
void configure(const LengthUnit &defaultUnit, const QVector< PositiveLength > &steps, const QString &uniqueIdentifier) noexcept
Definition: lengtheditbase.cpp:159
void setDefaultValueToolTip(const Length &value) noexcept
Definition: lengtheditbase.cpp:101
void setChangeUnitActionVisible(bool visible) noexcept
Definition: lengtheditbase.cpp:112
void setSteps(const QVector< PositiveLength > &steps) noexcept
Set the supported up/down step values.
Definition: lengtheditbase.cpp:122
void setValueImpl(Length value) noexcept
Definition: lengtheditbase.cpp:204
void setSelectedUnit(const LengthUnit &unit) noexcept
Definition: lengtheditbase.cpp:350
void displayedUnitChanged(const LengthUnit &unit)
QSize mAdditionalSize
Definition: lengtheditbase.h:166
virtual void stepBy(int steps) override
Definition: lengtheditbase.cpp:167
virtual QAbstractSpinBox::StepEnabled stepEnabled() const override
Definition: lengtheditbase.cpp:191
void updateValueFromText(QString text) noexcept
Definition: lengtheditbase.cpp:221
QString mSettingsKey
Empty means "do not save".
Definition: lengtheditbase.h:167
QVector< PositiveLength > mSteps
Definition: lengtheditbase.h:163
StepBehavior
Definition: lengtheditbase.h:86
void setStepBehavior(StepBehavior behavior) noexcept
Definition: lengtheditbase.cpp:116
Length mMinimum
Definition: lengtheditbase.h:159
Length mValue
Definition: lengtheditbase.h:161
StepBehavior mStepBehavior
Definition: lengtheditbase.h:162
tl::optional< LengthUnit > mSelectedUnit
Definition: lengtheditbase.h:158
void updateSingleStep() noexcept
Definition: lengtheditbase.cpp:250
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
Definition: lengtheditbase.h:51
static QVector< PositiveLength > pinLength() noexcept
Definition: lengtheditbase.h:71
static QVector< PositiveLength > drillDiameter() noexcept
Definition: lengtheditbase.h:78
static QVector< PositiveLength > textHeight() noexcept
Definition: lengtheditbase.h:63