Fix the bufferProgress property of QDeclarativeAudio
authorAndras Becsi <andras.becsi@digia.com>
Wed, 7 Nov 2012 13:44:28 +0000 (14:44 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 7 Nov 2012 15:20:22 +0000 (16:20 +0100)
The bufferProgress property of QDeclarativeAudio is documented to hold
how much of the data buffer is currently filled, from 0.0 (empty) to
1.0 (full) and should be declared to be of type qreal instead of int.
The implementation was correctly normalizing the buffer status
percentage to the [0, 1] range but the returned value was truncated
to int in QML because of the faulty property declaration.

Change-Id: I494c9cd14f4b3ec511759ae66a50e9f96bcb1452
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
src/imports/multimedia/qdeclarativeaudio_p.h

index f45a1f0..3164f4d 100644 (file)
@@ -87,7 +87,7 @@ class QDeclarativeAudio : public QObject, public QQmlParserStatus
     Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
     Q_PROPERTY(bool hasAudio READ hasAudio NOTIFY hasAudioChanged)
     Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged)
-    Q_PROPERTY(int bufferProgress READ bufferProgress NOTIFY bufferProgressChanged)
+    Q_PROPERTY(qreal bufferProgress READ bufferProgress NOTIFY bufferProgressChanged)
     Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged)
     Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged)
     Q_PROPERTY(Error error READ error NOTIFY errorChanged)