From fbad8e7701708c07bfbae73e6c3158fd9e560ee7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 5 Feb 2019 13:16:25 +0100 Subject: Fix deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: qsvgiconengine.cpp: In member function ‘virtual QPixmap QSvgIconEngine::pixmap(const QSize&, QIcon::Mode, QIcon::State)’: qsvgiconengine.cpp:200:38: warning: ‘static bool QPixmapCache::find(const QString&, QPixmap&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] tst_qsvgrenderer.cpp:479:54: warning: ‘const QMatrix& QPainter::worldMatrix() const’ is deprecated: Use worldTransform() instead [-Wdeprecated-declarations] ... glwidget.cpp: In member function ‘void GLWidget::draw()’: glwidget.cpp:231:41: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] glwidget.cpp:232:41: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] fluidlauncher.cpp:71:65: warning: ‘const QRect QDesktopWidget::screenGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] Change-Id: Iae20d950c3118d05f91202c8020dbd81fa73b48f Reviewed-by: Eirik Aavitsland --- examples/svg/embedded/fluidlauncher/fluidlauncher.cpp | 4 ++-- examples/svg/opengl/framebufferobject/glwidget.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp b/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp index 23d569d..ae36595 100644 --- a/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp +++ b/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp @@ -48,11 +48,11 @@ ** ****************************************************************************/ +#include #include #include "fluidlauncher.h" - #define DEFAULT_INPUT_TIMEOUT 10000 #define SIZING_FACTOR_HEIGHT 6/10 #define SIZING_FACTOR_WIDTH 6/10 @@ -68,7 +68,7 @@ FluidLauncher::FluidLauncher(QStringList* args) setCurrentWidget(pictureFlowWidget); pictureFlowWidget->setFocus(); - QRect screen_size = QApplication::desktop()->screenGeometry(); + QRect screen_size = QGuiApplication::primaryScreen()->geometry(); QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(launchApplication(int))); QObject::connect(pictureFlowWidget, SIGNAL(inputReceived()), this, SLOT(resetInputTimeout())); diff --git a/examples/svg/opengl/framebufferobject/glwidget.cpp b/examples/svg/opengl/framebufferobject/glwidget.cpp index a3c0d51..38ee5db 100644 --- a/examples/svg/opengl/framebufferobject/glwidget.cpp +++ b/examples/svg/opengl/framebufferobject/glwidget.cpp @@ -228,8 +228,8 @@ void GLWidget::draw() const QString str1(tr("A simple OpenGL framebuffer object example.")); const QString str2(tr("Use the mouse wheel to zoom, press buttons and move mouse to rotate, double-click to flip.")); QFontMetrics fm(p.font()); - p.drawText(width()/2 - fm.width(str1)/2, 20, str1); - p.drawText(width()/2 - fm.width(str2)/2, 20 + fm.lineSpacing(), str2); + p.drawText(width()/2 - fm.horizontalAdvance(str1)/2, 20, str1); + p.drawText(width()/2 - fm.horizontalAdvance(str2)/2, 20 + fm.lineSpacing(), str2); } void GLWidget::mousePressEvent(QMouseEvent *e) -- cgit v1.2.1