summaryrefslogtreecommitdiffstats
path: root/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-01-12 18:02:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 13:46:17 +0100
commit9393f744d4a5f7e056a4bf2ae1af8c951a4c8f18 (patch)
tree03f85ebe1443fbb7e0dec314f87dc5c1222e15b6 /src/printsupport/dialogs/qpagesetupdialog_unix_p.h
parent1ffd79bfb7261268ea4b56d29122a48334a115a1 (diff)
QPageSetupDialog - Use QPageLayout and QPageSize
Convert the Linux / CUPS version of the QPageSetupDialog to use QPageSize and QPageLayout internally. As this is an almost complete re-write of the internals the liberty has been taken of doing renames and code moves that would normally be done in separate commits, but in this case would have been mostly pointless done separately. Change-Id: I6eaa7c1fbf0a04cb3425f1d322fcae89239e83b7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/printsupport/dialogs/qpagesetupdialog_unix_p.h')
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix_p.h48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
index 4245c3ae5f..2a359a8118 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
@@ -57,6 +57,10 @@
#ifndef QT_NO_PRINTDIALOG
+#include "qprinter.h"
+
+#include <QtGui/qpagelayout.h>
+
#include <ui_qpagesetupwidget.h>
QT_BEGIN_NAMESPACE
@@ -69,37 +73,37 @@ class QPageSetupWidget : public QWidget {
public:
explicit QPageSetupWidget(QWidget *parent = 0);
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
+
void setPrinter(QPrinter *printer);
- /// copy information from the widget and apply that to the printer.
+ void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
void setupPrinter() const;
- void selectPrinter();
- void selectPdfPsPrinter(const QPrinter *p);
private slots:
- void _q_pageOrientationChanged();
- void _q_paperSizeChanged();
- void _q_pagesPerSheetChanged();
- void unitChanged(int item);
- void setTopMargin(double newValue);
- void setBottomMargin(double newValue);
- void setLeftMargin(double newValue);
- void setRightMargin(double newValue);
+ void pageSizeChanged();
+ void pageOrientationChanged();
+ void pagesPerSheetChanged();
+ void unitChanged();
+ void topMarginChanged(double newValue);
+ void bottomMarginChanged(double newValue);
+ void leftMarginChanged(double newValue);
+ void rightMarginChanged(double newValue);
private:
- friend class QUnixPrintWidgetPrivate;
- Ui::QPageSetupWidget widget;
+ friend class QUnixPrintWidgetPrivate; // Needed by checkFields()
+
+ void updateWidget();
+ void initUnits();
+ void initPagesPerSheet();
+ void initPageSizes();
+
+ Ui::QPageSetupWidget m_ui;
QPagePreview *m_pagePreview;
QPrinter *m_printer;
- qreal m_leftMargin;
- qreal m_topMargin;
- qreal m_rightMargin;
- qreal m_bottomMargin;
- QSizeF m_paperSize; // In QPrinter::Point
- qreal m_currentMultiplier;
+ QPrinter::OutputFormat m_outputFormat;
+ QString m_printerName;
+ QPageLayout m_pageLayout;
+ QPageLayout::Unit m_units;
bool m_blockSignals;
- bool m_cups;
-
- void initPagesPerSheet();
};
QT_END_NAMESPACE