[cpp-qt-client]Optimize generated code#23089
[cpp-qt-client]Optimize generated code#23089martonmiklos wants to merge 3 commits intoOpenAPITools:masterfrom
Conversation
32ecb3b to
88f4855
Compare
There was a problem hiding this comment.
2 issues found across 67 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache:61">
P2: qDeleteAll is used but <QtAlgorithms> isn’t included, which can cause compilation errors when the symbol isn’t provided transitively by other Qt headers.</violation>
<violation number="2" location="modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache:421">
P3: std::as_const requires <utility>; this file does not include it, so compilation can fail if transitive includes change. Add #include <utility>.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache
Show resolved
Hide resolved
- Use const references at function parameters - Do not perform useless initialization of QStrings - Use qDeleteAll
88f4855 to
427455e
Compare
|
thanks for the PR moving forward, please cc the technical committee for review @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @MartinDelille (2018/03) @muttleyxd (2019/08) @aminya (2025/05) |
There was a problem hiding this comment.
I'm fine with these changes, there is just this question about the change in the signal signature that was already address previously with a new signal. I tested the signature change here without issue so we could also keep both signalE and signalError with const parameter. We could also either:
- remove the deprecation
- remove the signalE (which would break for people that accepted deprecated function)
modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache
Outdated
Show resolved
Hide resolved
I have rollbacked my changes in the signal arguments, I think deprecation should be done in a separate PR. Thank you very much for your review! |
There was a problem hiding this comment.
1 issue found across 16 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="samples/client/petstore/cpp-qt/client/PFXPetApi.h">
<violation number="1">
P2: Deprecated signal signatures were changed from `const QString&` to `QString`, which alters the public API/ABI and can break existing code that connects using the old signal signature or precompiled binaries.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
Deprecated signals removed here: #23113 |
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Optimized the generated Qt C++ client to reduce copies and enforce const-correctness in internal code, without changing the public API. Regenerated samples/tests and updated docs accordingly.
Written for commit 98c42be. Summary will update on new commits.