From 818b57cef77c8fa677e9ce1111f293ebac629c12 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 8 Apr 2022 17:31:44 -0500 Subject: [PATCH] imageEditor is working and preview of images works --- TODO.org | 2 ++ src/imagesqlmodel.cpp | 4 ++-- src/qml/presenter/ImageEditor.qml | 2 +- src/qml/presenter/MainWindow.qml | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TODO.org b/TODO.org index 16b7765..8361ff8 100644 --- a/TODO.org +++ b/TODO.org @@ -4,6 +4,8 @@ :END: * Inbox +** TODO Images stored in sql need to have aspect saved and applied dynamically here +[[file:~/dev/church-presenter/src/qml/presenter/Slide.qml::fillMode: Image.PreserveAspectCrop]] ** TODO Make an image sql model [[file:~/dev/church-presenter/src/videosqlmodel.h::ifndef VIDEOSQLMODEL_H]] ** TODO Build out a slide preview system so we can see each slide in the song or image slideshow diff --git a/src/imagesqlmodel.cpp b/src/imagesqlmodel.cpp index c4537f0..727d761 100644 --- a/src/imagesqlmodel.cpp +++ b/src/imagesqlmodel.cpp @@ -37,10 +37,10 @@ static void createImageTable() qDebug() << query.lastQuery(); qDebug() << "inserting into images"; - query.exec("INSERT INTO images (title, filePath) VALUES ('Dec 180', '/home/chris/nextcloud/tfc/openlp/180-dec.png')"); + query.exec("INSERT INTO images (title, filePath) VALUES ('Dec 180', 'file:///home/chris/nextcloud/tfc/openlp/180-dec.png')"); qDebug() << query.lastQuery(); query.exec("INSERT INTO images (title, filePath) VALUES ('No TFC', " - "'/home/chris/nextcloud/tfc/openlp/No TFC.png')"); + "'file:///home/chris/nextcloud/tfc/openlp/No TFC.png')"); query.exec("select * from images"); qDebug() << query.lastQuery(); diff --git a/src/qml/presenter/ImageEditor.qml b/src/qml/presenter/ImageEditor.qml index 8da66af..d5e80e5 100644 --- a/src/qml/presenter/ImageEditor.qml +++ b/src/qml/presenter/ImageEditor.qml @@ -163,7 +163,7 @@ Item { Layout.preferredHeight: Layout.preferredWidth / 16 * 9 Layout.alignment: Qt.AlignCenter fillMode: Image.PreserveAspectFit - source: "file://" + image.toString() + source: image } Item { id: botEmpty diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 2124e91..9fb41e7 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -175,6 +175,7 @@ Controls.Page { videoEditor.visible = false; videoEditor.stop(); songEditor.visible = false; + imageEditor.visible = false; presentation.visible = true; editMode = false; }