Skip to content

QML: improve settings - #15380

Merged
JoergAtGithub merged 3 commits into
mixxxdj:mainfrom
acolombier:feat/qml-enhanced-settings
Apr 17, 2026
Merged

QML: improve settings#15380
JoergAtGithub merged 3 commits into
mixxxdj:mainfrom
acolombier:feat/qml-enhanced-settings

Conversation

@acolombier

Copy link
Copy Markdown
Member

This PR refactors the QML settings core pop-up to use explicit declaration instead of using Loader. This is done in order to fix issues with Window integration, such a file or folder dialog, as it looks like loaders seem to create strange bugs.

Comment thread res/qml/main.qml Outdated
Comment thread res/qml/main.qml Outdated
Comment thread res/qml/Settings.qml Outdated
@acolombier
acolombier force-pushed the feat/qml-enhanced-settings branch from 27cbfcc to 7f77c25 Compare December 11, 2025 19:13
@acolombier

Copy link
Copy Markdown
Member Author

I took the liberty of amending the commits with the requested changes @ywwg!

@acolombier

Copy link
Copy Markdown
Member Author

Are we happy to merge this now @ywwg ?

Comment thread res/qml/Settings.qml
Comment on lines +267 to +268
Settings.StatsPerformance {
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tab appears twice for me:

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't reproduce. Can you confirm this is a regression?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can confirm that this is a regression. With main it looks this:
grafik

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be impacting Qt 6.10 only - looks like Object.values on QML list have a new behaviour/flawed. Fixed now!

@acolombier

Copy link
Copy Markdown
Member Author

Friendly ping @JoergAtGithub :)

@acolombier

Copy link
Copy Markdown
Member Author

Friendly ping @mixxxdj/developers

As our agreement on the operating mode for the QML project, I would like to get that merged since this is not touching on any 2.x code is part of the continuous improvement of 3.0.

@ronso0
ronso0 requested a review from ywwg March 9, 2026 09:30
Comment thread res/qml/Settings.qml Outdated
readonly property int selectedIndex: categoryItem && categoryItem.selectedIndex !== undefined ? categoryItem.selectedIndex : 0
readonly property var tabs: categoryItem ? categoryItem.tabs : []
readonly property int selectedIndex: root.activeCategory?.selectedIndex ?? 0
readonly property var tabs: activeCategory?.tabs ?? []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly property var tabs: activeCategory?.tabs ?? []
readonly property var tabs: root.activeCategory?.tabs ?? []

Comment thread res/qml/Settings.qml Outdated
readonly property real smallScreenWidth: 1200
function updateActiveCategory() {
root.activeCategory?.deactivated();
root.activeCategory = Object.values(managerItem.data)[categoryList.currentIndex] ?? null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
root.activeCategory = Object.values(managerItem.data)[categoryList.currentIndex] ?? null;
root.activeCategory = managerItem.data[categoryList.currentIndex] ?? null;

Great work on migrating away from Loader!

I noticed an issue here: I think, we shouldn't use Object.values() on managerItem.data. Because data is a C++ QQmlListProperty under the hood, running standard JavaScript reflection like Object.values() on it leads to unpredictable behavior in the QML engine (it ends up pulling internal C++ properties and array length values instead of just the items themselves).

I tested this with a test file like this:

import QtQuick 2.0

Item {
    id: root
    Item { id: child1; objectName: "child1" }
    Item { id: child2; objectName: "child2" }

    Component.onCompleted: {
        let vals = Object.values(root.data);
        console.log("vals:", vals);
        Qt.quit();
    }
}

which outputs:

qml: vals: [QQuickItem(0xa54c6b3a0, "child1"),QQuickItem(0xa54c6b480, "child2"),QQuickItem(0xa54c6b480, "child2")]

As you can see from the trailing output, the QQuickItem(..., "child2") pointer is completely duplicated at the end of the array.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point, I had also suffered from the same issue here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i missed the other convo. great, we can keep this behaviour in mind.

@acolombier

Copy link
Copy Markdown
Member Author

Thanks for your feedback @xARSENICx , I have updated the PR now

@xARSENICx

Copy link
Copy Markdown
Contributor

The PR LGTM now.

@acolombier

Copy link
Copy Markdown
Member Author

@mixxxdj/developers merge?

@ywwg

ywwg commented Apr 2, 2026

Copy link
Copy Markdown
Member

there are failing tests, please squash the fixup commit. and is the android failure fixable?

@acolombier
acolombier force-pushed the feat/qml-enhanced-settings branch from e5e9e3c to 49b1192 Compare April 2, 2026 13:59
@acolombier

acolombier commented Apr 2, 2026

Copy link
Copy Markdown
Member Author

Squashed the commits.

is the android failure fixable?

No, this is related to this issue, which I believe is being looked at here

@acolombier

Copy link
Copy Markdown
Member Author

Should be good to go now @ywwg !

@JoergAtGithub JoergAtGithub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR Mixxx is not starting up anymore:

warning [QQmlThread] file:///D:/mixxx/res/qml/Settings/Category.qml:10:12: Duplicate signal name: invalid override of property change signal or superclass signal
warning [Main] QQmlApplicationEngine failed to load component
warning [Main] file:///D:/mixxx/res/qml/main.qml:639:5: Type Skin.Settings unavailable
warning [Main] file:///D:/mixxx/res/qml/Settings.qml:280:21: Type Settings.Interface unavailable
warning [Main] file:///D:/mixxx/res/qml/Settings/Interface.qml:4:1: Cannot load library D:\mixxx\build\x64__portable\Qt6\qml\QtQuick\Dialogs\qtquickdialogsplugin.dll: Das angegebene Modul wurde nicht gefunden.
critical [Main] Failed to load QML file "D:/mixxx/res/qml/main.qml"

@ywwg

ywwg commented Apr 7, 2026

Copy link
Copy Markdown
Member

critical [Main] Failed to load QML file "D:/mixxx/res/qml/main.qml"

yeah unfortunately I get the same thing

@ywwg

ywwg commented Apr 7, 2026

Copy link
Copy Markdown
Member

the file is there, but it seems to be invalid somehow

@xARSENICx

xARSENICx commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Found the cause of the Windows crash: Category.qml declares signal activated, which is already defined in the base class QmlSettingGroup. Newer Qt versions treat this collision as a fatal error.

I've pushed a fixup commit to my fork that removes the redundant declaration. You can cherry-pick it from here:

xARSENICx/mixxx@5fec2fc

Alternatively, just deleting line 10 in res/qml/Settings/Category.qml should resolve it!

Some Context: I verified this on my machine (macOS-Darwin 25.3.0, arm64) running Qt 6.8.3. It seems this specific QML validation failure is platform-sensitive, as it didn't trigger a regression in my environment.

@acolombier
acolombier force-pushed the feat/qml-enhanced-settings branch from 49b1192 to bd859fb Compare April 9, 2026 00:56
@acolombier

Copy link
Copy Markdown
Member Author

Thanks for testing @JoergAtGithub and @ywwg and thanks for the diagnose @xARSENICx ! Indeed, this is not an issue with Qt 6.4 for some reasons.

I have amended the commit and remove the duplicate now.

@JoergAtGithub

Copy link
Copy Markdown
Member

Now it fails with:

warning [Main] QQmlApplicationEngine failed to load component
warning [Main] file:///D:/mixxx/res/qml/main.qml:639:5: Type Skin.Settings unavailable
warning [Main] file:///D:/mixxx/res/qml/Settings.qml:280:21: Type Settings.Interface unavailable
warning [Main] file:///D:/mixxx/res/qml/Settings/Interface.qml:4:1: Cannot load library D:\mixxx\build\x64__portable\Qt6\qml\QtQuick\Dialogs\qtquickdialogsplugin.dll: Das angegebene Modul wurde nicht gefunden.
critical [Main] Failed to load QML file "D:/mixxx/res/qml/main.qml"

@xARSENICx

Copy link
Copy Markdown
Contributor

Although unrelated to changes brought in this PR, i suspect that it's a platform specific bug again. I have provided some information in #16313. Running this PR on top of that shall fix the issue.

Regarding such unused header problems, I would suggest setting up QML lint ig. Haven't given it a try (setting it up as I write this comment); I debugged the issue based on @JoergAtGithub 's logs.

@acolombier

Copy link
Copy Markdown
Member Author

Regarding such unused header problems, I would suggest setting up QML lint ig

The issue with linting is that qmlformat is pretty flawed in Qt 6.4, which is the currently minimum supported version, which also run in CI (ubuntu-latest). Note that we used to use a bespoke linting but had to shut it down as it was causing to much issues. We shall be able to bring it back when we drop Ubuntu 24.04 requirements.

@JoergAtGithub

Copy link
Copy Markdown
Member

@acolombier Could you please merge in latest main

@JoergAtGithub

JoergAtGithub commented Apr 16, 2026

Copy link
Copy Markdown
Member

I can load QML now again, but the settings dialog is not usable.
As you can see in my video, the mouse actions affect the library behind the dialog - drag and drop of tracks, instead of crating patch-wire connections:

Aufzeichnung.2026-04-16.214302.mp4

@acolombier

Copy link
Copy Markdown
Member Author

Great.
The issue is unrelated to this change.

@JoergAtGithub

Copy link
Copy Markdown
Member

The issue is unrelated to this change.

I can confirm this, while the current settings dialog is unusable, this is not a regression of this PR.

@JoergAtGithub
JoergAtGithub merged commit c7b6f70 into mixxxdj:main Apr 17, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in QML GUI Apr 17, 2026
@xARSENICx

Copy link
Copy Markdown
Contributor

🚀 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants