From 4e6bec003366d52ae967d1e2dc91f6fc1f313823 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Sep 2012 12:49:24 +0200 Subject: [PATCH] debugger: show newlines in QStrings also in tooltips Not necessarily needed, but more consistent. Task-number: QTCREATORBUG-7278 Change-Id: I6c72b90fa18514aecccee9aa2de3ee626e681b60 Reviewed-by: hjk --- src/plugins/debugger/watchdata.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index 7fe10e58397..6fd7dd972ab 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -350,8 +350,10 @@ QString WatchData::toString() const static void formatToolTipRow(QTextStream &str, const QString &category, const QString &value) { + QString val = Qt::escape(value); + val.replace(QLatin1Char('\n'), QLatin1String("
")); str << "" << category << " : " - << Qt::escape(value) << ""; + << val << ""; } QString WatchData::toToolTip() const @@ -366,7 +368,7 @@ QString WatchData::toToolTip() const formatToolTipRow(str, tr("Internal Type"), QLatin1String(type)); formatToolTipRow(str, tr("Displayed Type"), displayedType); QString val = value; - if (value.size() > 1000) { + if (val.size() > 1000) { val.truncate(1000); val += tr(" ... "); }