summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpphoverhandler.cpp
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2010-07-14 17:31:50 +0200
committerLeandro Melo <leandro.melo@nokia.com>2010-07-20 12:59:25 +0200
commitb25a4a6349ee5645eca32123f9263fdcbf6b4823 (patch)
tree330f09f2cbdb46d29d45c5e4045717a590661e79 /src/plugins/cppeditor/cpphoverhandler.cpp
parent893e647306ab121567553d5fe1adbbdae041aed7 (diff)
downloadqt-creator-b25a4a6349ee5645eca32123f9263fdcbf6b4823.tar.gz
C++ tooltip: Changes in formatting extracted html.
Diffstat (limited to 'src/plugins/cppeditor/cpphoverhandler.cpp')
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 5e46c19c9e..61d3f7a3f7 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -70,20 +70,15 @@ namespace {
return name.right(name.length() - index - 1);
}
- void moveCursorToEndOfQualifiedName(QTextCursor *tc) {
+ void moveCursorToEndOfName(QTextCursor *tc) {
QTextDocument *doc = tc->document();
if (!doc)
return;
- while (true) {
- const QChar &ch = doc->characterAt(tc->position());
- if (ch.isLetterOrNumber() || ch == QLatin1Char('_'))
- tc->movePosition(QTextCursor::NextCharacter);
- else if (ch == QLatin1Char(':') &&
- doc->characterAt(tc->position() + 1) == QLatin1Char(':'))
- tc->movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, 2);
- else
- break;
+ QChar ch = doc->characterAt(tc->position());
+ while (ch.isLetterOrNumber() || ch == QLatin1Char('_')) {
+ tc->movePosition(QTextCursor::NextCharacter);
+ ch = doc->characterAt(tc->position());
}
}
}
@@ -211,7 +206,7 @@ void CppHoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos)
QTextCursor tc(baseEditor->document());
tc.setPosition(pos);
- moveCursorToEndOfQualifiedName(&tc);
+ moveCursorToEndOfName(&tc);
// Fetch the expression's code
ExpressionUnderCursor expressionUnderCursor;