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
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to