QModListModel: turn into singleton
This commit is contained in:
parent
631cdb4938
commit
1061acbe6b
2 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
from PySide6.QtQml import QmlElement
|
from PySide6.QtQml import QmlElement, QmlSingleton
|
||||||
from PySide6.QtCore import QAbstractListModel, QModelIndex
|
from PySide6.QtCore import QAbstractListModel, QModelIndex
|
||||||
from leek.mod import InvalidModError
|
from leek.mod import InvalidModError
|
||||||
from leek.qmod import QMod
|
from leek.qmod import QMod
|
||||||
|
|
@ -12,6 +12,7 @@ QML_IMPORT_MAJOR_VERSION = 1
|
||||||
# Qt follows C++ naming conventions
|
# Qt follows C++ naming conventions
|
||||||
# ruff: noqa: N802
|
# ruff: noqa: N802
|
||||||
@QmlElement
|
@QmlElement
|
||||||
|
@QmlSingleton
|
||||||
class QModListModel(QAbstractListModel):
|
class QModListModel(QAbstractListModel):
|
||||||
def __init__(self, parent=None) -> None:
|
def __init__(self, parent=None) -> None:
|
||||||
super().__init__(parent=parent)
|
super().__init__(parent=parent)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Kirigami.ApplicationWindow {
|
||||||
id: modsView
|
id: modsView
|
||||||
|
|
||||||
delegate: ModCardDelegate {}
|
delegate: ModCardDelegate {}
|
||||||
model: QModListModel {}
|
model: QModListModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue