diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-23 12:09:25 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-12 19:39:49 +0000 |
commit | 08a8a6a842d0bd925ff31acfe2d47286ef393a83 (patch) | |
tree | 5f3e0f3c09a0118675b060257923bde13f0fe102 /tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp | |
parent | dee800e9e9f37a1d7c81dd1814550bb167b09832 (diff) |
QtWidgets: assorted migrations to QString::asprintf
Change-Id: I1a9977f52e9ce098944f876bca19669dac44d2c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp')
-rw-r--r-- | tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp index 065fc13ee8..dbfeda8104 100644 --- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp @@ -182,7 +182,6 @@ tst_QCompleter::~tst_QCompleter() void tst_QCompleter::setSourceModel(ModelType type) { - QString text; QTreeWidgetItem *parent, *child; treeWidget->clear(); switch(type) { @@ -192,11 +191,11 @@ void tst_QCompleter::setSourceModel(ModelType type) for (int i = 0; i < 2; i++) { for (int j = 0; j < 5; j++) { parent = new QTreeWidgetItem(treeWidget); - text.sprintf("%c%i", i == 0 ? 'P' : 'p', j); + const QString text = QString::asprintf("%c%i", i == 0 ? 'P' : 'p', j); parent->setText(completionColumn, text); for (int k = 0; k < 5; k++) { child = new QTreeWidgetItem(parent); - QString t = QString().sprintf("c%i", k) + text; + QString t = QString::asprintf("c%i", k) + text; child->setText(completionColumn, t); } } @@ -211,11 +210,11 @@ void tst_QCompleter::setSourceModel(ModelType type) for (int i = 0; i < 5; i++) { for (int j = 0; j < 2; j++) { parent = new QTreeWidgetItem(treeWidget); - text.sprintf("%c%i", j == 0 ? 'P' : 'p', i); + const QString text = QString::asprintf("%c%i", j == 0 ? 'P' : 'p', i); parent->setText(completionColumn, text); for (int k = 0; k < 5; k++) { child = new QTreeWidgetItem(parent); - QString t = QString().sprintf("c%i", k) + text; + QString t = QString::asprintf("c%i", k) + text; child->setText(completionColumn, t); } } |