01-14-2013 09:07 AM
Hi Geeks,
I tried to port the "Image Provider" example (which can be found in qt documents) to cascades
qml usage in Qt Quick :
Image { source: "image://colors/yellow" }
Image { source: "image://colors/red" }
c++ code in cascades, add the image provider:
// create scene document from main.qml asset
// set parent to created document to ensure it exists for the whole application lifetime
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(th is);
// create root object for the UI
AbstractPane *root = qml->createRootObject<AbstractPane>();
// set created root object as a scene
app->setScene(root);
qml->defaultDeclarativeEngine()->addImageProvider( );
qml code in Cascades:
ImageView {
id: imgView
imageSource: "image://colors/yellow"
}but debug shows "url failed to load", and nothing appear (blank ImageView)
Hope someone can help with this issue ![]()
01-14-2013 01:13 PM