-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cpp qt5 client #3688
Improve cpp qt5 client #3688
Conversation
connect(timer, &QTimer::timeout, this, [=](){ on_manager_timeout(reply); }); | ||
timer->start(); | ||
if(_timeOut > 0){ | ||
QTimer::singleShot(_timeOut, [&](){ on_manager_timeout(reply); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the timer elapsed at the same time response is received? Would there be a crash because the object is still referenced in the Qt event Loop? Won't this happen since the QNetworkReply is async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #4430, I replaced [&] by [=]
modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache
Show resolved
Hide resolved
I need to check the host, because the cpp uses it and I wonder how it compiles then set the And using a single client to talk to different versions of a service depending on what service is available on the field. |
The issue is in the |
Can you please elaborate on the issue with the host parameter? |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,4.1.x
,5.0.x
. Default:master
.Description of the PR
This PR add two improvements to the qt5 client:
setHost
which is not appropriate. Ideally we could compose the request path with the scheme/host/port and base path (without host). Unfortunately the scheme is not accessible from the mustache template (I managed to access it locally by modifying this function.QTimer::singleShot()
#pragma once
directive@ravinikam @stkrwork @etherealjoy @muttleyxd