[Solved] QdeclarativeImageprovider issues
-
Hello,
i have been trying to use qdeclarative plugin for a while now.I have been following "this":http://doc.trolltech.org/4.7-snapshot/qdeclarativeimageprovider.html.I am trying to use it in my mainwindow.cpp class but i always get a runtime warning saying
QML Image: Failed to get image from provider: image://colors/red
QML Image: Failed to get image from provider: image://colors/yellowAny suggestions ?
-
Hi there!
Hm... besides the obvious ('there is something wrong in you provider'), I can point you one of the Qt examples that shows QDeclarativeImageProvider in action. You can find it in
$(path_to_Qt_source)/examples/declarative/cppextensions/imageprovider
or "online at the Qt git repository":http://qt.gitorious.org/qt/qt/trees/4.7/examples/declarative/cppextensions/imageprovider
Check if you forgot an important step, post here your results =)
-
thats exactly the example i am using...except instead of using it as a plugin i am trying to use it in main.cpp.
I have commented out the QDeclarativeExtensionPlugin.
and included@
QDeclarativeEngine engine ;
engine.addImageProvider("colors", new ColorImageProvider);
@in main.cpp.
I put debug statements in requestPixmap function and found out that the function is never called.