Gui: spinbox use getmargin
This commit is contained in:
committed by
Kacper Donat
parent
ad95704832
commit
02f37bf598
@@ -68,7 +68,6 @@ ExpressionSpinBox::~ExpressionSpinBox() = default;
|
||||
|
||||
int ExpressionSpinBox::getMargin()
|
||||
{
|
||||
lineedit = spinbox->findChild<QLineEdit*>();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
return lineedit->style()->pixelMetric(QStyle::PM_LineEditIconMargin, nullptr, lineedit) / 2;
|
||||
#else
|
||||
@@ -179,12 +178,7 @@ void ExpressionSpinBox::onChange()
|
||||
|
||||
void ExpressionSpinBox::resizeWidget()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
int margin = lineedit->style()->pixelMetric(QStyle::PM_LineEditIconMargin, nullptr, lineedit) / 2;
|
||||
#else
|
||||
int margin = lineedit->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, nullptr, lineedit);
|
||||
#endif
|
||||
int iconWidth = iconLabel->width() + margin;
|
||||
int iconWidth = iconLabel->width() + getMargin();
|
||||
iconLabel->move(lineedit->width() - iconWidth, (lineedit->height() - iconLabel->height()) / 2);
|
||||
updateExpression();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user