How are you calling ::componentComplete? You can also try adding some variable in your that you increment each time requestImage is called to make sure it gets incremented with a single instance.
Something like
Code:
#include <QDebug>
class QMyImgProvClass : public QDeclarativeImageProvider {
public:
QMyImgProvClass() : mNumberOfCalls(0)
{
}
...
virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize){
...
++mNumberOfCalls;
qDebug() << "Calls:" << mNumberOfCalls;
}
public:
QList<int> m_list;
private:
int mNumberOfCalls;
};
Br,
Villep