with no other option I tried the example program from nokia developer site here is the link

http://harmattan-dev.nokia.com/docs/...eprovider.html

when I tried the above example I got an error message "QML Image:Failed to get image from provider: image://colors/yellow"

Here is the code with few changes from example

main.cpp

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3. #include <QDeclarativeEngine>
  4. #include <QDeclarativeImageProvider>
  5.  
  6.  
  7. class ColorImageProvider : public QDeclarativeImageProvider
  8. {
  9. public:
  10. ColorImageProvider()
  11. : QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap)
  12. {
  13. }
  14.  
  15. QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
  16. {
  17. int width = 100;
  18. int height = 50;
  19.  
  20. if (size)
  21. *size = QSize(width, height);
  22. QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width,
  23. requestedSize.height() > 0 ? requestedSize.height() : height);
  24. pixmap.fill(QColor(id).rgba());
  25.  
  26. return pixmap;
  27. }
  28. };
  29.  
  30. int main(int argc, char *argv[])
  31. {
  32. QScopedPointer<QApplication> app(createApplication(argc, argv));
  33.  
  34. QmlApplicationViewer viewer;
  35. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  36. viewer.setMainQmlFile(QLatin1String("qml/yellow_red_imageprovider/main.qml"));
  37. viewer.showExpanded();
  38.  
  39. QDeclarativeEngine engine;
  40. engine.addImageProvider(QLatin1String("colors"), new ColorImageProvider);
  41.  
  42.  
  43. return app->exec();
  44. }
To copy to clipboard, switch view to plain text mode 

main.qml
Qt Code:
  1. import QtQuick 1.1
  2.  
  3. Column {
  4. Image { source: "image://colors/red" }
  5. Image { source: "image://colors/yellow" }
  6. }
To copy to clipboard, switch view to plain text mode 

I don't know how to solve this problem