diff --git a/projectmanagers/cmake/cmakecodecompletionmodel.cpp b/projectmanagers/cmake/cmakecodecompletionmodel.cpp --- a/projectmanagers/cmake/cmakecodecompletionmodel.cpp +++ b/projectmanagers/cmake/cmakecodecompletionmodel.cpp @@ -62,9 +62,10 @@ QString escapePath(QString path) { - static const QChar toBeEscaped[] = {'(', ')'}; - for(const QChar &ch : toBeEscaped) - { + // see https://cmake.org/Wiki/CMake/Language_Syntax#Escapes + static const QString toBeEscaped = QStringLiteral("\"()#$^"); + + for(const QChar &ch : toBeEscaped) { path.replace(ch, "\\" + ch); } return path;