From 432955347ca85f1505352bdd2f234aa27d4d5e9e Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Mon, 17 Oct 2011 15:10:16 +0200 Subject: [PATCH] Debugger: Tooltip in Stack Window Show only those fields in tooltip that have proper values. Task-number: QTCREATORBUG-6336 Change-Id: I6fdc5fcae8c36e0115fb9268531f5bb16ce48fe0 Reviewed-by: Kai Koehne Reviewed-by: hjk --- src/plugins/debugger/stackframe.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp index fd5043b9aa..3c348ada03 100644 --- a/src/plugins/debugger/stackframe.cpp +++ b/src/plugins/debugger/stackframe.cpp @@ -88,18 +88,25 @@ QString StackFrame::toToolTip() const const QString filePath = QDir::toNativeSeparators(file); QString res; QTextStream str(&res); - str << "" - << ""; + if (!function.isEmpty()) + str << ""; + if (!file.isEmpty()) + str << ""; + if (line != -1) + str << ""; + if (!from.isEmpty()) + str << ""; + if (!to.isEmpty()) + str << ""; + str << "
" << tr("Address:") << "0x"; - str.setIntegerBase(16); - str << address; + str << ""; + if (address) { + str << "" - << "" - << "" - << "" - << "" - << "" - << "
" << tr("Address:") << "0x"; + str.setIntegerBase(16); + str << address; + } str.setIntegerBase(10); - str << "
" << tr("Function:") << "" << function << "
" << tr("File:") << "" << filePath << "
" << tr("Line:") << "" << line << "
" << tr("From:") << "" << from << "
" << tr("To:") << "" << to << "
"; + str << "
" << tr("Function:") << "" << function << "
" << tr("File:") << "" << filePath << "
" << tr("Line:") << "" << line << "
" << tr("From:") << "" << from << "
" << tr("To:") << "" << to << "
"; return res; } -- 2.11.0