Skip to content

QML: improve settings#15380

Open
acolombier wants to merge 2 commits intomixxxdj:mainfrom
acolombier:feat/qml-enhanced-settings
Open

QML: improve settings#15380
acolombier wants to merge 2 commits intomixxxdj: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.

@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 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 acolombier force-pushed the feat/qml-enhanced-settings branch from 7f77c25 to 9652a65 Compare February 7, 2026 21:57
@acolombier acolombier mentioned this pull request Feb 7, 2026
12 tasks
@acolombier acolombier force-pushed the feat/qml-enhanced-settings branch from 9652a65 to 10c4070 Compare February 9, 2026 00:15
@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
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 ?? []

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
Copy link
Copy Markdown
Member

ywwg commented Apr 2, 2026

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
Copy link
Copy Markdown
Member Author

acolombier commented Apr 2, 2026

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 !

Copy link
Copy Markdown
Member

@JoergAtGithub JoergAtGithub left a comment

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"

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

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

4 participants