Raise Qt minimum version to 6.2#4526
Open
bjorn wants to merge 14 commits into
Open
Conversation
The Linux apt-based jobs (Ubuntu and CodeQL) now install the qt6-*-dev packages instead of the qt5 ones. The macOS and Windows matrices in packages.yml and the AppVeyor matrix lose their Qt 5.15.2 entries; only the Qt 6 builds remain. The corresponding macOS-10.13-10.15 and Windows-7-8_x86 artifacts are removed from the GitHub release upload.
The previous snap built against Qt 5 (qtbase5-dev / libqt5svg5-dev /
qtdeclarative5-dev) and shipped the snapcraft-desktop-helpers
desktop-qt5 launcher. With Qt 5 dropped from the build there is no
desktop-qt6 flavor in snapcraft-desktop-helpers, so the cleanest
core24-based path is the kde-neon-6 extension, which:
- exposes the Qt 6 SDK on PATH at build time via the
kde-qt6-core24-sdk content snap;
- provides Qt 6 / KF6 at runtime via the kf6-core24 content snap;
- injects a desktop-launch command-chain and the standard desktop /
opengl / wayland / x11 / unity7 / network plugs.
The custom desktop-qt5 part and the manual command-chain are gone,
and the tiled / qaseprite parts no longer need Qt build- or
stage-packages of their own. Only qbs, zlib and zstd remain as
explicit build deps; Qt comes from the SDK content snap.
Risks that need an actual snapcraft pack to verify:
- The kde-neon-6 SDK exposes qmake as `qmake6` (no `qmake` symlink),
while qbs's Qt module provider scans PATH for `qmake`. The build
step creates a small shim directory containing qmake -> qmake6 to
paper over this. If qbs picks Qt up some other way this shim is
harmless; if it doesn't, the shim should make detection work.
- Switching from desktop-qt5 to the extension changes the runtime
layout (icon themes, fcitx, locales come from the content snap,
not stage-packages). Wayland / theme / IME behaviour should be
re-checked on first build.
Cleaned out dead pre-6.2 #if QT_VERSION blocks in libtiled, libtiledquick, tiled (editor library), tiledapp and the flare plugin. Also dropped the now-redundant Qt.core.versionMajor >= 6 conditions from the .qbs files. Guards for Qt 6.3+ features were left intact, since 6.2.x users are still supported.
…ations - Replaced 'Qt::CTRL + Qt::Key_X' with 'Qt::CTRL | Qt::Key_X' (operator+ on QFlags is deprecated in Qt 6). - Replaced QVariant::typeToName / nameToType with QMetaType-based equivalents. - Updated QVariant::convert(int) calls to use QMetaType. - Switched QMenu action ownership check to QMenu::actions().contains() since QAction::parentWidget() no longer returns the menu in Qt 6. - Dropped QT_NO_DEPRECATED_WARNINGS so future deprecations surface.
- QLibraryInfo::location -> QLibraryInfo::path (removed in Qt 6). - QVariant::Map -> QMetaType::QVariantMap (QVariant::Type enum hidden under QT_DISABLE_DEPRECATED_BEFORE=6.2).
…e position QMouseEvent::globalPos() was removed in Qt 6 in favour of globalPosition() returning QPointF. Stored mLastMousePos as QPointF (and likewise mScrollStartPos in MapView) to preserve sub-pixel precision through to where it actually has to feed into integer-based widget APIs.
Qt 6.6 deprecated QLocale::country() and countryToString() in favour of territory() / territoryToString(). The replacements have been available since Qt 6.2, so this is a clean swap on the new floor.
Both functions are deprecated since Qt 6.6 (isValidColor) and 6.4 (setNamedColor). Their replacements isValidColorName and fromString are both available since Qt 6.4, so a 6.4 version guard suffices. Added an isValidColorName helper in tiled.h that picks the right call under the hood, and switched the two setNamedColor sites to assigning QColor::fromString(name) directly when available — that already returns an invalid color for unknown names, so the explicit validity check becomes unnecessary in the new branch.
QImage::mirrored is deprecated since Qt 6.13; flipped(Qt::Orientations) exists from 6.9. Wrapped both with version guards. Also routed the colour-validity check through tiled.h's isValidColorName helper.
addAction(text, obj, slot, shortcut) is deprecated since Qt 6.4. The new overload addAction(text, shortcut, obj, slot) was added in 6.3, so it falls within our 6.2 floor with a version guard.
QCheckBox::stateChanged(int) is deprecated since 6.9 in favour of checkStateChanged(Qt::CheckState), available since 6.7.
invalidateFilter() is deprecated since Qt 6.13. The begin/endFilterChange pair was added in 6.9 and replaces it with a single transaction around the mutation. Restructured the existing partial guards in IssuesDock and TilesetDocumentsFilterModel accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hoping to shed some legacy code for the next new features release.