Skip to content

Commit 057943b

Browse files
committed
GUI: Let CreateOptionUI caller pre-initialise the QLayout
1 parent e1e3b81 commit 057943b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/qt/optionsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ void OptionsDialog::FixTabOrder(QWidget * const o)
6060
prevwidget = o;
6161
}
6262

63-
void OptionsDialog::CreateOptionUI(QBoxLayout * const layout, QWidget * const o, const QString& text)
63+
void OptionsDialog::CreateOptionUI(QBoxLayout * const layout, QWidget * const o, const QString& text, QLayout *horizontalLayout)
6464
{
6565
QWidget * const parent = o->parentWidget();
6666
const QStringList text_parts = text.split("%s");
6767

68-
QHBoxLayout * const horizontalLayout = new QHBoxLayout();
68+
if (!horizontalLayout) horizontalLayout = new QHBoxLayout();
6969

7070
QLabel * const labelBefore = new QLabel(parent);
7171
labelBefore->setText(text_parts[0]);

src/qt/optionsdialog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class QBoxLayout;
1818
class QCheckBox;
1919
class QDataWidgetMapper;
2020
class QDoubleSpinBox;
21+
class QLayout;
2122
class QSpinBox;
2223
class QString;
2324
class QValueComboBox;
@@ -94,7 +95,7 @@ private Q_SLOTS:
9495

9596
QWidget *prevwidget{nullptr};
9697
void FixTabOrder(QWidget *);
97-
void CreateOptionUI(QBoxLayout *, QWidget *, const QString& text);
98+
void CreateOptionUI(QBoxLayout *, QWidget *, const QString& text, QLayout *horizontalLayout = nullptr);
9899

99100
QCheckBox *walletrbf;
100101

0 commit comments

Comments
 (0)