summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/utils
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-27 10:43:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-27 10:44:29 +0200
commitd78542919276ee6a87bfd75b83276dd72b791aaa (patch)
tree5bd2cedd077678e814a57c3454e68a8bbc75cb51 /src/datavisualization/utils
parent215833472171b17db506d49646c639b4fff926ab (diff)
Fix deprecation warnings about QString::sprintf()
Fix warnings: utils/utils.cpp:268:55: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations] utils/utils.cpp:270:56: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations] utils/utils.cpp:272:47: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations] Change-Id: I27628b7a3d7daa75399ef4952efe373a65d8974e Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/datavisualization/utils')
-rw-r--r--src/datavisualization/utils/utils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp
index d5850d86..e80058db 100644
--- a/src/datavisualization/utils/utils.cpp
+++ b/src/datavisualization/utils/utils.cpp
@@ -265,11 +265,11 @@ QString Utils::formatLabelSprintf(const QByteArray &format, Utils::ParamType par
{
switch (paramType) {
case ParamTypeInt:
- return QString().sprintf(format, (qint64)value);
+ return QString::asprintf(format.constData(), qint64(value));
case ParamTypeUInt:
- return QString().sprintf(format, (quint64)value);
+ return QString::asprintf(format.constData(), quint64(value));
case ParamTypeReal:
- return QString().sprintf(format, value);
+ return QString::asprintf(format.constData(), value);
default:
// Return format string to detect errors. Bars selection label logic also depends on this.
return QString::fromUtf8(format);