summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2019-01-24 13:45:24 +0100
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-01-24 13:18:00 +0000
commit7648d428cd7316d490ab5739ac9516edde442467 (patch)
tree983c4f9c89cecd9790af07aef58e8431bc293581
parent888fb0ca5d5e18fe5d8b88ed721544bf204ac158 (diff)
Doc: Add basic documentation structure and fix .qhp generation
- Added the necessary details to the .qdocconf - Added the index page and the qt.labs.lottieqt module page - Fixed all qdoc warnings Besides these, cleaned up the .qdocconf, renamed it to be in line with other Qt module docs, and marked the module to be in Technology Preview. Change-Id: I6bdd125aa961cb3bcdd13c30003af8b2c0f4ff27 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--src/imports/doc/lottieanimation.qdocconf14
-rw-r--r--src/imports/doc/lottieanimationdoc1
-rw-r--r--src/imports/doc/qtlottieanimation.qdocconf37
-rw-r--r--src/imports/doc/src/external-resources.qdoc36
-rw-r--r--src/imports/doc/src/qtlottie.qdoc74
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/lottieanimation.cpp105
7 files changed, 209 insertions, 60 deletions
diff --git a/src/imports/doc/lottieanimation.qdocconf b/src/imports/doc/lottieanimation.qdocconf
deleted file mode 100644
index fc7e25f..0000000
--- a/src/imports/doc/lottieanimation.qdocconf
+++ /dev/null
@@ -1,14 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
-include($QT_INSTALL_DOCS/global/fileextensions.qdocconf)
-
-project = lottieqt
-description = Bodymovin player for Qt
-
-moduleheader = lottieanimationdoc
-includepaths = -I .
-
-outputdir = html
-
-headerdirs += ../..
-
-sourcedirs += ../..
diff --git a/src/imports/doc/lottieanimationdoc b/src/imports/doc/lottieanimationdoc
deleted file mode 100644
index 718bfa2..0000000
--- a/src/imports/doc/lottieanimationdoc
+++ /dev/null
@@ -1 +0,0 @@
-#include "../lottieanimation.h"
diff --git a/src/imports/doc/qtlottieanimation.qdocconf b/src/imports/doc/qtlottieanimation.qdocconf
new file mode 100644
index 0000000..eb5ca6f
--- /dev/null
+++ b/src/imports/doc/qtlottieanimation.qdocconf
@@ -0,0 +1,37 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+version = $QT_VERSION
+project = QtLottieAnimation
+description = Bodymovin Player for Qt
+
+headerdirs += ../..
+
+sourcedirs += ../..
+
+moduleheader = QtBodymovin
+
+depends += qtdoc qtqml qtquick
+
+qhp.projects = QtLottieAnimation
+
+qhp.QtLottieAnimation.file = qtlottieanimation.qhp
+qhp.QtLottieAnimation.namespace = org.qt-project.qtlottieanimation.$QT_VERSION_TAG
+qhp.QtLottieAnimation.virtualFolder = qtlottieanimation
+qhp.QtLottieAnimation.indexTitle = Qt Lottie Animation
+qhp.QtLottieAnimation.indexRoot =
+
+qhp.QtLottieAnimation.filterAttributes = qtlottieanimation $QT_VERSION qtrefdoc
+qhp.QtLottieAnimation.customFilters.Qt.name = QtLottieAnimation $QT_VERSION
+qhp.QtLottieAnimation.customFilters.Qt.filterAttributes = qtlottieanimation $QT_VERSION
+qhp.QtLottieAnimation.subprojects = qmltypes
+qhp.QtLottieAnimation.subprojects.qmltypes.title = QML Types
+qhp.QtLottieAnimation.subprojects.qmltypes.indexTitle = Qt Lottie Animation QML Types
+qhp.QtLottieAnimation.subprojects.qmltypes.selectors = qmltype
+qhp.QtLottieAnimation.subprojects.qmltypes.sortPages = true
+
+tagfile = qtlottieanimation.tags
+
+examplesinstallpath = lottieanimation
+
+navigation.landingpage = Qt Lottie Animation
+navigation.landingtitle = Qt Lottie Animation (Technology Preview)
+navigation.qmltypespage = Qt Lottie Animation QML Types
diff --git a/src/imports/doc/src/external-resources.qdoc b/src/imports/doc/src/external-resources.qdoc
new file mode 100644
index 0000000..00ca58e
--- /dev/null
+++ b/src/imports/doc/src/external-resources.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \externalpage https://aescripts.com/bodymovin/
+ \title Bodymovin
+*/
+
+/*!
+ \externalpage https://github.com/airbnb/lottie-web
+ \title Bodymovin Source
+*/
diff --git a/src/imports/doc/src/qtlottie.qdoc b/src/imports/doc/src/qtlottie.qdoc
new file mode 100644
index 0000000..c5bda6c
--- /dev/null
+++ b/src/imports/doc/src/qtlottie.qdoc
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtlottieanimation-index.html
+ \title Qt Lottie Animation
+ \brief Display graphics and animations
+ exported by the Bodymovin plugin for Adobe After Effects.
+
+ \e {Qt Lottie Animation} provides a QML API for rendering graphics and
+ animations that are exported in JSON format by the \l Bodymovin plugin
+ for Adobe After Effects.
+
+ \note This module is still in development and is provided as a technology
+ preview.
+
+ \section1 Getting Started
+
+//! [usage]
+ Import the types using the the following statement:
+
+ \qml
+ import Qt.labs.lottieqt 1.0
+ \endqml
+//! [usage]
+
+ See the \l {Bodymovin Source}{GitHub page for Bodymovin} for instructions
+ on how to download and install the plugin for Adobe After Effects.
+
+ \section1 Reference
+ \list
+ \li \l {Qt Lottie Animation QML Types}{QML Types}
+ \endlist
+
+ \section1 Related Information
+ \list
+ \li \l {Bodymovin Source}{Bodymovin on GitHub}
+ \endlist
+*/
+
+/*!
+ \qmlmodule Qt.labs.lottieqt 1.0
+ \title Qt Lottie Animation QML Types
+ \ingroup qmlmodules
+ \brief Provides QML types to display Bodymovin graphics and animations.
+
+ \include qtlottie.qdoc usage
+
+ \section1 QML Types
+*/
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 8d75727..61a840e 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -6,7 +6,7 @@ IMPORT_VERSION = 1.$$QT_MINOR_VERSION
QT += qml quick gui-private bodymovin-private
CONFIG += plugin c++11
-QMAKE_DOCS = $$PWD/doc/lottieanimation.qdocconf
+QMAKE_DOCS = $$PWD/doc/qtlottieanimation.qdocconf
# Input
SOURCES += \
diff --git a/src/imports/lottieanimation.cpp b/src/imports/lottieanimation.cpp
index f8eccd3..6d5fffa 100644
--- a/src/imports/lottieanimation.cpp
+++ b/src/imports/lottieanimation.cpp
@@ -57,7 +57,6 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
/*!
\qmltype LottieAnimation
- \instantiates LottieAnimation
\inqmlmodule Qt.labs.lottieqt
\since 5.13
\inherits Item
@@ -84,7 +83,7 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
The following example shows a simple usage of the LottieAnimation type
- \code
+ \qml
LottieAnimation {
loops: 2
quality: LottieAnimation.MediumQuality
@@ -101,14 +100,14 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
console.log("Finished playing")
}
}
- \endcode
+ \endqml
- Note: Changing width or height of the element does not change the size
+ \note Changing width or height of the element does not change the size
of the animation within. Also, it is not possible to align the the content
inside of a \c LottieAnimation element. To achieve this, position the
animation inside e.g. an \c Item.
- \section1 Rendering performance
+ \section1 Rendering Performance
Internally, the rendered frame data is cached to improve performance. You
can control the memory usage by setting the QLOTTIE_RENDER_CACHE_SIZE
@@ -135,17 +134,24 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
This property holds the current status of the LottieAnimation element.
- \list
- \li Null – An initial value that is used when the status is not defined (Default)
- \li Loading – the player is loading a Bodymovin file
- \li Ready – loading has finished successfully and the player is ready to play animtion
- \li Error – an error occurred while the loading
- \endlist
+ \value LottieAnimation.Null
+ An initial value that is used when the status is not defined
+ (Default)
+
+ \value LottieAnimation.Loading
+ The player is loading a Bodymovin file
+
+ \value LottieAnimation.Ready
+ Loading has finished successfully and the player is ready to play
+ the animation
- For example you could implement \c onStatusChanged signal
+ \value LottieAnimation.Error
+ An error occurred while loading the animation
+
+ For example, you could implement \c onStatusChanged signal
handler to monitor progress of loading an animation as follows:
- \code
+ \qml
LottieAnimation {
source: ":/animation.json"
autoPlay: false
@@ -153,7 +159,7 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
if (status === LottieAnimation.Ready)
start();
}
- \endcode
+ \endqml
*/
/*!
@@ -168,8 +174,8 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
/*!
\qmlproperty int LottieAnimation::loops
- This property holds how many loops the player will repeat.
- The value \c LottieAnimation.Inifite means, that the the player repeats
+ This property holds the number of loops the player will repeat.
+ The value \c LottieAnimation.Infinite means that the the player repeats
the animation continuously.
The default value is \c 1.
@@ -178,8 +184,8 @@ Q_LOGGING_CATEGORY(lcLottieQtBodymovinParser, "qt.lottieqt.bodymovin.parser");
/*!
\qmlsignal LottieAnimation::finished()
- Signal is emitted when the player has finished playing. In case of looping,
- the signal is emitted when the last loop has been finished.
+ This signal is emitted when the player has finished playing. In case of
+ looping, the signal is emitted when the last loop has been finished.
*/
LottieAnimation::LottieAnimation(QQuickItem *parent)
@@ -260,7 +266,7 @@ void LottieAnimation::paint(QPainter *painter)
The path of the Bodymovin asset that LottieAnimation plays.
Setting the source property starts loading the animation asynchronously.
- To monitor progress of loading you can connect to the \c status signal.
+ To monitor progress of loading, connect to the \l status change signal.
*/
QString LottieAnimation::source() const
{
@@ -279,10 +285,12 @@ void LottieAnimation::setSource(const QString &source)
}
/*!
- \qmlproperty int LottieAnimation::startFrame *
+ \qmlproperty int LottieAnimation::startFrame
+ \readonly
Frame number of the start of the animation. The value
- is available after the animation has been loaded.
+ is available after the animation has been loaded and
+ ready to play.
*/
int LottieAnimation::startFrame() const
{
@@ -291,9 +299,11 @@ int LottieAnimation::startFrame() const
/*!
\qmlproperty int LottieAnimation::endFrame
+ \readonly
Frame number of the end of the animation. The value
- is available after the animation has been loaded.
+ is available after the animation has been loaded and
+ ready to play.
*/
int LottieAnimation::endFrame() const
{
@@ -314,14 +324,14 @@ int LottieAnimation::currentFrame() const
frame rate does not have effect before that, as the value defined in the
asset overrides the value. To change the frame rate, you can write:
- \code
+ \qml
LottieAnimation {
source: ":/animation.json"
onStatusChanged: {
if (status === LottieAnimation.Ready)
frameRate = 60;
}
- \endcode
+ \endqml
*/
int LottieAnimation::frameRate() const
{
@@ -342,11 +352,17 @@ void LottieAnimation::setFrameRate(int frameRate)
buffer object, whereas with other options, the rendering will be done
onto \c QImage (which in turn will be rendered on the screen).
- \list
- \li LowQuality – Antialiasing or a smooth pixmap transformation algorithm are not used.
- \li MediumQuality – Antialiasing is used but no smooth pixmap transformation algorithm (Default)
- \li HighQuality – Antialiasing and a smooth pixmap tranformation algorithm used
- \endlist
+ \value LottieAnimation.LowQuality
+ Antialiasing or a smooth pixmap transformation algorithm are not
+ used
+
+ \value LottieAnimation.MediumQuality
+ Antialiasing is used but no smooth pixmap transformation algorithm
+ (Default)
+
+ \value LottieAnimation.HighQuality
+ Antialiasing and a smooth pixmap tranformation algorithm are both
+ used
*/
LottieAnimation::Quality LottieAnimation::quality() const
{
@@ -401,7 +417,7 @@ void LottieAnimation::play()
/*!
\qmlmethod void LottieAnimation::pause()
- Pauses playing.
+ Pauses the playback.
*/
void LottieAnimation::pause()
{
@@ -414,7 +430,7 @@ void LottieAnimation::pause()
/*!
\qmlmethod void LottieAnimation::togglePause()
- Togglrd the status of player between playing and paused states.
+ Toggles the status of player between playing and paused states.
*/
void LottieAnimation::togglePause()
{
@@ -428,7 +444,7 @@ void LottieAnimation::togglePause()
/*!
\qmlmethod void LottieAnimation::stop()
- Stops playing and return to \c startFrame.
+ Stops the playback and returns to startFrame.
*/
void LottieAnimation::stop()
{
@@ -440,7 +456,7 @@ void LottieAnimation::stop()
/*!
\qmlmethod void LottieAnimation::gotoAndPlay(int frame)
- Plays the asset from the given \a frame
+ Plays the asset from the given \a frame.
*/
void LottieAnimation::gotoAndPlay(int frame)
{
@@ -453,7 +469,7 @@ void LottieAnimation::gotoAndPlay(int frame)
\qmlmethod bool LottieAnimation::gotoAndPlay(string frameMarker)
Plays the asset from the frame that has a marker with the given \a frameMarker.
- Returns true if the frameMarker found in the asset.
+ Returns \c true if the frameMarker was found, \c false otherwise.
*/
bool LottieAnimation::gotoAndPlay(const QString &frameMarker)
{
@@ -467,7 +483,7 @@ bool LottieAnimation::gotoAndPlay(const QString &frameMarker)
/*!
\qmlmethod void LottieAnimation::gotoAndStop(int frame)
- Moves the playhead to the given frame and stops.
+ Moves the playhead to the given \a frame and stops.
*/
void LottieAnimation::gotoAndStop(int frame)
{
@@ -479,7 +495,7 @@ void LottieAnimation::gotoAndStop(int frame)
\qmlmethod bool LottieAnimation::gotoAndStop(string frameMarker)
Moves the playhead to the given marker and stops.
- Returns true if the frameMarker found in the asset.
+ Returns \c true if \a frameMarker was found, \c false otherwise.
*/
bool LottieAnimation::gotoAndStop(const QString &frameMarker)
{
@@ -501,9 +517,10 @@ void LottieAnimation::gotoFrame(int frame)
/*!
\qmlmethod double LottieAnimation::getDuration(bool inFrames)
- Returns the duration of a currently playing asset.
- If a given \a inFrames is true, returns value in a number of frames.
- Otherwise, returns the value in seconds.
+ Returns the duration of the currently playing asset.
+
+ If a given \a inFrames is \c true, the return value is the duration in
+ number of frames. Otherwise, returns the duration in seconds.
*/
double LottieAnimation::getDuration(bool inFrames)
{
@@ -515,12 +532,12 @@ double LottieAnimation::getDuration(bool inFrames)
\qmlproperty enumeration LottieAnimation::direction
This property holds the direction of rendering.
- \list
- \li Forward
- \li Reverse
- \endlist
- The default value is \c Forward.
+ \value LottieAnimation.Forward
+ Forward direction (Default)
+
+ \value LottieAnimation.Reverse
+ Reverse direction
*/
LottieAnimation::Direction LottieAnimation::direction() const
{