Skip to content

Raise Qt minimum version to 6.2#4526

Open
bjorn wants to merge 14 commits into
masterfrom
qt-6.2-minimum
Open

Raise Qt minimum version to 6.2#4526
bjorn wants to merge 14 commits into
masterfrom
qt-6.2-minimum

Conversation

@bjorn
Copy link
Copy Markdown
Member

@bjorn bjorn commented May 22, 2026

Hoping to shed some legacy code for the next new features release.

bjorn added 14 commits May 22, 2026 16:31
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant