summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-01-23 12:07:18 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-02-12 19:39:54 +0000
commit09205f662e13cc9e636ec896c7ea8e1bf28a88aa (patch)
treefaf3e773835c036e094af3cef45335ea3b223a76 /tests
parent08a8a6a842d0bd925ff31acfe2d47286ef393a83 (diff)
QtGui: assorted migrations to QString::asprintf
Change-Id: Ibb177b22064efcad56ace60935e9c8759a87a3c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index e458fc1c80..dd903ab8a1 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -87,11 +87,7 @@ void tst_QPixmapCache::insert()
if (cacheType) {
QBENCHMARK {
for (int i = 0 ; i <= 10000 ; i++)
- {
- QString tmp;
- tmp.sprintf("my-key-%d", i);
- QPixmapCache::insert(tmp, p);
- }
+ QPixmapCache::insert(QString::asprintf("my-key-%d", i), p);
}
} else {
QBENCHMARK {
@@ -114,12 +110,8 @@ void tst_QPixmapCache::find()
QPixmap p;
if (cacheType) {
QBENCHMARK {
- QString tmp;
for (int i = 0 ; i <= 10000 ; i++)
- {
- tmp.sprintf("my-key-%d", i);
- QPixmapCache::find(tmp, p);
- }
+ QPixmapCache::find(QString::asprintf("my-key-%d", i), p);
}
} else {
QBENCHMARK {
@@ -165,18 +157,10 @@ void tst_QPixmapCache::styleUseCaseComplexKey()
if (cacheType) {
QBENCHMARK {
for (int i = 0 ; i <= 10000 ; i++)
- {
- QString tmp;
- tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200);
- QPixmapCache::insert(tmp, p);
- }
+ QPixmapCache::insert(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p);
for (int i = 0 ; i <= 10000 ; i++)
- {
- QString tmp;
- tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200);
- QPixmapCache::find(tmp, p);
- }
+ QPixmapCache::find(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p);
}
} else {
QHash<styleStruct, QPixmapCache::Key> hash;