Thanks, but why wouldn't these QML element classes be just subclasses of their Q* variants, along with being a subclass of QDeclartiveItem? Where does their magic happen? Are they proxies to a d pointer that does the magic?
Thanks, but why wouldn't these QML element classes be just subclasses of their Q* variants, along with being a subclass of QDeclartiveItem? Where does their magic happen? Are they proxies to a d pointer that does the magic?
A class can not be a subclass of to QObject derived classes.
My guess is that those two are visual QtQuick components, i.e. they appear visually in the QML scene. In which case they need to derive from QDeclarativeItem.
I don't know any details about their implementation but it is likely that they hold pointers to the non-UI classes, very likely indirectly through a d-pointer.
Cheers,
_
Scorp2us (7th February 2014)
I got it working like this
Qt Code:
{ m_source = sourceObj; bool ret =false; QMediaPlayer *player = qvariant_cast<QMediaPlayer*>(sourceObj->property("mediaObject")); qDebug() << "VideoProbe::setSource() player"<< player; ret = QVideoProbe::setSource((QMediaObject*)player); return ret; }To copy to clipboard, switch view to plain text mode
anda_skoa (7th February 2014)
Ah, good to know!
Btw, you don't have to do another cast in line 7, the variable player is already of type QMediaPlayer
Cheers,
_
Bookmarks