Fixed some labels being too big on hi-dpi

This commit is contained in:
fourtf
2018-06-24 17:01:45 +02:00
parent 683017008a
commit 68ddd1e7c9
6 changed files with 13 additions and 37 deletions
-29
View File
@@ -124,35 +124,6 @@ void BaseWidget::setScale(float value)
this->scaleChanged.invoke(value);
this->setScaleIndependantSize(this->getScaleIndependantSize());
// set scale for all children
BaseWidget::setScaleRecursive(value, this);
}
void BaseWidget::setScaleRecursive(float scale, QObject *object)
{
for (QObject *child : object->children()) {
BaseWidget *widget = dynamic_cast<BaseWidget *>(child);
if (widget != nullptr) {
widget->setScale(scale);
continue;
}
// QLayout *layout = nullptr;
// QWidget *widget = dynamic_cast<QWidget *>(child);
// if (widget != nullptr) {
// layout = widget->layout();
// }
// else {
QLayout *layout = dynamic_cast<QLayout *>(object);
if (layout != nullptr) {
setScaleRecursive(scale, layout);
}
// }
}
}
void BaseWidget::scaleChangedEvent(float newDpi)