Fix Qt deprecation warnings. QPrinter::orientation() and QPrinter::setOrientation() are obsolete.

This commit is contained in:
Mateusz Skowroński
2021-01-03 10:52:06 +01:00
committed by wwmayer
parent a9945500d8
commit 5b4e76b834
6 changed files with 80 additions and 1 deletions

View File

@@ -461,7 +461,11 @@ void GraphvizView::print()
{
QPrinter printer(QPrinter::HighResolution);
printer.setFullPage(true);
#if QT_VERSION >= 0x050300
printer.setPageOrientation(QPageLayout::Landscape);
#else
printer.setOrientation(QPrinter::Landscape);
#endif
QPrintDialog dlg(&printer, this);
if (dlg.exec() == QDialog::Accepted) {
print(&printer);
@@ -491,7 +495,11 @@ void GraphvizView::printPreview()
{
QPrinter printer(QPrinter::HighResolution);
printer.setFullPage(true);
#if QT_VERSION >= 0x050300
printer.setPageOrientation(QPageLayout::Landscape);
#else
printer.setOrientation(QPrinter::Landscape);
#endif
QPrintPreviewDialog dlg(&printer, this);
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),