chore: configure pyside6-project

This commit is contained in:
2025-10-24 22:58:25 +08:00
parent d90a165df8
commit 42b3447b43
6 changed files with 45 additions and 12 deletions

3
.gitignore vendored
View File

@ -1,6 +1,9 @@
__debug*
.vscode/
# QML type cache
internal/
arcaea_offline.db
arcaea_offline.ini
/data

View File

@ -56,3 +56,15 @@ ignore = [
[tool.pyright]
ignore = ["**/__debug*.*"]
[tool.pyside6-project]
files = [
"app.py",
"ui/qmls/App.qml",
"ui/qmls/AppMain.qml",
"ui/viewmodels/overview.py",
"ui/qmls/Overview.qml",
"ui/qmls/404.qml",
]

22
ui/qmls/404.qml Normal file
View File

@ -0,0 +1,22 @@
import QtQuick
import QtQuick.Controls
Page {
Column {
anchors.centerIn: parent
width: parent.width
Label {
width: parent.width
text: '?'
font.pointSize: 50
horizontalAlignment: Qt.AlignCenter
}
Label {
width: parent.width
text: 'Placeholder page'
horizontalAlignment: Qt.AlignCenter
}
}
}

View File

@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@ -31,6 +32,7 @@ RowLayout {
focus: true
delegate: Item {
id: navListItem
required property int index
required property string label
width: parent.width
@ -39,7 +41,7 @@ RowLayout {
MouseArea {
anchors.fill: parent
onClicked: () => {
navListView.currentIndex = index;
navListView.currentIndex = navListItem.index;
}
}

View File

@ -6,14 +6,11 @@ import internal.ui.vm 1.0
Page {
id: root
property var b30: vm.b30
property alias b30: vm.b30
OverviewViewModel {
id: vm
onB30Changed: {
root.b30 = vm.b30;
}
}
component Display: RowLayout {

View File

@ -3,9 +3,7 @@ from PySide6.QtQml import QmlElement
from core.database import Database
from .common import VM_QML_IMPORT_NAME
QML_IMPORT_NAME = VM_QML_IMPORT_NAME
QML_IMPORT_NAME = "internal.ui.vm"
QML_IMPORT_MAJOR_VERSION = 1
QML_IMPORT_MINOR_VERSION = 0
@ -28,7 +26,6 @@ class OverviewViewModel(QObject):
self._b30 = b30 if b30 is not None else -1.0
self.b30Changed.emit()
def getB30(self):
@Property(float, fset=None)
def b30(self):
return self._b30
b30 = Property(float, getB30, None, notify=b30Changed)