Commit 82a528b0 authored by JanKusanagi's avatar JanKusanagi

Switch PageSelector to QDialogButtonBox

parent c36de642
......@@ -107,6 +107,10 @@ PageSelector::PageSelector(QWidget *parent) : QWidget(parent)
connect(m_closeButton, &QAbstractButton::clicked,
this, &QWidget::hide);
m_bottomButtonBox = new QDialogButtonBox(this);
m_bottomButtonBox->addButton(m_goButton, QDialogButtonBox::AcceptRole);
m_bottomButtonBox->addButton(m_closeButton, QDialogButtonBox::RejectRole);
m_closeAction = new QAction(this);
m_closeAction->setShortcut(QKeySequence(Qt::Key_Escape));
......@@ -136,12 +140,6 @@ PageSelector::PageSelector(QWidget *parent) : QWidget(parent)
m_middleLayout->addWidget(m_olderButton);
m_bottomLayout = new QHBoxLayout();
m_bottomLayout->setAlignment(Qt::AlignRight);
m_bottomLayout->addWidget(m_goButton);
m_bottomLayout->addWidget(m_closeButton);
m_mainLayout = new QVBoxLayout();
m_mainLayout->addLayout(m_topLayout);
m_mainLayout->addSpacing(24);
......@@ -149,7 +147,7 @@ PageSelector::PageSelector(QWidget *parent) : QWidget(parent)
m_mainLayout->addLayout(m_middleLayout);
m_mainLayout->addStretch(2);
m_mainLayout->addSpacing(32);
m_mainLayout->addLayout(m_bottomLayout);
m_mainLayout->addWidget(m_bottomButtonBox);
this->setLayout(m_mainLayout);
qDebug() << "PageSelector created";
......
......@@ -28,6 +28,7 @@
#include <QSpinBox>
#include <QSlider>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QAction>
#include <QHideEvent>
......@@ -65,7 +66,7 @@ private:
QVBoxLayout *m_mainLayout;
QHBoxLayout *m_topLayout;
QHBoxLayout *m_middleLayout;
QHBoxLayout *m_bottomLayout;
QDialogButtonBox *m_bottomButtonBox;
QLabel *m_messageLabel;
QSpinBox *m_pageNumberSpinbox;
......
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