diff --git a/src/controls/sizing.cpp b/src/controls/sizing.cpp index 4b2c8c3..09cff96 100644 --- a/src/controls/sizing.cpp +++ b/src/controls/sizing.cpp @@ -105,3 +105,26 @@ float Sizing::dp(float value) { return value*m_dp_factor; } + + +void Sizing::setMmScaleFactor(float value) +{ + if(value != 0) + { + qDebug() << "Set custom mm scale factor"; + + m_p_width = value; + setMmScaleFactor(); + } +} + + +void Sizing::setDpScaleFactor(float value) +{ + if(value != 0) + { + qDebug() << "Set custom dp scale factor"; + + m_dp_factor = value; + } +} diff --git a/src/controls/sizing.h b/src/controls/sizing.h index 57fc8c1..5fe7ac1 100644 --- a/src/controls/sizing.h +++ b/src/controls/sizing.h @@ -37,6 +37,9 @@ class Sizing : public QObject Q_INVOKABLE float mm(float value); Q_INVOKABLE float dp(float value); + Q_INVOKABLE void setMmScaleFactor(float value); + Q_INVOKABLE void setDpScaleFactor(float value); + private: bool m_valid;