[Interest] QVideoProbe Woes

Lopes Yoann Yoann.Lopes at digia.com
Fri Feb 7 13:05:58 CET 2014

On Feb 6, 2014, at 10:07 PM, Jason H wrote:

So I made a basic wrapper class (included below) for QVideoProbe to expose it to QML. I can set the source property, but when I do it reports it gets a QDeclaritiveAudio class instance, ans the setSource() call fails. How can I get the video part of it?

The reason is that both the MediaPlayer and Audio QML types are backed by the QDeclarativeAudio C++ class...
What you need is the QMediaPlayer instance, you can get it with the 'mediaObject' property of QDeclarativeAudio:

VideoProbe::setSource(QObject* sourceObj)


    QMediaPlayer *player = qvariant_cast<QMediaPlayer*>(sourceObj->property("mediaObject"));


Yoann Lopes
Senior Software Engineer - Digia, Qt
Visit us on: http://qt.digia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140207/7c4f1885/attachment.html>

More information about the Interest mailing list