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
7df92d25
Commit
7df92d25
authored
Sep 01, 2015
by
tanelipe
Browse files
Updated the README to include actual printing example
parent
3099dbf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
7df92d25
...
...
@@ -25,3 +25,16 @@ QQuickItem *root = ...
QmlPrinter printer;
printer.printPDF("C:\\Users\\Public\\Documents\\Report.pdf", root, true);
```
Printing to actual printer
```
// Get the root view object
QQuickItem *root = ...
// Get list of available printer names for the computer
QStringList names = QPrinterInfo::availablePrinterNames();
// Let the user select one
QPrinterInfo info = QPrinterInfo::printerInfo(selectedPrinterName);
// Check that the printer is valid and usable (see QPrinterInfo documents for more information)
QmlPrinter printer;
printer.print(info, qobject_cast<QQuickItem*>(root));
```
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