diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index c0e832fba998d62330078251ce709fc785357522..56e7f73f22330008d1ce4984c6c8fde613f8b9d5 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -1063,10 +1063,18 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi Overview overview; overview.setShowArgumentNames(true); - TextEditor::CompletionItem item(this); - item.text = overview(f->type()); - item.text = item.text.mid(1, item.text.size()-2); - m_completions.append(item); + // get rid of parentheses and cv-qualifiers + QString completion = overview(f->type()); + if (f->isVolatile() || f->isConst()) + completion = completion.mid(1, completion.lastIndexOf(')') - 1); + else + completion = completion.mid(1, completion.size() - 2); + + if (completion.size()) { + TextEditor::CompletionItem item(this); + item.text = completion; + m_completions.append(item); + } } return true; }