Tokenizer: Skip qt simplification if qt library is not loaded

This commit is contained in:
Daniel Marjamäki 2022-09-08 07:47:58 +02:00
parent b99474fe13
commit 2e8d855b35
1 changed files with 2 additions and 0 deletions

View File

@ -9076,6 +9076,8 @@ void Tokenizer::simplifyQtSignalsSlots()
{
if (isC())
return;
if (std::none_of(mSettings->libraries.cbegin(), mSettings->libraries.cend(), [](const std::string& lib) { return lib == "qt";}))
return;
for (Token *tok = list.front(); tok; tok = tok->next()) {
// check for emit which can be outside of class
if (Token::Match(tok, "emit|Q_EMIT %name% (") &&