From 653757e78140ca463b9e5a4233b21558916d35ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 27 May 2009 17:02:35 +0200 Subject: Fixed HTML escaping issues in the function argument widget HTML escaping was moved out of the TypePrettyPrinter since it interferes with other logic there. Instead, the region to mark is now available from the Overview and used by the FunctionArgumentWidget to put the current argument in bold. --- src/plugins/cpptools/cppcodecompletion.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/plugins/cpptools/cppcodecompletion.cpp') diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index bc324f9451..384058685b 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -66,6 +66,7 @@ #include #include #include +#include // Qt::escape() using namespace CPlusPlus; @@ -382,13 +383,23 @@ bool FunctionArgumentWidget::eventFilter(QObject *obj, QEvent *e) void FunctionArgumentWidget::updateHintText() { Overview overview; - overview.setRichText(true); overview.setShowReturnTypes(true); overview.setShowArgumentNames(true); - overview.setMarkArgument(m_currentarg + 1); + overview.setMarkedArgument(m_currentarg + 1); Function *f = currentFunction(); - setText(overview(f->type(), f->name())); + const QString prettyMethod = overview(f->type(), f->name()); + const int begin = overview.markedArgumentBegin(); + const int end = overview.markedArgumentEnd(); + + QString hintText; + hintText += Qt::escape(prettyMethod.left(begin)); + hintText += ""; + hintText += Qt::escape(prettyMethod.mid(begin, end - begin)); + hintText += ""; + hintText += Qt::escape(prettyMethod.mid(end)); + setText(hintText); + m_numberLabel->setText(tr("%1 of %2").arg(m_current + 1).arg(m_items.size())); m_popupFrame->setFixedWidth(m_popupFrame->minimumSizeHint().width()); -- cgit v1.2.1