diff options
author | John Layt <jlayt@kde.org> | 2014-03-24 11:51:05 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-25 00:00:23 +0100 |
commit | d48db922d4310bd001faa708d9cd39e5c17863fa (patch) | |
tree | d3e976a1f88818a97c6c53170c35ac173e225689 /tests/manual/dialogs/printdialogpanel.h | |
parent | dbb6b58abede12cf9f2fad3086dd59a9d46b7ee7 (diff) |
QPrintDialog - Add more options to manual test
Add all the available QPrinter options to the QPrintDialog manual test
to allow for testing presets.
Change-Id: Ia6394094fc9920da0d6c645793d51650404899d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/manual/dialogs/printdialogpanel.h')
-rw-r--r-- | tests/manual/dialogs/printdialogpanel.h | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/tests/manual/dialogs/printdialogpanel.h b/tests/manual/dialogs/printdialogpanel.h index a7ae257cf8..3932cd174f 100644 --- a/tests/manual/dialogs/printdialogpanel.h +++ b/tests/manual/dialogs/printdialogpanel.h @@ -46,6 +46,10 @@ #include "ui_printdialogpanel.h" +#if QT_VERSION >= 0x050300 +#include <QPageLayout> +#endif +#include <QPrinter> #include <QWidget> QT_BEGIN_NAMESPACE @@ -59,6 +63,31 @@ QT_END_NAMESPACE class PageSizeControl; class OptionsControl; +#if QT_VERSION < 0x050300 +// Copied from class QPageLayout introduced in Qt 5.3 +namespace QPageLayout +{ + enum Unit { + Millimeter, + Point, + Inch, + Pica, + Didot, + Cicero + }; + + enum Orientation { + Portrait, + Landscape + }; + + enum Mode { + StandardMode, // Paint Rect includes margins + FullPageMode // Paint Rect excludes margins + }; +} +#endif + class PrintDialogPanel : public QWidget { Q_OBJECT @@ -72,17 +101,30 @@ private slots: void showPrintDialog(); void showPreviewDialog(); void showPageSetupDialog(); - void enableCustomSizeControl(); + void unitsChanged(); + void pageSizeChanged(); + void pageDimensionsChanged(); + void orientationChanged(); + void marginsChanged(); + void layoutModeChanged(); + void printerChanged(); private: - QSizeF pageSize() const; - void setPageSize(const QSizeF &sizef); + QSizeF customPageSize() const; void applySettings(QPrinter *printer) const; void retrieveSettings(const QPrinter *printer); + void updatePageLayoutWidgets(); void enablePanels(); + bool m_blockSignals; Ui::PrintDialogPanel m_panel; +#if QT_VERSION >= 0x050300 + QPageLayout m_pageLayout; +#else + QPrinter m_printerLayout; + QPrinter::Unit m_units; +#endif QScopedPointer<QPrinter> m_printer; }; |