Introduce and use Utils::stripAccelerator

Change-Id: I8c37728ca5de20e2b68e6d0ac7fc120baa696040
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2017-07-07 14:05:06 +03:00
committed by Orgad Shaneh
parent 510a00ea35
commit c841dc551c
8 changed files with 55 additions and 18 deletions

View File

@@ -238,4 +238,12 @@ QTCREATOR_UTILS_EXPORT QString expandMacros(const QString &str, AbstractMacroExp
return ret;
}
QTCREATOR_UTILS_EXPORT QString stripAccelerator(const QString &text)
{
QString res = text;
for (int index = res.indexOf('&'); index != -1; index = res.indexOf('&', index + 1))
res.remove(index, 1);
return res;
}
} // namespace Utils