1From 604761d49aa1d93ef5cc6d13259dc53dce7f04c4 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Tue, 16 Jul 2019 17:52:04 -0700 4Subject: [PATCH] examples/plugins: Replace obsolete screenGeometry 5 6Fixes errors like 7helloworldinputmethod.cpp:93:55: error: 'screenGeometry' is deprecated: Use QGuiApplication::screens() [-Werror,-Wdeprecated-declarations] 8 const QSize screenSize = QApplication::desktop()->screenGeometry().size(); 9 10Upstream-Status: Pending 11 12Signed-off-by: Khem Raj <raj.khem@gmail.com> 13--- 14 examples/plugins/cxx/helloworld/helloworldinputmethod.cpp | 5 +++-- 15 examples/plugins/cxx/override/overrideinputmethod.cpp | 5 +++-- 16 2 files changed, 6 insertions(+), 4 deletions(-) 17 18diff --git a/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp b/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp 19index eb470a1f..e5e5911d 100644 20--- a/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp 21+++ b/examples/plugins/cxx/helloworld/helloworldinputmethod.cpp 22@@ -18,7 +18,7 @@ 23 24 #include <QDebug> 25 #include <QApplication> 26-#include <QDesktopWidget> 27+#include <QScreen> 28 29 namespace { 30 31@@ -90,7 +90,8 @@ void HelloWorldInputMethod::show() 32 } 33 34 // Set size of our container to screen size 35- const QSize screenSize = QApplication::desktop()->screenGeometry().size(); 36+ QScreen *screen = QApplication::primaryScreen(); 37+ const QSize screenSize = screen->availableSize(); 38 mainWidget->parentWidget()->resize(screenSize); 39 40 // Set size of the input method 41diff --git a/examples/plugins/cxx/override/overrideinputmethod.cpp b/examples/plugins/cxx/override/overrideinputmethod.cpp 42index c00160e4..f2f30e1d 100644 43--- a/examples/plugins/cxx/override/overrideinputmethod.cpp 44+++ b/examples/plugins/cxx/override/overrideinputmethod.cpp 45@@ -18,7 +18,7 @@ 46 47 #include <QDebug> 48 #include <QApplication> 49-#include <QDesktopWidget> 50+#include <QScreen> 51 #include <QKeyEvent> 52 53 namespace { 54@@ -82,7 +82,8 @@ void OverrideInputMethod::show() 55 } 56 57 // Set size of the input method 58- const QSize &screenSize = QApplication::desktop()->screenGeometry().size(); 59+ QScreen *screen = QApplication::primaryScreen(); 60+ const QSize screenSize = screen->availableSize(); 61 const QSize size(screenSize.width() - 200, 200); 62 63 surface->setGeometry(QRect(QPoint((screenSize.width() - size.width()) / 2, 64-- 652.22.0 66 67