Commit d27167f1 authored by Chupligin Sergey's avatar Chupligin Sergey

Add function to set custom mm and dp scale factor

parent 3858cd52
...@@ -105,3 +105,26 @@ float Sizing::dp(float value) ...@@ -105,3 +105,26 @@ float Sizing::dp(float value)
{ {
return value*m_dp_factor; 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;
}
}
...@@ -37,6 +37,9 @@ public: ...@@ -37,6 +37,9 @@ public:
Q_INVOKABLE float mm(float value); Q_INVOKABLE float mm(float value);
Q_INVOKABLE float dp(float value); Q_INVOKABLE float dp(float value);
Q_INVOKABLE void setMmScaleFactor(float value);
Q_INVOKABLE void setDpScaleFactor(float value);
private: private:
bool m_valid; bool m_valid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment