Qt GUI: Fix build with newer/custom Qt builds and minor improvement #1222
+11
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was originally written as
QFontDatabase::families()sinceQFontDatabase::QFontDatabase()is deprecated since 6.0 and Qt docs says: "We strongly advise against using it in new code. Call the class methods as static functions instead."It was changed to
QFontDatabase().families()by g-maxime in a8ce718.Now it cannot be built if using a version of Qt with disable-deprecated-up-to = 0x060000:
So use a version check and switch between both to ensure it can be built on all versions of Qt.
Also make use of
translator->loadreturn value instead ofQ_UNUSED. I should have done so from the beginning.