Commit 35d5b71a authored by JanKusanagi's avatar JanKusanagi

Switch to QDialogButtonBox in ConfigDialog

parent 29c1693f
......@@ -183,10 +183,9 @@ ConfigDialog::ConfigDialog(GlobalObject *globalObject,
connect(cancelButton, &QAbstractButton::clicked,
this, &QWidget::hide);
this->buttonsLayout = new QHBoxLayout();
buttonsLayout->setAlignment(Qt::AlignRight);
buttonsLayout->addWidget(saveConfigButton);
buttonsLayout->addWidget(cancelButton);
m_buttonBox = new QDialogButtonBox(this);
m_buttonBox->addButton(saveConfigButton, QDialogButtonBox::AcceptRole);
m_buttonBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
// ESC to close
......@@ -206,7 +205,7 @@ ConfigDialog::ConfigDialog(GlobalObject *globalObject,
mainLayout->addWidget(dataDirectoryLabel);
mainLayout->addSpacing(8);
mainLayout->addStretch(2);
mainLayout->addLayout(buttonsLayout);
mainLayout->addWidget(m_buttonBox);
this->setLayout(mainLayout);
// Activate the first category (so the row already looks selected)
......
......@@ -34,6 +34,7 @@
#include <QComboBox>
#include <QCheckBox>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QSettings>
#include <QAction>
#include <QFileDialog>
......@@ -228,7 +229,7 @@ private:
// Widgets below the tab widget
QLabel *dataDirectoryLabel;
QHBoxLayout *buttonsLayout;
QDialogButtonBox *m_buttonBox;
QPushButton *saveConfigButton;
QPushButton *cancelButton;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment