diff --git a/src/leek/mod_list.py b/src/leek/mod_list.py index ee12488..96a98d4 100644 --- a/src/leek/mod_list.py +++ b/src/leek/mod_list.py @@ -1,4 +1,4 @@ -from PySide6.QtQml import QmlElement +from PySide6.QtQml import QmlElement, QmlSingleton from PySide6.QtCore import QAbstractListModel, QModelIndex from leek.mod import InvalidModError from leek.qmod import QMod @@ -12,6 +12,7 @@ QML_IMPORT_MAJOR_VERSION = 1 # Qt follows C++ naming conventions # ruff: noqa: N802 @QmlElement +@QmlSingleton class QModListModel(QAbstractListModel): def __init__(self, parent=None) -> None: super().__init__(parent=parent) diff --git a/src/leek/qml/Main.qml b/src/leek/qml/Main.qml index a7650ee..da54ba4 100644 --- a/src/leek/qml/Main.qml +++ b/src/leek/qml/Main.qml @@ -29,7 +29,7 @@ Kirigami.ApplicationWindow { id: modsView delegate: ModCardDelegate {} - model: QModListModel {} + model: QModListModel } }