diff --git a/tools/bluezapi2qt/CppGenerator.cpp b/tools/bluezapi2qt/CppGenerator.cpp --- a/tools/bluezapi2qt/CppGenerator.cpp +++ b/tools/bluezapi2qt/CppGenerator.cpp @@ -208,7 +208,7 @@ const QRegularExpression rx(QStringLiteral("^([A-Z]+)")); QRegularExpressionMatch match = rx.match(string); if (match.hasMatch()) { - QString matchedStr = match.captured(); + QString matchedStr = match.captured(1); for (int i = 0; i < matchedStr.size() - 1; ++i) { str.replace(i, 1, str.at(i).toLower()); } diff --git a/tools/bluezapi2qt/Interface.cpp b/tools/bluezapi2qt/Interface.cpp --- a/tools/bluezapi2qt/Interface.cpp +++ b/tools/bluezapi2qt/Interface.cpp @@ -114,25 +114,25 @@ const QRegularExpression rx(QStringLiteral("Service\\t+(.+)")); QRegularExpressionMatch match = rx.match(line); if (match.hasMatch()) { - m_service = match.captured(); + m_service = match.captured(1); } } void Interface::parseInterface(const QString &line) { const QRegularExpression rx(QStringLiteral("Interface\\t+(.+)")); QRegularExpressionMatch match = rx.match(line); if (match.hasMatch()) { - m_name = match.captured(); + m_name = match.captured(1); } } void Interface::parseObjectPath(const QString &line) { const QRegularExpression rx(QStringLiteral("Object path\\t+(.+)")); QRegularExpressionMatch match = rx.match(line); if (match.hasMatch()) { - m_objectPath = match.captured(); + m_objectPath = match.captured(1); } } diff --git a/tools/bluezapi2qt/Method.cpp b/tools/bluezapi2qt/Method.cpp --- a/tools/bluezapi2qt/Method.cpp +++ b/tools/bluezapi2qt/Method.cpp @@ -95,5 +95,5 @@ return QStringLiteral("value"); } - return match.captured().toLower(); + return match.captured(1).toLower(); } diff --git a/tools/bluezapi2qt/Properties.cpp b/tools/bluezapi2qt/Properties.cpp --- a/tools/bluezapi2qt/Properties.cpp +++ b/tools/bluezapi2qt/Properties.cpp @@ -21,11 +21,11 @@ "(?:Properties|^)" // Properties keyword or start of line "\\t{1,2}" // preceding tabs (max 2) "([a-z1-6{}_]+)" // type name - " " // space + " " // space "([A-Z]\\w+)" // method name "(?: \\[(.*)\\])?" // tags "(?: \\((.*)\\))?" // limitations - ), QRegularExpression::CaseInsensitiveOption); + )); QRegularExpressionMatch match = rx.match(line); // Check if we match a property