summaryrefslogtreecommitdiffstats
path: root/tests/manual/dialogs/printdialogpanel.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-03-22 10:35:22 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-03-22 17:58:58 +0000
commit9732ecc321daab06026f4496a6724d6bdbc0941a (patch)
tree155a9c919da11ba808f9335b0ba00f5f7e3420a5 /tests/manual/dialogs/printdialogpanel.cpp
parent7a64ffb7738dc975b5008800901c8cd8ab238a0f (diff)
Manual dialog test: Fix deprecation warnings
filedialogpanel.cpp:441:55: warning: 'bool QFileDialog::confirmOverwrite() const' is deprecated: Use !testOption(DontConfirmOverwrite) instead [-Wdeprecated-declarations] filedialogpanel.cpp:443:53: warning: 'bool QFileDialog::resolveSymlinks() const' is deprecated: Use !testOption(DontResolveSymlinks) instead [-Wdeprecated-declarations] printdialogpanel.cpp:708:62: warning: 'const QRect QDesktopWidget::availableGeometry(int) const' is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] Change-Id: I087615b7e62b5fc11ec1063590fe55b2615f95fd Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
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());
}