From 4d88d79aa507777bce40740b21747f656efc074d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 2 Aug 2017 11:39:01 +0200 Subject: Update usage of QFontMetrics::width() to new API QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll --- src/plugins/platforms/cocoa/qcocoadrag.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qcocoadrag.mm') diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 3bd0b05725..e1f36b47a1 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -188,7 +188,7 @@ QPixmap QCocoaDrag::dragPixmap(QDrag *drag, QPoint &hotSpot) const if (s.length() > dragImageMaxChars) s = s.left(dragImageMaxChars -3) + QChar(0x2026); if (!s.isEmpty()) { - const int width = fm.width(s); + const int width = fm.horizontalAdvance(s); const int height = fm.height(); if (width > 0 && height > 0) { qreal dpr = 1.0; -- cgit v1.2.3