[Qt5][C++] Removed deprecated functions to support Qt6#8234
[Qt5][C++] Removed deprecated functions to support Qt6#8234wing328 merged 13 commits intoOpenAPITools:masterfrom basyskom-dege:Qt6Support
Conversation
etherealjoy
left a comment
There was a problem hiding this comment.
I think a current LTS debian distribution should build off the shelf.
|
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. |
…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]>
PR checklist
./bin/generate-samples.shto 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.masterI 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 aQRandomGeneratorwith a seed.qrand()is now a call ofgenerate()from theQRandomGeneratorObjecttoTime_t()->toSecsSinceEpoch()QString::SkipEmptyParts->Qt::SkipEmptyPartsappend(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.txtto 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)