Add qmlvideo and qmlvideofx examples
Based on code imported from master branch of QtMobility repo, ported to Qt Quick 2. Task-number: QTBUG-23118 Change-Id: Ifd297de0e595c675ff1a8e3218d91b03629295b9 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
f33731fe5a
commit
febe398400
43
doc/src/examples/video-qml-paint-rate.qdocinc
Normal file
43
doc/src/examples/video-qml-paint-rate.qdocinc
Normal file
@@ -0,0 +1,43 @@
|
||||
The QML painting rate is calculated by the FrequencyMonitor class, which
|
||||
turns a stream of events (received via the notify() slot), into an
|
||||
instantaneous and an averaged frequency:
|
||||
|
||||
\quotefromfile video/snippets/frequencymonitor/frequencymonitor.h
|
||||
\skipto class FrequencyMonitor : public QObject
|
||||
\printuntil Q_OBJECT
|
||||
\skipto Q_PROPERTY(qreal instantaneousFrequency
|
||||
\printuntil averageFrequencyChanged)
|
||||
\skipto public
|
||||
\printuntil :
|
||||
\dots
|
||||
\skipto static void qmlRegisterType
|
||||
\printuntil ;
|
||||
\skipto public slots
|
||||
\printuntil notify();
|
||||
\skipto };
|
||||
\printline };
|
||||
|
||||
The FrequencyMonitor class is exposed to QML like this
|
||||
|
||||
\quotefromfile video/snippets/frequencymonitor/frequencymonitordeclarative.cpp
|
||||
\skipto FrequencyMonitor::qmlRegisterType
|
||||
\printuntil }
|
||||
|
||||
and its data is displayed by defining a QML item called FrequencyItem, like this:
|
||||
|
||||
\quotefromfile video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml
|
||||
\skipto import FrequencyMonitor
|
||||
\printuntil id: root
|
||||
\dots
|
||||
\skipto function notify
|
||||
\printuntil id: monitor
|
||||
\skipto onAverageFrequencyChanged
|
||||
\printuntil {
|
||||
\skipto instantaneousFrequencyText
|
||||
\printuntil /^\}/
|
||||
|
||||
The result looks like this:
|
||||
|
||||
\image video-qml-paint-rate.png
|
||||
|
||||
|
||||
Reference in New Issue
Block a user