Gui: [skip ci] fix size hint of QuantitySpinBox by setting text margins of 2px

See https://forum.freecadweb.org/viewtopic.php?f=3&t=45344
This commit is contained in:
wmayer
2020-04-28 16:53:52 +02:00
parent 60adfc863f
commit ec7ea875a1

View File

@@ -259,6 +259,8 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent)
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
// When a style sheet is set the text margins must for top/bottom must be set to avoid to squash the widget
lineEdit()->setTextMargins(0, 2, 0, 2);
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}