Skip to content

Implement QML Support - #189

Closed
YongDo-Hyun wants to merge 2 commits into
developfrom
feature/phase-01-qt6-only-qml-skeleton
Closed

YongDo-Hyun wants to merge 2 commits into
developfrom
feature/phase-01-qt6-only-qml-skeleton

Conversation

@YongDo-Hyun

Copy link
Copy Markdown
Collaborator

With LLM

@CLAassistant

CLAassistant commented Sep 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

grxtor and others added 2 commits September 22, 2026 23:06
Qt 5 support goes away with the move to a QML user interface: Qt Quick
Controls, qt_add_qml_module and the QML tooling the UI will rely on are Qt 6
APIs. The Qt 6 floor stays at 6.4 on purpose -- Debian 12 and Ubuntu 24.04 LTS
ship 6.4.2 and should keep building from source. Everything the QML UI needs
exists there: qt_add_qml_module and QML_SINGLETON (6.2), QQmlEngine::retranslate
(5.10), IconImage's color property (6.0).

  - CMakeLists: QT_VERSION_MAJOR is now fixed at 6, and passing
    -DMeshMC_QT_VERSION_MAJOR=5 is a hard error rather than a silent Qt 6 build.
    Added Qml, Quick and QuickControls2 to the component list.
  - launcher/CMakeLists: collapsed five if(QT_VERSION_MAJOR EQUAL 6)/else()
    branches and dropped the macdeployqt shell-out that only existed for Qt 5.
  - CMakePresets: removed 12 Qt 5 preset entries (4 presets x 3 sections).
  - CI: 11 build jobs down to 7, all Qt 6. Removed the now-unreachable Qt 5
    steps from setup-dependencies and setup-openssl -- the latter existed almost
    entirely to build OpenSSL 1.1.1 for Qt 5, and shrinks to the MSYS2 lookup
    that the MinGW Qt 6 job still needs. release.yml no longer moves or
    publishes Qt 5 artifacts that are never produced.

The QML module is a separate target rather than being attached to the
executable, so QmlModule_test can link it and instantiate the root component
headlessly. RESOURCE_PREFIX is spelled out instead of relying on
qt_policy(QTP0001), which is 6.5+, so the qrc URLs will not move when the floor
is eventually raised. cmake/UnitTest.cmake switches to the keyword
target_link_libraries signature because Qt's own helpers use it and CMake
refuses to mix the two forms.

Also removes three unused widgets: ErrorFrame was not in CMakeLists at all (so
its generated header never existed), InstanceCardWidget.ui was compiled but its
header included nowhere, and LineSeparator had zero references.

check-plugin-independence.sh looked for launcher/plugins, which does not exist
-- the plugins live in launcher/plugin/plugins -- so it exited 2 on every run
and was never wired into CI. Fixed and added to the build workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: grxtor <abdullah.huseyin.efe@outlook.com>
A QML ListView reaches data by role name, and only ever sees column 0. Every
model here was column-based or exposed nothing but Qt's generic roles, so the
QML UI could not have read any of it. This adds roleNames() and named roles to
thirteen models, following the template already in the tree
(BaseVersionList.h:47-59 and .cpp:89-102).

Purely additive: every existing role, column and behaviour is untouched, because
the QtWidgets UI is still the shipping UI. Where data lived in columns 1..N, the
new roles answer it independently of the column so QML gets it from column 0.

Role numbering in InstanceList is pinned deliberately. ui/instanceview/
InstanceView.h:31 reads GroupRole/ProgressValueRole/ProgressMaximumRole as the
bare integers 256/257/258, so new roles start at Qt::UserRole+10 and a
static_assert documents the reservation until the widget grid is deleted.

Raw pointer roles (InstanceList's InstancePointerRole, AccountList's
PointerRole, Index's ListPtrRole) are deliberately left out of roleNames():
QML cannot dereference them, and instances should be reached by id instead.

Two latent bugs surfaced while doing this and are fixed here because the new
roles would have activated them:

  - AccountList::data()'s Qt::CheckStateRole case has an inner switch on the
    column with no default, so any column but NameColumn fell out of it. That
    was harmless while the next statement was 'default: return QVariant()';
    inserting named roles after it would have silently returned the display
    string instead. Now returns QVariant() explicitly.
  - WorldList declared GameModeRole but data() never handled it, so the role
    was dead. It now returns what GameModeColumn shows.

AccountList's AccountState-to-string switch moved into a file-local helper so
the StatusColumn case and the new StatusRole share it; it keeps AccountList::tr
so the translation context, and therefore existing translations, are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: grxtor <abdullah.huseyin.efe@outlook.com>
@grxtor
grxtor force-pushed the feature/phase-01-qt6-only-qml-skeleton branch from 1faae33 to 848124b Compare September 22, 2026 20:06
@YongDo-Hyun
YongDo-Hyun added this pull request to stack #191 September 22, 2026 20:15
@YongDo-Hyun YongDo-Hyun added this to the Backlog milestone Sep 23, 2026
@YongDo-Hyun YongDo-Hyun closed this Oct 2, 2026
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.

3 participants