Skip to content

Commit

Permalink
Extend the reserved keywords for Qt projects with the following words:
Browse files Browse the repository at this point in the history
 - signals (builtin Qt macro)
 - slots (builtin Qt macro)
 - NULL
 - valid (generated classes has an isValid method)
 - set (generated classes has an isSet method)

Fixes OpenAPITools#17487
  • Loading branch information
martonmiklos committed Jan 25, 2024
1 parent a5d3fb4 commit 5db2be0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public AbstractCppCodegen() {
"noexcept",
"not",
"not_eq",
"NULL",
"nullptr",
"operator",
"or",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public CppQtAbstractCodegen() {
systemIncludes.add("QDate");
systemIncludes.add("QDateTime");
systemIncludes.add("QByteArray");

reservedWords.add("signals");
reservedWords.add("slots");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public CppQtClientCodegen() {
typeMapping.put("AnyType", "QJsonValue");
importMapping.put(PREFIX + "HttpFileElement", "#include \"" + PREFIX + "HttpFileElement.h\"");
importMapping.put("QJsonValue", "#include <QJsonValue>");

reservedWords.add("valid");
reservedWords.add("set");
}

@Override
Expand Down

0 comments on commit 5db2be0

Please sign in to comment.