Commit 90536997 authored by Alexander Volkov's avatar Alexander Volkov
Browse files

Auto set print orientation

It's rather inconvenient to always set it manually
to Landscape for landscape pictures.
parent 1cdb8fa5
......@@ -117,7 +117,10 @@ void PrintHelper::print(Document::Ptr doc)
QPrinter printer;
auto *optionsPage = new PrintOptionsPage(doc->size());
const auto docSize = doc->size();
printer.setPageOrientation(docSize.width() > docSize.height() ? QPageLayout::Landscape
: QPageLayout::Portrait);
auto *optionsPage = new PrintOptionsPage(docSize);
DialogGuard<QPrintDialog> dialog(&printer, d->mParent);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment