├── .qmake.conf ├── presentation.pro ├── examples ├── animatedbackground │ ├── particle.png │ ├── SlideDeckRotated.qml │ ├── SlideDeck.qml │ ├── BackgroundSwirls.qml │ └── Swirl.qml ├── tutorial │ ├── SlideDeckRotated.qml │ ├── CodeSection.qml │ └── SlideDeck.qml ├── customtransition │ ├── SlideDeckRotated.qml │ ├── SlideDeck.qml │ └── OpacityTransitionPresentation.qml └── notes │ └── SlideDeck.qml ├── src ├── qmldir ├── src.pro ├── SlideCounter.qml ├── Clock.qml ├── CodeSlide.qml ├── Slide.qml └── Presentation.qml ├── tools └── printslides │ ├── printslides.pro │ ├── README.txt │ ├── slideview.h │ ├── main.cpp │ └── slideview.cpp └── README /.qmake.conf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /presentation.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = src 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/animatedbackground/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qml-presentation-system/HEAD/examples/animatedbackground/particle.png -------------------------------------------------------------------------------- /src/qmldir: -------------------------------------------------------------------------------- 1 | CodeSlide 1.0 CodeSlide.qml 2 | Presentation 1.0 Presentation.qml 3 | Slide 1.0 Slide.qml 4 | SlideCounter 1.0 SlideCounter.qml 5 | Clock 1.0 Clock.qml 6 | 7 | -------------------------------------------------------------------------------- /tools/printslides/printslides.pro: -------------------------------------------------------------------------------- 1 | QT += gui qml quick widgets printsupport 2 | DESTDIR=$$(PWD) 3 | 4 | SOURCES += main.cpp slideview.cpp 5 | HEADERS += slideview.h 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/src.pro: -------------------------------------------------------------------------------- 1 | TARGETPATH=Qt/labs/presentation 2 | 3 | QML_FILES = \ 4 | Clock.qml \ 5 | CodeSlide.qml \ 6 | Presentation.qml \ 7 | Slide.qml \ 8 | SlideCounter.qml 9 | 10 | load(qml_module) 11 | -------------------------------------------------------------------------------- /tools/printslides/README.txt: -------------------------------------------------------------------------------- 1 | This program is a tool for printing slides that were 2 | created using the qt-labs qml-presentation-system 3 | 4 | Building requirements: 5 | 6 | Requires Qt 5.0.0 7 | qmake && make 8 | 9 | Instructions: 10 | ./printslides /path/to/your/presentation.qml 11 | 12 | Example: 13 | ./printslides ../../examples/tutorial/SlideDeck.qml 14 | 15 | Creates a "slides.pdf" file in your current directory. 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is a slide presentation system written in QML. 2 | 3 | 4 | 5 | Installing 6 | ---------- 7 | 8 | Do 'make install' in the root directory to install the files to QTDIR/imports 9 | 10 | Once that is done, all examples should run out of the box 11 | 12 | 13 | 14 | Organization 15 | ------------ 16 | 17 | There is a tutorial covering most features under: 18 | examples/tutorial/SlideDeck.qml 19 | This is a good place to start if you want to use it. 20 | 21 | Examples on more advanced presentations are located here: 22 | examples/customtransition/SlideDeck.qml 23 | examples/animatedbackground/SlideDeck.qml 24 | examples/notes/SlideDeck.qml 25 | 26 | The source code for the Slide and Presentation elements are located under: 27 | Qt/labs/presentation 28 | 29 | 30 | 31 | Usage Tips 32 | ---------- 33 | 34 | - The default size of presentations is hardcoded into the presentation .qml 35 | file. One can pass '--fullscreen' on the command line to qmlscene to show 36 | the presentation fullscreen. 37 | 38 | - under tools/printslides, there is a small tool to generate a slide deck 39 | .pdf file from your slide deck. 40 | -------------------------------------------------------------------------------- /examples/tutorial/SlideDeckRotated.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | Item 46 | { 47 | id: root 48 | 49 | height: 1280 50 | width: 720 51 | 52 | Item { 53 | rotation: 90 54 | SlideDeck { 55 | y: - root.width 56 | width: root.height 57 | height: root.width 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /examples/customtransition/SlideDeckRotated.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | Item 46 | { 47 | id: root 48 | 49 | height: 1280 50 | width: 720 51 | 52 | Item { 53 | rotation: 90 54 | SlideDeck { 55 | y: - root.width 56 | width: root.height 57 | height: root.width 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /examples/animatedbackground/SlideDeckRotated.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | Item 46 | { 47 | id: root 48 | 49 | height: 1280 50 | width: 720 51 | 52 | Item { 53 | rotation: 90 54 | SlideDeck { 55 | y: - root.width 56 | width: root.height 57 | height: root.width 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/SlideCounter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | Text { 46 | id: counter; 47 | 48 | property real fontSize: parent.height * 0.05 49 | property real fontScale: 0.5; 50 | property color textColor: parent.textColor != undefined ? parent.textColor : "black" 51 | property string fontFamily: parent.fontFamily != undefined ? parent.fontFamily : "Helvetica" 52 | 53 | text: "# " + (parent.currentSlide + 1) + " / " + parent.slides.length; 54 | color: counter.textColor; 55 | font.family: counter.fontFamily; 56 | font.pixelSize: fontSize * fontScale; 57 | 58 | anchors.right: parent.right; 59 | anchors.bottom: parent.bottom; 60 | anchors.margins: font.pixelSize; 61 | } 62 | -------------------------------------------------------------------------------- /examples/tutorial/CodeSection.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | import QtQuick 2.0 43 | 44 | Rectangle 45 | { 46 | id: root 47 | 48 | property string text 49 | property real fontSize: parent.baseFontSize / 2 50 | 51 | gradient: Gradient { 52 | GradientStop { position: 0; color: "white" } 53 | GradientStop { position: 1; color: "darkGray" } 54 | } 55 | 56 | color: "lightGray" 57 | border.color: "darkGray" 58 | border.width: 2 59 | radius: 10 60 | 61 | x: parent.width / 2 62 | width: parent.width / 2 63 | height: parent.height 64 | 65 | Text { 66 | id: textItem 67 | anchors.fill: parent 68 | anchors.margins: 20 69 | text: root.text; 70 | font.family: "courier" 71 | font.pixelSize: root.fontSize 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /examples/animatedbackground/SlideDeck.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | import Qt.labs.presentation 1.0 46 | 47 | Presentation { 48 | width: 1280 49 | height: 720 50 | 51 | BackgroundSwirls {} 52 | 53 | textColor: "white" 54 | 55 | Slide { 56 | centeredText: "Animated Background" 57 | fontScale: 2 58 | } 59 | 60 | Slide { 61 | title: "Composition" 62 | content: [ 63 | "Gradient Rectangle", 64 | "Swirls using ShaderEffect", 65 | " Movement using a vertexShader", 66 | " Colorized using a gradient rect converted to a texture", 67 | " Controlled using QML properties and animations", 68 | "Snow", 69 | " Using 'QtQuick.Particles 2.0'", 70 | " Emitter", 71 | " ImageParticle" 72 | ] 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /tools/printslides/slideview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | #ifndef SLIDEVIEW_H 44 | #define SLIDEVIEW_H 45 | 46 | #include 47 | #include 48 | #include 49 | 50 | /** A class for viewing and printing a QML Presentation with Slides. 51 | Assumes the root object of the QML file that was loaded is derived from 52 | Presentation from qt-labs qml-presentation-system 53 | @author Alan Ezust 54 | */ 55 | class SlideView : public QQuickView { 56 | Q_OBJECT 57 | public: 58 | SlideView(QWindow* parent=0); 59 | public slots: 60 | void updateStatus(QQuickView::Status); 61 | void timerEvent(QTimerEvent* evt); 62 | void printCurrentSlide(); 63 | void goToNextSlide(); 64 | 65 | private: 66 | int m_slidesLeft; 67 | int m_printedSlides; 68 | int m_tid; 69 | 70 | QPrinter m_printer; 71 | QPainter m_painter; 72 | }; 73 | 74 | #endif // #ifndef SLIDEVIEW_H 75 | -------------------------------------------------------------------------------- /src/Clock.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | 44 | import QtQuick 2.0 45 | 46 | Text { 47 | id: clock 48 | 49 | property real fontSize: parent.height * 0.05 50 | property real fontScale: 0.5 51 | property color textColor: parent.textColor != undefined ? parent.textColor : "black" 52 | property string fontFamily: parent.fontFamily != undefined ? parent.fontFamily : "Helvetica" 53 | 54 | text: currentTime(); 55 | 56 | function currentTime() { 57 | var d = new Date(); 58 | var m = d.getMinutes(); 59 | if (m < 10) m = "0" + m; 60 | return d.getHours() + ":" + m; 61 | } 62 | 63 | color: textColor; 64 | font.family: fontFamily; 65 | font.pixelSize: fontSize * fontScale; 66 | 67 | anchors.bottom: parent.bottom; 68 | anchors.left: parent.left; 69 | anchors.margins: font.pixelSize; 70 | 71 | Timer { 72 | interval: 60000; 73 | repeat: true; 74 | running: true 75 | onTriggered: clock.text = clock.currentTime(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /tools/printslides/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | #include 44 | #include "slideview.h" 45 | 46 | /** PrintSlides main program. 47 | A program to print qt-labs qml-presentation-system Presentations. 48 | @author ezust@ics.com 49 | */ 50 | int main (int argc, char* argv[]) { 51 | QGuiApplication app(argc, argv); 52 | app.setOrganizationDomain("com"); 53 | app.setOrganizationName("ics"); 54 | app.setApplicationName("printslides"); 55 | app.setApplicationVersion("0.2"); 56 | app.setApplicationDisplayName("QML Presentation Slide Printer"); 57 | SlideView mainView; 58 | argc = app.arguments().length(); 59 | if ((argc != 2) || app.arguments()[1].endsWith("?")) { 60 | QString progName = app.applicationName(); 61 | QString message = QString().arg(progName); 62 | qFatal("%s usage: \n\t %s path/to/presentation.qml\n" 63 | "Displays and prints each slides to slides.pdf\n", 64 | progName.toLocal8Bit().constData(), 65 | progName.toLocal8Bit().constData()); 66 | return 2; 67 | } 68 | mainView.setSource(app.arguments()[1]); 69 | mainView.show(); 70 | return app.exec(); 71 | } 72 | -------------------------------------------------------------------------------- /examples/customtransition/SlideDeck.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import Qt.labs.presentation 1.0 44 | import QtQuick 2.0 45 | 46 | OpacityTransitionPresentation 47 | { 48 | Slide { 49 | title: "Custom Transitions, 1" 50 | centeredText: "The Presentation {} Element has a 'switchSlides(from, to, forward)' function which will be called whenever a transition between slides should take place." 51 | } 52 | 53 | Slide { 54 | title: "Custom Transitions, 2" 55 | centeredText: 56 | "Re-implement this function and add your own transition for the slides. " 57 | } 58 | 59 | Slide { 60 | title: "Custom Transitions, 3" 61 | content: [ 62 | "'from' slide", 63 | " opacity fades out", 64 | " scale increases slightly", 65 | "'to' slide", 66 | " opacity fades in", 67 | " scale increases from small to normal", 68 | "All with a fairly simple ParallelAnimation {}" 69 | ] 70 | } 71 | 72 | Slide { 73 | title: "Custom Transition, 4" 74 | centeredText: "The transition works whichever way you go...\nLets go back to the beginning..." 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /examples/notes/SlideDeck.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | 44 | import QtQuick 2.0 45 | import Qt.labs.presentation 1.0 46 | 47 | Presentation { 48 | 49 | width: 1280 50 | height: 720 51 | 52 | Rectangle { 53 | anchors.fill: parent 54 | gradient: Gradient { 55 | GradientStop { position: 0.16; color: "black" } 56 | GradientStop { position: 0.17; color: "white" } 57 | GradientStop { position: 0.92; color: "white" } 58 | GradientStop { position: 0.93; color: "black" } 59 | } 60 | } 61 | 62 | Clock { textColor: "white" } 63 | SlideCounter { textColor: "white" } 64 | 65 | titleColor: "white" 66 | 67 | showNotes: true 68 | 69 | Slide { 70 | id: firstSlide; 71 | centeredText: "Using Notes..." 72 | fontScale: 2 73 | notes: "In this window you will see the notes for the very first slide..." 74 | } 75 | 76 | CodeSlide { 77 | title: "Enable using Presentation.showNotes" 78 | notes: "Here you can see the code required to enable the slides view. 79 | 80 | It is as simple as setting 'showNotes: true' in the Presentation {} element and then add a text to the 'notes' property of the Slide. 81 | 82 | The text will then update automatically as you go from slide to slide." 83 | code: 84 | "Presentation { 85 | showNotes: true; 86 | 87 | Slide { 88 | title: 'Slide One' 89 | content: ['bullet point', 'bullet point']; 90 | notes: 'Here cometh the notes...' 91 | } 92 | " 93 | } 94 | 95 | Slide { 96 | title: "Example Slide" 97 | content: [ 98 | "There should be a second window on your desktop", 99 | "It should read 'once upon a time'", 100 | "", 101 | "Try changing the slide..." 102 | ] 103 | notes: "once upon a time..." 104 | } 105 | 106 | Slide { 107 | title: "Second Example Slide" 108 | content: [ 109 | "The text on the second window should now change", 110 | "The notes window shows plain text with plain line brakes only" 111 | ] 112 | notes: 113 | "This is the second example slide... 114 | 115 | This notes system uses the QtQuick.Window element to pop up a second window. Quite simple and quite convenient..." 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /examples/animatedbackground/BackgroundSwirls.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | import QtQuick.Particles 2.0 45 | 46 | Item { 47 | anchors.fill: parent 48 | 49 | Rectangle { 50 | anchors.fill: parent 51 | gradient: Gradient { 52 | GradientStop { position: 0; color: "lightsteelblue" } 53 | GradientStop { position: 1; color: "black" } 54 | } 55 | } 56 | 57 | Rectangle { 58 | id: colorTableItem 59 | width: 16 60 | height: 16 61 | anchors.fill: parent 62 | 63 | property color color1: Qt.rgba(0.8, 0.8, 1, 0.3) 64 | property color color2: Qt.rgba(0.8, 0.8, 1, 0.3) 65 | 66 | gradient: Gradient { 67 | GradientStop { position: 0.0; color: "transparent"} 68 | GradientStop { position: 0.05; color: colorTableItem.color1 } 69 | GradientStop { position: 0.3; color: "transparent" } 70 | GradientStop { position: 0.7; color: "transparent" } 71 | GradientStop { position: 0.95; color: colorTableItem.color2 } 72 | GradientStop { position: 1.0; color: "transparent" } 73 | } 74 | 75 | visible: false 76 | } 77 | 78 | ShaderEffectSource { 79 | id: colorTableSource 80 | sourceItem: colorTableItem 81 | smooth: true 82 | } 83 | 84 | Repeater { 85 | model: 4 86 | Swirl { 87 | 88 | width: parent.width 89 | anchors.bottom: parent.bottom 90 | height: parent.height / (2 + index) 91 | opacity: 0.3 92 | speed: (index + 1) / 5 93 | colorTable: colorTableSource 94 | } 95 | } 96 | 97 | ParticleSystem{ 98 | id: particles 99 | } 100 | ImageParticle{ 101 | anchors.fill: parent 102 | system: particles 103 | source: "particle.png" 104 | alpha: 0 105 | colorVariation: 0.3 106 | } 107 | 108 | Emitter{ 109 | anchors.fill: parent 110 | system: particles 111 | emitRate: Math.sqrt(parent.width * parent.height) / 30 112 | lifeSpan: 2000 113 | size: 4 114 | sizeVariation: 2 115 | 116 | acceleration: AngleDirection { angle: 90; angleVariation: 360; magnitude: 20; } 117 | velocity: AngleDirection { angle: -90; angleVariation: 360; magnitude: 10; } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /examples/animatedbackground/Swirl.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | ShaderEffect { 46 | id: shader 47 | 48 | width: 400 49 | height: 300 50 | 51 | property real speed: 1 52 | 53 | property color d: Qt.rgba(Math.random() * 0.7, 54 | Math.random() * 0.5, 55 | Math.random() * 0.7, 56 | Math.random() * 0.5) 57 | property real tx 58 | NumberAnimation on tx { from: 0; to: Math.PI * 2; duration: (Math.random() * 30 + 30) * 1000 / speed; loops: Animation.Infinite } 59 | property real ty 60 | NumberAnimation on ty { from: 0; to: Math.PI * 2; duration: (Math.random() * 30 + 30) * 1000 / speed; loops: Animation.Infinite } 61 | property real tz 62 | NumberAnimation on tz { from: 0; to: Math.PI * 2; duration: (Math.random() * 30 + 30) * 1000 / speed; loops: Animation.Infinite } 63 | property real tw 64 | NumberAnimation on tw { from: 0; to: Math.PI * 2; duration: (Math.random() * 30 + 30) * 1000 / speed; loops: Animation.Infinite } 65 | 66 | property real amplitude: height / 2 67 | 68 | property variant colorTable: ShaderEffectSource { sourceItem: Rectangle { width: 4; height: 4; color: "steelblue" } } 69 | 70 | fragmentShader: " 71 | uniform lowp float qt_Opacity; 72 | uniform lowp sampler2D colorTable; 73 | varying highp vec2 qt_TexCoord0; 74 | 75 | void main() { 76 | gl_FragColor = texture2D(colorTable, qt_TexCoord0); 77 | gl_FragColor.w *= qt_Opacity; 78 | } 79 | " 80 | 81 | vertexShader: " 82 | uniform lowp vec4 d; 83 | uniform highp float tx; 84 | uniform highp float ty; 85 | uniform highp float tz; 86 | uniform highp float tw; 87 | uniform highp float amplitude; 88 | uniform highp mat4 qt_Matrix; 89 | attribute highp vec4 qt_Vertex; 90 | attribute highp vec2 qt_MultiTexCoord0; 91 | varying highp vec2 qt_TexCoord0; 92 | 93 | void main() { 94 | highp vec4 pos = qt_Vertex; 95 | 96 | highp float y1 = sin(tx + d.x * qt_MultiTexCoord0.x * 17. + 2. * d.y) + sin(ty + d.z * qt_MultiTexCoord0.x * 11. + 5. * d.w); 97 | highp float y2 = sin(tz + d.w * qt_MultiTexCoord0.x * 7. + 3. * d.z) + sin(tw + d.y * qt_MultiTexCoord0.x * 19. + 3. * d.x); 98 | 99 | pos.y += mix(y1, y2, qt_MultiTexCoord0.y) * amplitude * 0.5; 100 | 101 | gl_Position = qt_Matrix * pos; 102 | qt_TexCoord0 = qt_MultiTexCoord0; 103 | } 104 | " 105 | 106 | mesh: GridMesh { resolution: Qt.size(width / 10, 4) } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /tools/printslides/slideview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include "slideview.h" 49 | 50 | SlideView::SlideView(QWindow* parent): QQuickView(parent), 51 | m_slidesLeft(0), m_printedSlides(0) { 52 | connect (this, SIGNAL(statusChanged(QQuickView::Status)), 53 | this, SLOT(updateStatus(QQuickView::Status))); 54 | } 55 | 56 | void SlideView::updateStatus(QQuickView::Status status) { 57 | if (m_slidesLeft > 0) return; 58 | if (status != QQuickView::Ready) return; 59 | QQuickItem *ri = rootObject(); 60 | QString superClass = ri->metaObject()->superClass()->className(); 61 | if (!superClass.startsWith("Presentation")) { 62 | qWarning("Warning: Superclass appears to not be a Presentation: %s. ", superClass.toLocal8Bit().constData()); 63 | } 64 | else qDebug() << "Found qml Presentation as rootObject"; 65 | 66 | ri->setProperty("allowDelay", QVariant(false));//Disable partial reveals on slide pages 67 | QList slides = ri->property("slides").toList(); 68 | m_slidesLeft = slides.size(); 69 | qDebug() << "SlideCount: " << m_slidesLeft; 70 | qDebug() << "Printer's Page rect size (and suggested resolution of your presentation): " << m_printer.pageRect().size(); 71 | m_printer.setOrientation(QPrinter::Landscape); 72 | m_printer.setFullPage(true); 73 | m_printer.setOutputFileName("slides.pdf"); 74 | m_painter.begin(&m_printer); 75 | 76 | // it would be better if we used the printer resolution here and forced 77 | // the presentation to be in the same resolution but when I try that, 78 | // the timer doesn't work properly for some reason? 79 | 80 | setHeight(ri->height()); 81 | setWidth(ri->width()); 82 | 83 | // Try uncommenting the below 4 lines and see what happens. 84 | //setHeight(m_printer.pageRect().height()); 85 | //setWidth(m_printer.pageRect().width()); 86 | //ri->setHeight(height()); 87 | //ri->setWidth(width()); 88 | 89 | // start timer to print out pages once every 2 seconds. 90 | m_tid = startTimer(2000); 91 | } 92 | 93 | void SlideView::timerEvent(QTimerEvent*) { 94 | printCurrentSlide(); 95 | ++m_printedSlides; 96 | --m_slidesLeft; 97 | if (m_slidesLeft > 0) { 98 | m_printer.newPage(); 99 | goToNextSlide(); 100 | } 101 | else { 102 | killTimer(m_tid); 103 | m_painter.end(); 104 | qDebug() << "Printed to file: " << m_printer.outputFileName(); 105 | qApp->exit(); 106 | } 107 | 108 | } 109 | 110 | 111 | void SlideView::printCurrentSlide() { 112 | QImage pix = grabWindow(); 113 | qDebug() << "Printing slide#" << m_printedSlides + 1 << "Resolution:" << pix.size(); 114 | 115 | QRect pageRect = m_printer.pageRect(); 116 | QSize targetSize = pix.size(); 117 | targetSize.scale(pageRect.width(), pageRect.height(), Qt::KeepAspectRatio); 118 | 119 | m_painter.drawImage(QRectF(pageRect.topLeft(), targetSize), pix); 120 | } 121 | 122 | void SlideView::goToNextSlide() { 123 | static const QMetaObject* meta = rootObject()->metaObject(); 124 | meta->invokeMethod(rootObject(), "goToNextSlide"); 125 | } 126 | -------------------------------------------------------------------------------- /examples/customtransition/OpacityTransitionPresentation.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | import Qt.labs.presentation 1.0 45 | 46 | Presentation { 47 | 48 | id: deck 49 | 50 | width: 1280 51 | height: 720 52 | 53 | textColor: "white" 54 | 55 | property bool inTransition: false; 56 | 57 | property variant fromSlide; 58 | property variant toSlide; 59 | 60 | property int transitionTime: 500; 61 | 62 | Rectangle { 63 | anchors.fill: parent 64 | gradient: Gradient { 65 | GradientStop { position: 0; color: "lightsteelblue" } 66 | GradientStop { position: 1; color: "black" } 67 | } 68 | } 69 | 70 | SequentialAnimation { 71 | id: forwardTransition 72 | PropertyAction { target: deck; property: "inTransition"; value: true } 73 | PropertyAction { target: toSlide; property: "visible"; value: true } 74 | ParallelAnimation { 75 | NumberAnimation { target: fromSlide; property: "opacity"; from: 1; to: 0; duration: deck.transitionTime; easing.type: Easing.OutQuart } 76 | NumberAnimation { target: fromSlide; property: "scale"; from: 1; to: 1.1; duration: deck.transitionTime; easing.type: Easing.InOutQuart } 77 | NumberAnimation { target: toSlide; property: "opacity"; from: 0; to: 1; duration: deck.transitionTime; easing.type: Easing.InQuart } 78 | NumberAnimation { target: toSlide; property: "scale"; from: 0.7; to: 1; duration: deck.transitionTime; easing.type: Easing.InOutQuart } 79 | } 80 | PropertyAction { target: fromSlide; property: "visible"; value: false } 81 | PropertyAction { target: fromSlide; property: "scale"; value: 1 } 82 | PropertyAction { target: deck; property: "inTransition"; value: false } 83 | } 84 | SequentialAnimation { 85 | id: backwardTransition 86 | running: false 87 | PropertyAction { target: deck; property: "inTransition"; value: true } 88 | PropertyAction { target: toSlide; property: "visible"; value: true } 89 | ParallelAnimation { 90 | NumberAnimation { target: fromSlide; property: "opacity"; from: 1; to: 0; duration: deck.transitionTime; easing.type: Easing.OutQuart } 91 | NumberAnimation { target: fromSlide; property: "scale"; from: 1; to: 0.7; duration: deck.transitionTime; easing.type: Easing.InOutQuart } 92 | NumberAnimation { target: toSlide; property: "opacity"; from: 0; to: 1; duration: deck.transitionTime; easing.type: Easing.InQuart } 93 | NumberAnimation { target: toSlide; property: "scale"; from: 1.1; to: 1; duration: deck.transitionTime; easing.type: Easing.InOutQuart } 94 | } 95 | PropertyAction { target: fromSlide; property: "visible"; value: false } 96 | PropertyAction { target: fromSlide; property: "scale"; value: 1 } 97 | PropertyAction { target: deck; property: "inTransition"; value: false } 98 | } 99 | 100 | function switchSlides(from, to, forward) 101 | { 102 | if (deck.inTransition) 103 | return false 104 | 105 | deck.fromSlide = from 106 | deck.toSlide = to 107 | 108 | if (forward) 109 | forwardTransition.running = true 110 | else 111 | backwardTransition.running = true 112 | 113 | return true 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/CodeSlide.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.0 44 | 45 | Slide { 46 | id: slide; 47 | 48 | property string codeFontFamily: parent.codeFontFamily; 49 | property string code; 50 | property real codeFontSize: baseFontSize * 0.6; 51 | 52 | 53 | 54 | Rectangle { 55 | id: background 56 | anchors.fill: parent 57 | radius: height / 10; 58 | gradient: Gradient { 59 | GradientStop { position: 0; color: Qt.rgba(0.8, 0.8, 0.8, 0.5); } 60 | GradientStop { position: 1; color: Qt.rgba(0.2, 0.2, 0.2, 0.5); } 61 | } 62 | border.color: slide.textColor; 63 | border.width: height / 250; 64 | antialiasing: true 65 | } 66 | 67 | onCodeChanged: { 68 | listModel.clear(); 69 | var codeLines = slide.code.split("\n"); 70 | for (var i=0; i 0 143 | } 144 | 145 | visible: slide.writeInText != undefined; 146 | } 147 | 148 | 149 | Column { 150 | id: contentId 151 | anchors.fill: parent 152 | 153 | Repeater { 154 | model: content.length 155 | 156 | Row { 157 | id: row 158 | 159 | function decideIndentLevel(s) { return s.charAt(0) == " " ? 1 + decideIndentLevel(s.substring(1)) : 0 } 160 | property int indentLevel: decideIndentLevel(content[index]) 161 | property int nextIndentLevel: index < content.length - 1 ? decideIndentLevel(content[index+1]) : 0 162 | property real indentFactor: (10 - row.indentLevel * 2) / 10; 163 | 164 | height: text.height + (nextIndentLevel == 0 ? 1 : 0.3) * slide.baseFontSize * slide.bulletSpacing 165 | x: slide.baseFontSize * indentLevel 166 | visible: (!slide.parent.allowDelay || !delayPoints) || index <= _pointCounter 167 | 168 | Rectangle { 169 | id: dot 170 | anchors.baseline: text.baseline 171 | anchors.baselineOffset: -text.font.pixelSize / 2 172 | width: text.font.pixelSize / 3 173 | height: text.font.pixelSize / 3 174 | color: slide.textColor 175 | radius: width / 2 176 | opacity: text.text.length == 0 ? 0 : 1 177 | } 178 | 179 | Item { 180 | id: space 181 | width: dot.width * 1.5 182 | height: 1 183 | } 184 | 185 | Text { 186 | id: text 187 | width: slide.contentWidth - parent.x - dot.width - space.width 188 | font.pixelSize: baseFontSize * row.indentFactor 189 | text: content[index] 190 | textFormat: slide.textFormat 191 | wrapMode: Text.WordWrap 192 | color: slide.textColor 193 | horizontalAlignment: Text.AlignLeft 194 | font.family: slide.fontFamily 195 | } 196 | } 197 | } 198 | } 199 | 200 | } 201 | -------------------------------------------------------------------------------- /src/Presentation.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import QtQuick 2.5 44 | import QtQuick.Window 2.0 45 | 46 | Item { 47 | id: root 48 | 49 | property variant slides: [] 50 | property int currentSlide: 0 51 | 52 | property bool showNotes: false; 53 | property bool allowDelay: true; 54 | property alias mouseNavigation: mouseArea.enabled 55 | property bool arrowNavigation: true 56 | property bool keyShortcutsEnabled: true 57 | 58 | property color titleColor: textColor; 59 | property color textColor: "black" 60 | property string fontFamily: "Helvetica" 61 | property string codeFontFamily: "Courier New" 62 | 63 | // Private API 64 | property bool _faded: false 65 | property int _userNum; 66 | property int _lastShownSlide: 0 67 | 68 | Component.onCompleted: { 69 | var slideCount = 0; 70 | var slides = []; 71 | for (var i=0; i 0) 83 | root.slides[root.currentSlide].visible = true; 84 | } 85 | 86 | function switchSlides(from, to, forward) { 87 | from.visible = false 88 | to.visible = true 89 | return true 90 | } 91 | 92 | onCurrentSlideChanged: { 93 | switchSlides(root.slides[_lastShownSlide], root.slides[currentSlide], currentSlide > _lastShownSlide) 94 | _lastShownSlide = currentSlide 95 | } 96 | 97 | function goToNextSlide() { 98 | root._userNum = 0 99 | if (_faded) 100 | return 101 | if (root.slides[currentSlide].delayPoints) { 102 | if (root.slides[currentSlide]._advance()) 103 | return; 104 | } 105 | if (currentSlide + 1 < root.slides.length) 106 | ++currentSlide; 107 | } 108 | 109 | function goToPreviousSlide() { 110 | root._userNum = 0 111 | if (root._faded) 112 | return 113 | if (currentSlide - 1 >= 0) 114 | --currentSlide; 115 | } 116 | 117 | function goToUserSlide() { 118 | --_userNum; 119 | if (root._faded || _userNum >= root.slides.length) 120 | return 121 | if (_userNum < 0) 122 | goToNextSlide() 123 | else { 124 | currentSlide = _userNum; 125 | root.focus = true; 126 | } 127 | } 128 | 129 | // directly type in the slide number: depends on root having focus 130 | Keys.onPressed: { 131 | if (event.key >= Qt.Key_0 && event.key <= Qt.Key_9) 132 | _userNum = 10 * _userNum + (event.key - Qt.Key_0) 133 | else { 134 | if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter) 135 | goToUserSlide(); 136 | _userNum = 0; 137 | } 138 | } 139 | 140 | // navigate with arrow keys 141 | Shortcut { sequence: StandardKey.MoveToNextLine; enabled: root.arrowNavigation; onActivated: goToNextSlide() } 142 | Shortcut { sequence: StandardKey.MoveToPreviousLine; enabled: root.arrowNavigation; onActivated: goToPreviousSlide() } 143 | Shortcut { sequence: StandardKey.MoveToNextChar; enabled: root.arrowNavigation; onActivated: goToNextSlide() } 144 | Shortcut { sequence: StandardKey.MoveToPreviousChar; enabled: root.arrowNavigation; onActivated: goToPreviousSlide() } 145 | 146 | // presentation-specific single-key shortcuts (which interfere with normal typing) 147 | Shortcut { sequence: " "; enabled: root.keyShortcutsEnabled; onActivated: goToNextSlide() } 148 | Shortcut { sequence: "c"; enabled: root.keyShortcutsEnabled; onActivated: root._faded = !root._faded } 149 | 150 | // standard shortcuts 151 | Shortcut { sequence: StandardKey.MoveToNextPage; onActivated: goToNextSlide() } 152 | Shortcut { sequence: StandardKey.MoveToPreviousPage; onActivated: goToPreviousSlide() } 153 | Shortcut { sequence: StandardKey.Quit; onActivated: Qt.quit() } 154 | 155 | Rectangle { 156 | z: 1000 157 | color: "black" 158 | anchors.fill: parent 159 | opacity: root._faded ? 1 : 0 160 | Behavior on opacity { NumberAnimation { duration: 250 } } 161 | } 162 | 163 | MouseArea { 164 | id: mouseArea 165 | anchors.fill: parent 166 | acceptedButtons: Qt.LeftButton | Qt.RightButton 167 | onClicked: { 168 | if (mouse.button == Qt.RightButton) 169 | goToPreviousSlide() 170 | else 171 | goToNextSlide() 172 | } 173 | onPressAndHold: goToPreviousSlide(); //A back mechanism for touch only devices 174 | } 175 | 176 | Window { 177 | id: notesWindow; 178 | width: 400 179 | height: 300 180 | 181 | title: "QML Presentation: Notes" 182 | visible: root.showNotes 183 | 184 | Flickable { 185 | anchors.fill: parent 186 | contentWidth: parent.width 187 | contentHeight: textContainer.height 188 | 189 | Item { 190 | id: textContainer 191 | width: parent.width 192 | height: notesText.height + 2 * notesText.padding 193 | 194 | Text { 195 | id: notesText 196 | 197 | property real padding: 16; 198 | 199 | x: padding 200 | y: padding 201 | width: parent.width - 2 * padding 202 | 203 | 204 | font.pixelSize: 16 205 | wrapMode: Text.WordWrap 206 | 207 | property string notes: root.slides[root.currentSlide].notes; 208 | 209 | onNotesChanged: { 210 | var result = ""; 211 | 212 | var lines = notes.split("\n"); 213 | var beginNewLine = false 214 | for (var i=0; i 0) 224 | result += " "; 225 | result += line; 226 | } 227 | } 228 | 229 | if (result.length == 0) { 230 | font.italic = true; 231 | text = "no notes.." 232 | } else { 233 | font.italic = false; 234 | text = result; 235 | } 236 | } 237 | } 238 | } 239 | } 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /examples/tutorial/SlideDeck.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QML Presentation System. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | 43 | import Qt.labs.presentation 1.0 44 | import QtQuick 2.0 45 | 46 | Presentation 47 | { 48 | id: presentation 49 | 50 | width: 1280 51 | height: 720 52 | 53 | SlideCounter {} 54 | Clock {} 55 | 56 | 57 | Slide { 58 | centeredText: "Use [space] or [keypad] to see intro" 59 | } 60 | 61 | Slide { 62 | title: "Presentation {} Element" 63 | content: [ 64 | "Toplevel element", 65 | "Defines background", 66 | "Foreground color", 67 | ] 68 | 69 | CodeSection { 70 | text: "Presentation 71 | { 72 | width: 640 73 | height: 360 74 | 75 | // Define a background color... 76 | Rectangle { 77 | anchors.fill: parent 78 | color: \"white\" 79 | } 80 | 81 | property color textColor: \"black\" 82 | 83 | // Then define slide elements 84 | Slide { ... } 85 | Slide { ... } 86 | Slide { ... } 87 | ... 88 | }" 89 | } 90 | } 91 | 92 | 93 | Slide { 94 | title: "Slide {} Element" 95 | content: [ 96 | "Bullet points", 97 | "Should be short", 98 | "And to the point", 99 | " Sub point", 100 | " Sub Sub point", 101 | " Sub point" 102 | ] 103 | 104 | CodeSection { 105 | 106 | text: "Slide {\n" + 107 | " id: areaSlide\n" + 108 | " title: \"Slide {} Element\"\n" + 109 | " content: [\n" + 110 | " \"Bullet points\",\n" + 111 | " \"Should be short\",\n" + 112 | " \"And to the point\",\n" + 113 | " \" Sub point\",\n" + 114 | " \" Sub Sub point\",\n" + 115 | " \" Sub point\"\n" + 116 | " ]\n" + 117 | "}\n" 118 | } 119 | } 120 | 121 | Slide { 122 | title: "Slide {}, continued" 123 | Rectangle { 124 | anchors.fill: parent 125 | color: "lightGray" 126 | Text { 127 | text: "Slide fills this area..." 128 | anchors.centerIn: parent 129 | } 130 | } 131 | } 132 | 133 | Slide { 134 | id: fillAreaSlide 135 | title: "Slide {}, continued" 136 | content: ["The built-in property \"contentWidth\" can be used to let the bullet points fill a smaller area of the slide..."] 137 | 138 | SequentialAnimation on contentWidth { 139 | PropertyAction { value: fillAreaSlide.width } 140 | PauseAnimation { duration: 2500 } 141 | NumberAnimation { to: fillAreaSlide.width / 2; duration: 5000; easing.type: Easing.InOutCubic } 142 | running: fillAreaSlide.visible 143 | } 144 | 145 | Rectangle { 146 | height: parent.height 147 | width: parent.contentWidth 148 | 149 | color: "lightGray" 150 | z: -1 151 | } 152 | } 153 | 154 | Slide { 155 | title: "Slide {}, continued" 156 | centeredText: "Use the predefined centeredText property to put a single block of text at the center of the Slide{}" 157 | } 158 | 159 | Slide { 160 | title: "Slide {}, continued" 161 | centeredText: 'Use rich text, if you like...' 162 | } 163 | 164 | Slide { 165 | title: "Slide {}, continued" 166 | writeInText: "You can also use the 'writeInText' property for text that should appear character-by-character, like this...\n\n\nProin vulputate pretium tortor, ut bibendum nisi ultricies et. Nullam pharetra tincidunt lorem eu consequat. Sed placerat sem non lacus dictum at lobortis tellus molestie. Fusce sit amet iaculis odio. Ut dictum nibh quis justo lacinia pulvinar. In hac habitasse platea dictumst. Aliquam erat volutpat." 167 | } 168 | 169 | 170 | CodeSlide { 171 | title: "CodeSlide {} Element" 172 | code: 173 | "CodeSlide { 174 | title: \"CodeSlide {} Element\" 175 | code: 176 | \" 177 | // Whitespaces are preserved, 178 | // so we start at the beginning of the line... 179 | 180 | // You can mouse click on any line 181 | 182 | // Navigate with keypad when the code has focus 183 | 184 | int main(int argc, char **argv) { 185 | QGuiApplication app; 186 | QWindow window; 187 | window.show(); 188 | return app.exec(); 189 | } 190 | \" " 191 | } 192 | 193 | Slide { 194 | title: "Font size relative to screen size" 195 | content: [ 196 | "Which means you don't need to worry about it", 197 | "Bullet points wrap around on the edges, regardless of how long they are, like this. Even if you should choose to use a very long bullet point (which would distract your audience) it would still look ok'ish", 198 | "If you run out of height, you're out of luck though..." 199 | ] 200 | } 201 | 202 | 203 | 204 | Slide { 205 | id: interactiveSlide 206 | 207 | title: "Embed Interactive Content" 208 | 209 | Rectangle { 210 | id: box 211 | width: parent.fontSize * 10 212 | height: width 213 | color: mouse.pressed ? "lightsteelblue" : "steelblue" 214 | 215 | NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite; running: visible } 216 | 217 | Text { 218 | text: "Click Me!" 219 | anchors.centerIn: parent 220 | } 221 | 222 | MouseArea { 223 | id: mouse 224 | anchors.fill: parent 225 | drag.target: box 226 | } 227 | } 228 | } 229 | 230 | 231 | Slide { 232 | title: "Features" 233 | centeredText: 'Hit [C] to fade out the current page if there are questions from the audience' 234 | } 235 | 236 | Slide { 237 | title: "Features" 238 | centeredText: 'Navigate back and forth using [left] and [right]\n[space] or [click] takes you to the next slide.' 239 | } 240 | 241 | CodeSlide { 242 | title: "Slide Counter" 243 | code: 244 | "Presentation { 245 | 246 | SlideCounter { 247 | // Defaults: 248 | // anchors.right: parent.right 249 | // anchors.bottom: parent.bottom 250 | // anchors.margins: fontSize; 251 | // textColor: 'black' 252 | // fontFamily: 'Helvetica' (from presentation) 253 | // fontScale: 0.5; 254 | } 255 | } 256 | 257 | Slide { 258 | ... 259 | } 260 | }" 261 | } 262 | 263 | CodeSlide { 264 | title: "Clock" 265 | code: 266 | "Presentation { 267 | 268 | Clock { 269 | // Defaults: 270 | // anchors.let: parent.left 271 | // anchors.bottom: parent.bottom 272 | // anchors.margins: fontSize; 273 | // textColor: 'black' 274 | // fontFamily: 'Helvetica' (from presentation) 275 | // fontScale: 0.5; 276 | } 277 | } 278 | 279 | Slide { 280 | ... 281 | } 282 | }" 283 | } 284 | 285 | Slide { 286 | title: "Customizations" 287 | titleColor: "white" 288 | 289 | textColor: "green" 290 | fontFamily: "Times New Roman" 291 | 292 | Rectangle { 293 | x: -parent.x 294 | y: -parent.y 295 | width: presentation.width 296 | height: parent.y * 0.9 297 | color: "black" 298 | } 299 | 300 | content: [ 301 | "Bullet points, centered text, write-in-text or code listings, can be changed using 'textColor'", 302 | "Title can be changed with 'textColor'", 303 | "Font can be changed using 'fontFamily'", 304 | "Change 'fontScale' for bigger or smaller fonts", 305 | "All can be set globally on the presentation (and then inherited in all Slide {} elements), or set directly on a specific Slide {} element." 306 | ] 307 | } 308 | 309 | CodeSlide { 310 | title: "Slide Notes in Another Window" 311 | code: 312 | "Presentation { 313 | showNotes: true; 314 | 315 | Slide { 316 | title: 'Slide One' 317 | content: ['bullet point', 'bullet point']; 318 | notes: 'Here cometh the notes...' 319 | } 320 | 321 | ... 322 | 323 | // Check out examples/notes for a running example 324 | } 325 | " 326 | } 327 | 328 | 329 | Slide { 330 | centeredText: "Now go make our own presentations\n\nEnjoy!" 331 | } 332 | 333 | 334 | } 335 | --------------------------------------------------------------------------------