diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 1fb4418d34d..6df472afa52 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -753,7 +753,7 @@ QString decodeData(const QString &ba, const QString &encoding) if (enc.quotes) { const QChar doubleQuote('"'); - result = QString("%1 (%2)").arg(doubleQuote + result + doubleQuote).arg(result.size()); + result = doubleQuote + result + doubleQuote; } return result; } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 42f2d8f54d0..eef0ba5a3ba 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -942,7 +942,10 @@ static QString displayName(const WatchItem *item) void WatchItem::updateValueCache() const { - valueCache = truncateValue(formattedValue(this)); + QString formatted = truncateValue(formattedValue(this)); + if (formatted.endsWith('"')) + formatted.append(QString(" (%1)").arg(this->value.length() - 2)); + valueCache = formatted; valueCache = watchModel(this)->removeNamespaces(valueCache); if (valueCache.isEmpty() && this->address) valueCache += QString::fromLatin1("@0x" + QByteArray::number(this->address, 16));