summaryrefslogtreecommitdiffstats
path: root/tests/manual/dialogs/printdialogpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/dialogs/printdialogpanel.cpp')
-rw-r--r--tests/manual/dialogs/printdialogpanel.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp
index d999dbc30c..8d64d2f6a6 100644
--- a/tests/manual/dialogs/printdialogpanel.cpp
+++ b/tests/manual/dialogs/printdialogpanel.cpp
@@ -55,6 +55,10 @@
#include <QTextStream>
#include <QDir>
+#if QT_VERSION >= 0x050000
+# include <QScreen>
+#endif
+
const FlagData printerModeComboData[] =
{
{"ScreenResolution", QPrinter::ScreenResolution},
@@ -705,7 +709,13 @@ void PrintDialogPanel::showPreviewDialog()
{
applySettings(m_printer.data());
PrintPreviewDialog dialog(m_printer.data(), this);
- dialog.resize(QApplication::desktop()->availableGeometry().size() * 4/ 5);
+#if QT_VERSION >= 0x050000
+ const int screenNumber = QApplication::desktop()->screenNumber(this);
+ const QSize availableSize = QGuiApplication::screens().at(screenNumber)->availableSize();
+#else
+ const QSize availableSize = QApplication::desktop()->availableGeometry().size();
+#endif
+ dialog.resize(availableSize * 4/ 5);
if (dialog.exec() == QDialog::Accepted)
retrieveSettings(m_printer.data());
}