vcl/qt5/Qt5System.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
New commits: commit 8248d4cd6021614461ae79adcd447d4c35e9fa96 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Sep 24 08:18:12 2021 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Sep 24 13:58:34 2021 +0200 qt5: Replace use of deprecated QDesktopWidget in Qt5System Change-Id: Id6ba8dfcf2f966f0e2e224990dec0309cd4d27d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122551 Tested-by: Michael Weghorn <m.wegh...@posteo.de> Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index d769f7118ea5..e787ea0cab2b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,26 +7,18 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <QtWidgets/QApplication> -#include <QtWidgets/QDesktopWidget> +#include <QtGui/QGuiApplication> +#include <QtGui/QScreen> -#include <string.h> #include <tools/gen.hxx> #include <Qt5System.hxx> #include <Qt5Tools.hxx> -unsigned int Qt5System::GetDisplayScreenCount() -{ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - return QApplication::desktop()->screenCount(); - SAL_WNODEPRECATED_DECLARATIONS_POP -} +unsigned int Qt5System::GetDisplayScreenCount() { return QGuiApplication::screens().size(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - QRect qRect = QApplication::desktop()->screenGeometry(nScreen); - SAL_WNODEPRECATED_DECLARATIONS_POP + QRect qRect = QGuiApplication::screens().at(nScreen)->geometry(); return toRectangle(scaledQRect(qRect, qApp->devicePixelRatio())); }