summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/qprintengine_pdf.cpp11
-rw-r--r--src/printsupport/kernel/qprinter.cpp8
-rw-r--r--src/printsupport/kernel/qprinter.h2
3 files changed, 6 insertions, 15 deletions
diff --git a/src/printsupport/kernel/qprintengine_pdf.cpp b/src/printsupport/kernel/qprintengine_pdf.cpp
index d62da0e1d6..a2ab68a96d 100644
--- a/src/printsupport/kernel/qprintengine_pdf.cpp
+++ b/src/printsupport/kernel/qprintengine_pdf.cpp
@@ -136,8 +136,6 @@ void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
// The following keys are settings that are unsupported by the PDF PrintEngine
case PPK_CustomBase:
break;
- case PPK_WindowsPageSize:
- break;
// The following keys are properties and settings that are supported by the PDF PrintEngine
case PPK_CollateCopies:
@@ -188,6 +186,9 @@ void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
}
break;
}
+ case PPK_WindowsPageSize:
+ d->m_pageLayout.setPageSize(QPageSize(QPageSize::id(value.toInt())));
+ break;
case PPK_PaperSource:
d->paperSource = QPrinter::PaperSource(value.toInt());
break;
@@ -254,9 +255,6 @@ QVariant QPdfPrintEngine::property(PrintEnginePropertyKey key) const
case PPK_CustomBase:
// Special case, leave null
break;
- case PPK_WindowsPageSize:
- // Special case, leave null
- break;
// The following keys are properties and settings that are supported by the PDF PrintEngine
case PPK_CollateCopies:
@@ -298,6 +296,9 @@ QVariant QPdfPrintEngine::property(PrintEnginePropertyKey key) const
case PPK_PaperName:
ret = d->m_pageLayout.pageSize().name();
break;
+ case PPK_WindowsPageSize:
+ ret = d->m_pageLayout.pageSize().windowsId();
+ break;
case PPK_PaperSource:
ret = d->paperSource;
break;
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index f72a0ae0fb..65dcf515b7 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -1882,16 +1882,12 @@ QPrintEngine *QPrinter::printEngine() const
return d->printEngine;
}
-#if defined (Q_OS_WIN)
/*!
\obsolete Use QPageSize::id(windowsId) and setPageLayout(QPageSize) instead.
Sets the page size to be used by the printer under Windows to \a
pageSize.
- \warning This function is not portable so you may prefer to use
- setPaperSize() instead.
-
\sa pageLayout()
*/
void QPrinter::setWinPageSize(int pageSize)
@@ -1906,9 +1902,6 @@ void QPrinter::setWinPageSize(int pageSize)
Returns the page size used by the printer under Windows.
- \warning This function is not portable so you may prefer to use
- paperSize() instead.
-
\sa pageLayout()
*/
int QPrinter::winPageSize() const
@@ -1916,7 +1909,6 @@ int QPrinter::winPageSize() const
Q_D(const QPrinter);
return d->printEngine->property(QPrintEngine::PPK_WindowsPageSize).toInt();
}
-#endif // Q_OS_WIN
/*!
Returns a list of the resolutions (a list of dots-per-inch
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index 709d77d4e3..1f0639d81f 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -372,10 +372,8 @@ public:
void setDoubleSidedPrinting(bool enable);
bool doubleSidedPrinting() const;
-#ifdef Q_OS_WIN
void setWinPageSize(int winPageSize);
int winPageSize() const;
-#endif
QRect paperRect() const;
QRect pageRect() const;