-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Qt5][C++] Removed deprecated functions to support Qt6 #8234
Conversation
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.
I think a current LTS debian distribution should build off the shelf.
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache
Outdated
Show resolved
Hide resolved
Okay I have to check for the compatibility of those functions. Will do a new commit on Monday to address the compatibility issues here. Is there a min. required version for Qt? Otherwise i would take the oldest LTS version ( 5.9 LTS ) |
I added version checks for the random functions. I kept the changes to the |
The current build failure, seems unrelated to the changes. |
Since these changes solve annoying deprecated warning with Qt 5.15, I would rather check versus 5.15 instead of 6.0. What do you think? |
I wouldnt mind that. Those warnings are numerous thats true. |
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache
Outdated
Show resolved
Hide resolved
…tpFileElement.cpp.mustache Co-authored-by: Martin Delille <[email protected]>
…tpFileElement.cpp.mustache Co-authored-by: Martin Delille <[email protected]>
…tpRequest.cpp.mustache Co-authored-by: Martin Delille <[email protected]>
…tpRequest.cpp.mustache Co-authored-by: Martin Delille <[email protected]>
…tpRequest.cpp.mustache Co-authored-by: Martin Delille <[email protected]>
…tpRequest.h.mustache Co-authored-by: Martin Delille <[email protected]>
Changed version check to Qt 5.15 to remove the warning of the deprecated functions when compiling with Qt 5.15 Co-authored-by: Martin Delille <[email protected]>
Travis CI tests passed via https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/756044989 |
PR checklist
./bin/generate-samples.sh
to update all Petstore samples related to your fix. 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*
. For Windows users, please run the script in Git BASH.master
I created an Announcement #8232 regarding Qt6. This PR will remove all deprecated functions in the Qt5 generator.
These are the changes i did to support Qt6:
qsrand()
is now aQRandomGenerator
with a seed.qrand()
is now a call ofgenerate()
from theQRandomGenerator
ObjecttoTime_t()
->toSecsSinceEpoch()
QString::SkipEmptyParts
->Qt::SkipEmptyParts
append(someQstring)
-> append(someQstring.toUtf8())`QJsonDocument::fromBinaryData()
->QJsonDocument::fromJson()
QJsonDocument::toBinaryData()
->QJsonDocument::toJson()
Everything works aswell in Qt5. The SkipEmptyParts will not work but I made a preprocessor variable for this:
I did not change the
CMakeLists.txt
to Qt6, since it is still a generator for Qt5.PING @wing328 @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @MartinDelille (2018/03) @muttleyxd (2019/08)