diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-27 17:23:59 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-28 08:11:48 +0000 |
commit | a49175aa2972f6d29896ccca729f518df0207899 (patch) | |
tree | ba9e26f30c8fbce57a3336005db306ceebc9f002 /src/libs | |
parent | b7280d4986aec91be27d7c671ad635233ecf9b76 (diff) | |
download | qt-creator-a49175aa2972f6d29896ccca729f518df0207899.tar.gz |
Fix some deprecation warnings about String::sprintf() and qVariantFromValue()
stylehelper.cpp:216:46: warning: 'QString& QString::sprintf(const char*, ...)' is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
...
baseenginedebugclient.cpp:124:49: warning: 'QVariant qVariantFromValue(const T&) [with T = QmlDebug::ObjectReference]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations]
...
Change-Id: Iafdb58b8a66f1b0a14342fa5b29e31fc4997a621
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/utils/stylehelper.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index e44037f5a1..388da7eeba 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -209,9 +209,9 @@ static void verticalGradientHelper(QPainter *p, const QRect &spanRect, const QRe void StyleHelper::verticalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect, bool lightColored) { if (StyleHelper::usePixmapCache()) { - QString key; + QColor keyColor = baseColor(lightColored); - key.sprintf("mh_vertical %d %d %d %d %d", + const QString key = QString::asprintf("mh_vertical %d %d %d %d %d", spanRect.width(), spanRect.height(), clipRect.width(), clipRect.height(), keyColor.rgb()); @@ -267,9 +267,9 @@ QRect &rect, bool lightColored) void StyleHelper::horizontalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect, bool lightColored) { if (StyleHelper::usePixmapCache()) { - QString key; + QColor keyColor = baseColor(lightColored); - key.sprintf("mh_horizontal %d %d %d %d %d %d", + const QString key = QString::asprintf("mh_horizontal %d %d %d %d %d %d", spanRect.width(), spanRect.height(), clipRect.width(), clipRect.height(), keyColor.rgb(), spanRect.x()); @@ -309,8 +309,7 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter, QRect r = option->rect; int size = qMin(r.height(), r.width()); QPixmap pixmap; - QString pixmapName; - pixmapName.sprintf("StyleHelper::drawArrow-%d-%d-%d-%f", + const QString pixmapName = QString::asprintf("StyleHelper::drawArrow-%d-%d-%d-%f", element, size, enabled, devicePixelRatio); if (!QPixmapCache::find(pixmapName, &pixmap)) { QImage image(size * devicePixelRatio, size * devicePixelRatio, QImage::Format_ARGB32_Premultiplied); @@ -351,8 +350,7 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter, void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) { if (StyleHelper::usePixmapCache()) { - QString key; - key.sprintf("mh_menu %d %d %d %d %d", + const QString key = QString::asprintf("mh_menu %d %d %d %d %d", spanRect.width(), spanRect.height(), clipRect.width(), clipRect.height(), StyleHelper::baseColor().rgb()); |