From eb221bfd6d68a8028d55c344cb29bf8defd2a81e Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 9 Nov 2013 00:15:21 +0800 Subject: [PATCH] Doc: Document asynchronous nature of QMediaPlayer::setMedia() The function name can be interpreted to mean that it loads the media. Users have made this mistake before: http://comments.gmane.org/gmane.comp.lib.qt.user/9189 https://bugreports.qt-project.org/browse/QTBUG-28514 Change-Id: I9e9b36405d67d40db42b77d8eeb8f9d528ee16e2 Reviewed-by: Jerome Pasion Reviewed-by: Yoann Lopes --- src/multimedia/playback/qmediaplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index eaac828..bf6294a 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -864,6 +864,11 @@ void QMediaPlayer::setPlaybackRate(qreal rate) Setting the media to a null QMediaContent will cause the player to discard all information relating to the current media source and to cease all I/O operations related to that media. + + \note This function returns immediately after recording the specified source of the media. + It does not wait for the media to finish loading and does not check for errors. Listen for + the mediaStatusChanged() and error() signals to be notified when the media is loaded and + when an error occurs during loading. */ void QMediaPlayer::setMedia(const QMediaContent &media, QIODevice *stream) -- 2.7.4