songsqlmodel working

This commit is contained in:
Chris Cochrun 2022-02-22 09:23:42 -06:00
parent d647f4442f
commit 641b884901
13 changed files with 342 additions and 33 deletions

View file

@ -14,7 +14,7 @@ Kirigami.ApplicationWindow {
property bool libraryOpen: true
property bool presenting: false
property bool presentMode: true
property var secondScreen: null
property var screens
pageStack.initialPage: mainPage
header: Presenter.Header {}
@ -30,10 +30,16 @@ Kirigami.ApplicationWindow {
}
Component.onCompleted: {
print("checking screens")
print("Present Mode is " + presentMode)
secondScreen = Qt.application.screens[1]
print(secondScreen)
print("checking screens");
print("Present Mode is " + presentMode);
screens = Qt.application.screens;
for (let i = 0; i < screens.length; i++) {
print(screens[i].name);
print("width of screen: " + (screens[i].width * screens[i].devicePixelRatio));
print("height of screen: " + (screens[i].height * screens[i].devicePixelRatio));
print("pixeldensity of screen: " + screens[i].pixelDensity);
print("pixelratio of screen: " + screens[i].devicePixelRatio);
}
}
}

View file

@ -4,6 +4,7 @@ import QtQuick.Controls 2.0 as Controls
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.13 as Kirigami
import "./" as Presenter
import org.presenter 1.0
Item {
id: root
@ -25,10 +26,20 @@ Item {
color: Kirigami.Theme.backgroundColor
Controls.Label {
id: songlable
anchors.centerIn: parent
text: "Songs"
}
Controls.Label {
anchors {left: songlable.right
verticalCenter: songlable.verticalCenter
leftMargin: 15}
text: songsqlmodel.rowCount()
font.pixelSize: 15
color: Kirigami.Theme.disabledTextColor
}
MouseArea {
anchors.fill: parent
onClicked: {
@ -41,15 +52,19 @@ Item {
}
}
SongSqlModel {
id: songsqlmodel
}
ListView {
Layout.fillHeight: true
Layout.fillWidth: true
id: songLibraryList
model: _songListModel
model: songsqlmodel
delegate: itemDelegate
state: "selected"
Component.onCompleted: print(selectedLibrary)
/* Component.onCompleted: print(selectedLibrary) */
states: [
State {