From d8aca3d149a49e67e20c8372e1b706956f649963 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 24 Sep 2022 14:58:17 -0500 Subject: [PATCH] a bit of updating and making pdfs work better --- src/qml/main.qml | 2 +- src/qml/presenter/MainWindow.qml | 23 ++++++++++------------- src/qml/presenter/Presentation.qml | 13 +++++++------ src/qml/presenter/PresentationEditor.qml | 2 +- src/qml/presenter/PresentationWindow.qml | 4 +++- src/qml/presenter/Slide.qml | 5 +++-- src/slide.h | 9 ++++++--- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index caf8b19..10a8174 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Dialogs 1.0 import QtQuick.Controls 2.15 as Controls import Qt.labs.platform 1.1 as Labs diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 126c221..4fb5ca7 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Dialogs 1.0 import QtQuick.Controls 2.15 as Controls import QtQuick.Window 2.13 @@ -135,24 +135,21 @@ Controls.Page { print(item); presentation.stopVideo(); - presentation.itemType = item.type; + /* presentation.itemType = item.type; */ print("Time to start changing"); - // This determines if pdf and gives slide the right - // page count to use. - if (item.type == "pres") - SlideObject.changeSlide(item); - else - SlideObject.changeSlide(item); + SlideObject.changeSlide(item); + showPassiveNotification(SlideObject.imageBackground); - if (item.backgroundType === "video") - { - presentation.loadVideo(); - } + /* if (item.backgroundType === "video") */ + /* { */ + /* presentation.loadVideo(); */ + /* } */ presentation.textIndex = 0; - presentation.changeSlide(); + /* presentation.changeSlide(); */ + showPassiveNotification(SlideObject.imageBackground); print("Slide changed to: " + item.name); } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index fb809e3..0a55fbc 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Dialogs 1.0 import QtQuick.Controls 2.15 as Controls import QtQuick.Window 2.13 @@ -13,9 +13,9 @@ Item { property var text property int textIndex: 0 - property string itemType - property url imagebackground - property url vidbackground + property string itemType: SlideObject.type + property url imagebackground: SlideObject.imageBackground + property url vidbackground: SlideObject.videoBackground property Item slide: previewSlide @@ -88,9 +88,10 @@ Item { Layout.alignment: Qt.AlignCenter textSize: width / 15 itemType: root.itemType - imageSource: SlideObject.imageBackground - videoSource: SlideObject.videoBackground + imageSource: imagebackground + videoSource: vidbackground text: SlideObject.text + pdfIndex: SlideObject.pdfIndex preview: true } diff --git a/src/qml/presenter/PresentationEditor.qml b/src/qml/presenter/PresentationEditor.qml index 1ca01b3..a4239f0 100644 --- a/src/qml/presenter/PresentationEditor.qml +++ b/src/qml/presenter/PresentationEditor.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Controls 2.15 as Controls import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.2 diff --git a/src/qml/presenter/PresentationWindow.qml b/src/qml/presenter/PresentationWindow.qml index b29293c..05ef963 100644 --- a/src/qml/presenter/PresentationWindow.qml +++ b/src/qml/presenter/PresentationWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Dialogs 1.0 import QtQuick.Controls 2.15 as Controls import QtQuick.Window 2.13 @@ -36,6 +36,8 @@ Window { imageSource: SlideObject.imageBackground videoSource: presentationWindow.visible ? SlideObject.videoBackground : "" text: SlideObject.text + pdfIndex: SlideObject.pdfIndex + itemType: SlideObject.type } Connections { diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index b952b62..4fc7968 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -1,4 +1,4 @@ -import QtQuick 2.13 +import QtQuick 2.15 import QtQuick.Controls 2.15 as Controls import QtQuick.Layouts 1.2 /* import QtMultimedia 5.15 */ @@ -19,6 +19,7 @@ Item { property bool dropShadow: false property url imageSource property url videoSource + property int pdfIndex property string chosenFont: "Quicksand" property string text: "This is demo text" property color backgroundColor @@ -119,7 +120,7 @@ Item { fillMode: Image.PreserveAspectCrop clip: true visible: true - + currentFrame: pdfIndex } FastBlur { diff --git a/src/slide.h b/src/slide.h index cbba840..62bae82 100644 --- a/src/slide.h +++ b/src/slide.h @@ -11,10 +11,13 @@ class Slide : public QObject Q_OBJECT Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged) - Q_PROPERTY(QVariantMap serviceItem READ serviceItem WRITE setServiceItem NOTIFY serviceItemChanged) + Q_PROPERTY(QVariantMap serviceItem READ serviceItem WRITE setServiceItem + NOTIFY serviceItemChanged) Q_PROPERTY(QString audio READ audio WRITE setAudio NOTIFY audioChanged) - Q_PROPERTY(QString imageBackground READ imageBackground WRITE setImageBackground NOTIFY imageBackgroundChanged) - Q_PROPERTY(QString videoBackground READ videoBackground WRITE setVideoBackground NOTIFY videoBackgroundChanged) + Q_PROPERTY(QString imageBackground READ imageBackground WRITE setImageBackground + NOTIFY imageBackgroundChanged) + Q_PROPERTY(QString videoBackground READ videoBackground WRITE setVideoBackground + NOTIFY videoBackgroundChanged) Q_PROPERTY(QString horizontalTextAlignment READ horizontalTextAlignment WRITE setHorizontalTextAlignment NOTIFY horizontalTextAlignmentChanged) Q_PROPERTY(QString verticalTextAlignment READ verticalTextAlignment