diff options
author | John Layt <jlayt@kde.org> | 2014-01-20 13:21:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-05 19:34:10 +0100 |
commit | 75aef26c278dc21bb3fc5bc7faa06e95666aeb76 (patch) | |
tree | 61cb02570163b404b0088c17ff8e2c9f9f97e2ca /tests/manual/dialogs/printdialogpanel.cpp | |
parent | 5af95d077bc7bcb1633d81686d324d167746040b (diff) |
QPageSetupDialog - Add manual dialog test
Add QPageSetupDialog to the manual dialog test.
Change-Id: I5a7a4fedf1fe3ba074891eaed84efaa1c173e620
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/manual/dialogs/printdialogpanel.cpp')
-rw-r--r-- | tests/manual/dialogs/printdialogpanel.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp index bede2b657a..256ffe09ee 100644 --- a/tests/manual/dialogs/printdialogpanel.cpp +++ b/tests/manual/dialogs/printdialogpanel.cpp @@ -47,6 +47,7 @@ #include <QPrinter> #include <QPrintDialog> #include <QPrintPreviewDialog> +#include <QPageSetupDialog> #include <QApplication> #include <QDesktopWidget> #include <QGroupBox> @@ -335,6 +336,9 @@ PrintDialogPanel::PrintDialogPanel(QWidget *parent) button = new QPushButton(tr("Preview..."), m_dialogsGroupBox); connect(button, SIGNAL(clicked()), this, SLOT(showPreviewDialog())); vBoxLayout->addWidget(button); + button = new QPushButton(tr("Page Setup..."), m_dialogsGroupBox); + connect(button, SIGNAL(clicked()), this, SLOT(showPageSetupDialog())); + vBoxLayout->addWidget(button); QGridLayout *gridLayout = new QGridLayout(this); gridLayout->addWidget(m_creationGroupBox, 0, 0); @@ -417,6 +421,14 @@ void PrintDialogPanel::showPreviewDialog() retrieveSettings(m_printer.data()); } +void PrintDialogPanel::showPageSetupDialog() +{ + applySettings(m_printer.data()); + QPageSetupDialog dialog(m_printer.data(), this); + if (dialog.exec() == QDialog::Accepted) + retrieveSettings(m_printer.data()); +} + #include "printdialogpanel.moc" #endif // !QT_NO_PRINTER |