COMP: Fix Qt 5/6 compatibility and Qt 6.4+ deprecations #1298
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.
This PR updates several CTK components to improve compatibility across Qt 5.15 and Qt 6.x and to address API changes and deprecations introduced in recent Qt 6 releases:
Changes
ctkDICOMTester
QByteArray::size()instead of the deprecated parameter-lesscount()(Qt 6.4).ctkBasePopupWidget / ctkPopupWidget
QT_VERSION >= 6.5.0, replace deprecatedQApplication::setActiveWindow()withactivateWindow()on the appropriate widget.QApplication::setActiveWindow()for Qt 5.x / Qt < 6.5 to preserve existing behavior.ctkLanguageComboBox
QT_VERSION >= 6.6.0, useQLocale::territoryToString(locale.territory())instead of deprecatedQLocale::countryToString(locale.country()).ctkQImageView
QT_VERSION >= 6.6.0, useQColor::fromString()for named colors instead of deprecatedQColor::setNamedColor().setNamedColor()on older Qt versions.ctkTestApplication
QMouseEventwith both local and explicit global positions (QCursor::pos()), aligning with modern Qt 5/6 constructors and avoiding deprecated usage.ctkMTDataParser
QT_VERSION >= 6.0.0, useQStringViewwhen reading element and attribute names fromQXmlStreamReader/QXmlStreamAttributes, in line with Qt 6 XML APIs.QStringReffor Qt 5.x to maintain dual-build compatibility.