Utils: Fix some IntegerAspect value display issue

... when a display scale factor was set.

Change-Id: I764db99e444f9cc70871c3dbec101d0b65542c4a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-12 16:27:01 +02:00
parent 2b54ef80d1
commit 4c1a161abd

View File

@@ -1913,7 +1913,7 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent)
if (isAutoApply()) { if (isAutoApply()) {
connect(d->m_spinBox.data(), &QSpinBox::valueChanged, connect(d->m_spinBox.data(), &QSpinBox::valueChanged,
this, [this] { setValue(d->m_spinBox->value()); }); this, [this] { setValue(d->m_spinBox->value() * d->m_displayScaleFactor); });
} }
} }
@@ -1940,7 +1940,7 @@ void IntegerAspect::setValue(qint64 value)
{ {
if (BaseAspect::setValueQuietly(value)) { if (BaseAspect::setValueQuietly(value)) {
if (d->m_spinBox) if (d->m_spinBox)
d->m_spinBox->setValue(value); d->m_spinBox->setValue(value / d->m_displayScaleFactor);
//qDebug() << "SetValue: Changing" << labelText() << " to " << value; //qDebug() << "SetValue: Changing" << labelText() << " to " << value;
emit changed(); emit changed();
//QTC_CHECK(!labelText().isEmpty()); //QTC_CHECK(!labelText().isEmpty());