Hi,
has someone else seen this?
I have a
class QMyImgProvClass : public QDeclarativeImageProvider{
..
virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize){
...
}
QMyImgProvClass * instance(){
static QMyImgProvClass s_myClass;
return &s_myClass;
}
public:
QList<int> m_list;
};
Since I need to use this in a plugin, I register it in the
void BookmarkModelPluginPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri){
engine->addImageProvider(QLatin1String(MY_IMGPROV_NAME), QMyImgProvClass::Instance());
}
through a simple Singleton.
In the plugin then, I populate the m_list;
.
Now, the requestImage is called correctly from QML. BUT, the effect is that the m_list list is EMPTY for each call. It seems that for each call to the requestImage, the "this" pointer is different.
I thought the addImageProvider registers a single object as an image provider?

Reply With Quote

