diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp index a607a806f..06b2dca77 100644 --- a/src/app/valentina/core/vformulapropertyeditor.cpp +++ b/src/app/valentina/core/vformulapropertyeditor.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "../vpropertyexplorer/vproperty.h" #include "../vtools/dialogs/support/dialogeditwrongformula.h" @@ -42,7 +43,7 @@ // VFormulaPropertyEditor //--------------------------------------------------------------------------------------------------------------------- VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) - : QWidget(parent), formula(VFormula()), ToolButton(nullptr), TextLabel(nullptr), Spacer(nullptr) + : QWidget(parent), formula(VFormula()), ToolButton(nullptr), TextLabel(nullptr) { setAutoFillBackground(true); @@ -61,15 +62,13 @@ VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) TextLabel = new QLabel(this); TextLabel->setText(formula.getStringValue()); - // Spacer (this is needed for proper display of the label and button) - Spacer = new QSpacerItem(1, 0, QSizePolicy::Expanding, QSizePolicy::Ignored); - // The layout (a horizontal layout) QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(3); layout->setMargin(0); layout->addWidget(TextLabel); - layout->addItem(Spacer); + // Spacer (this is needed for proper display of the label and button) + layout->addSpacerItem(new QSpacerItem(1000000000, 0, QSizePolicy::Expanding, QSizePolicy::Expanding)); layout->addWidget(ToolButton); } diff --git a/src/app/valentina/core/vformulapropertyeditor.h b/src/app/valentina/core/vformulapropertyeditor.h index 6a3660432..98fe6b089 100644 --- a/src/app/valentina/core/vformulapropertyeditor.h +++ b/src/app/valentina/core/vformulapropertyeditor.h @@ -33,7 +33,6 @@ #include #include #include -#include #include "../vpatterndb/vformula.h" @@ -72,7 +71,6 @@ private: VFormula formula; QToolButton* ToolButton; QLabel* TextLabel; - QSpacerItem* Spacer; }; diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index 88aac1571..3a502245d 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -103,6 +103,7 @@ void VPE::VPropertyFormWidget::build() } QFormLayout* tmpFormLayout = new QFormLayout(this); + tmpFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); setLayout(tmpFormLayout); for (int i = 0; i < d_ptr->Properties.count(); ++i) @@ -123,9 +124,11 @@ void VPE::VPropertyFormWidget::build() tmpFormLayout->addRow(group); QFormLayout* subFormLayout = new QFormLayout(group); + subFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); QMargins margins = subFormLayout->contentsMargins(); margins.setTop(0); - margins.setLeft(14); + margins.setLeft(18); + margins.setRight(0); subFormLayout->setContentsMargins(margins); group->setLayout(subFormLayout);