I requested my personal imageprovider, but when I debug this few lines requestedSize is always {-1,-1}
class XdgIconThemeImageProvider : public QQuickImageProvider
{
public:
XdgIconThemeImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap){}
{
*size = pm.size();
return pm;
}
};
class XdgIconThemeImageProvider : public QQuickImageProvider
{
public:
XdgIconThemeImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap){}
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
{
QIcon ico = QIcon::fromTheme(id);
QPixmap pm = ico.isNull() ? QPixmap() : ico.pixmap(100,100);
*size = pm.size();
return pm;
}
};
To copy to clipboard, switch view to plain text mode
Are there any reasons? Am I doing somthing wrong?
Bookmarks