Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Winkelmann
QmlSlidePrinter
Commits
4d9ddcfb
Commit
4d9ddcfb
authored
Nov 20, 2018
by
Michael Winkelmann
Browse files
QML printer fix
parent
3c5f8fc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
qmlprinter.cpp
View file @
4d9ddcfb
...
...
@@ -37,7 +37,7 @@ bool QmlPrinter::printPdf(const QString &location, QQuickItem *rootItem) {
printer
.
setOutputFileName
(
location
);
printer
.
setFullPage
(
true
);
printer
.
setPageLayout
(
QPageLayout
(
QPageSize
(
QSize
(
height
,
width
)),
QPageLayout
::
Portrait
,
QPageLayout
::
Landscape
,
QMarginsF
(
0
,
0
,
0
,
0
),
QPageLayout
::
Pica
));
printer
.
setResolution
(
resolution
());
...
...
@@ -46,13 +46,13 @@ bool QmlPrinter::printPdf(const QString &location, QQuickItem *rootItem) {
// effect after newPage is called (painter.begin() calls this method)
changePrinterOrientation
(
printer
,
width
,
height
);
//
SubItemStrategy strategy;
SubItemStrategy
strategy
;
/*
PrintStrategy strategy = [](QQuickItem* root, ItemList& items, ItemList& masterItems) {
items.push_back({ root, QVariantMap() });
return true;
};
*/
return
printItems
(
printer
,
rootItem
,
strategy
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment