summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-05 13:16:25 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-05 12:51:28 +0000
commitfbad8e7701708c07bfbae73e6c3158fd9e560ee7 (patch)
treecc66b1c35fd0342578302c25012e9e8794a88258 /examples
parentf9d909ceefe6fd693c42ddf3d898ae5c6c7f7f19 (diff)
downloadqtsvg-fbad8e7701708c07bfbae73e6c3158fd9e560ee7.tar.gz
Fix deprecation warningsv5.13.0-alpha1
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 <eirik.aavitsland@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/svg/embedded/fluidlauncher/fluidlauncher.cpp4
-rw-r--r--examples/svg/opengl/framebufferobject/glwidget.cpp4
2 files changed, 4 insertions, 4 deletions
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 <QScreen>
#include <QXmlStreamReader>
#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)