Changeset View
Changeset View
Standalone View
Standalone View
src/kpagedialog_p.h
Show All 17 Lines | |||||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef PAGED_KPAGEDIALOG_P_H | 20 | #ifndef PAGED_KPAGEDIALOG_P_H | ||
21 | #define PAGED_KPAGEDIALOG_P_H | 21 | #define PAGED_KPAGEDIALOG_P_H | ||
22 | 22 | | |||
23 | #include "kpagedialog.h" | 23 | #include "kpagedialog.h" | ||
24 | #include <QDialogButtonBox> | 24 | #include <QDialogButtonBox> | ||
25 | #include <QLayout> | 25 | #include <QLayout> | ||
26 | #include <QAbstractItemView> | ||||
26 | 27 | | |||
27 | class KPageDialogPrivate | 28 | class KPageDialogPrivate | ||
28 | { | 29 | { | ||
29 | Q_DECLARE_PUBLIC(KPageDialog) | 30 | Q_DECLARE_PUBLIC(KPageDialog) | ||
30 | protected: | 31 | protected: | ||
31 | KPageDialogPrivate(KPageDialog *parent) | 32 | KPageDialogPrivate(KPageDialog *parent) | ||
32 | : q_ptr(parent), | 33 | : q_ptr(parent), | ||
33 | mPageWidget(nullptr), | 34 | mPageWidget(nullptr), | ||
Show All 11 Lines | |||||
45 | 46 | | |||
46 | void init() | 47 | void init() | ||
47 | { | 48 | { | ||
48 | Q_Q(KPageDialog); | 49 | Q_Q(KPageDialog); | ||
49 | delete q->layout(); | 50 | delete q->layout(); | ||
50 | 51 | | |||
51 | QVBoxLayout *layout = new QVBoxLayout; | 52 | QVBoxLayout *layout = new QVBoxLayout; | ||
52 | q->setLayout(layout); | 53 | q->setLayout(layout); | ||
54 | layout->setContentsMargins(0, 0, 0, 0); | ||||
53 | 55 | | |||
54 | if (mPageWidget) { | 56 | if (mPageWidget) { | ||
55 | q->connect(mPageWidget, &KPageWidget::currentPageChanged, | 57 | q->connect(mPageWidget, &KPageWidget::currentPageChanged, | ||
56 | q, &KPageDialog::currentPageChanged); | 58 | q, &KPageDialog::currentPageChanged); | ||
57 | q->connect(mPageWidget, &KPageWidget::pageRemoved, | 59 | q->connect(mPageWidget, &KPageWidget::pageRemoved, | ||
58 | q, &KPageDialog::pageRemoved); | 60 | q, &KPageDialog::pageRemoved); | ||
59 | layout->addWidget(mPageWidget); | 61 | layout->addWidget(mPageWidget); | ||
60 | } else { | 62 | } else { | ||
61 | layout->addStretch(); | 63 | layout->addStretch(); | ||
62 | } | 64 | } | ||
63 | 65 | | |||
64 | if (mButtonBox) { | 66 | if (mButtonBox) { | ||
65 | q->connect(mButtonBox, &QDialogButtonBox::accepted, q, &QDialog::accept); | 67 | q->connect(mButtonBox, &QDialogButtonBox::accepted, q, &QDialog::accept); | ||
66 | q->connect(mButtonBox, &QDialogButtonBox::rejected, q, &QDialog::reject); | 68 | q->connect(mButtonBox, &QDialogButtonBox::rejected, q, &QDialog::reject); | ||
69 | if (mPageWidget) { | ||||
70 | mPageWidget->setPageFooter(mButtonBox); | ||||
71 | } else { | ||||
67 | layout->addWidget(mButtonBox); | 72 | layout->addWidget(mButtonBox); | ||
68 | } | 73 | } | ||
69 | } | 74 | } | ||
75 | } | ||||
70 | }; | 76 | }; | ||
71 | 77 | | |||
72 | #endif // PAGED_KPAGEDIALOG_P_H | 78 | #endif // PAGED_KPAGEDIALOG_P_H |