Results 1 to 2 of 2

Thread: QQuickImageProvider reauested size always invalid.

  1. #1
    Join Date
    Apr 2015
    Posts
    9
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QQuickImageProvider reauested size always invalid.

    I requested my personal imageprovider, but when I debug this few lines requestedSize is always {-1,-1}

    Qt Code:
    1. class XdgIconThemeImageProvider : public QQuickImageProvider
    2. {
    3. public:
    4. XdgIconThemeImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap){}
    5. QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
    6. {
    7. QIcon ico = QIcon::fromTheme(id);
    8. QPixmap pm = ico.isNull() ? QPixmap() : ico.pixmap(100,100);
    9. *size = pm.size();
    10. return pm;
    11. }
    12. };
    To copy to clipboard, switch view to plain text mode 

    Are there any reasons? Am I doing somthing wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QQuickImageProvider reauested size always invalid.

    Do you set the sourceSize of the Image element that requests the image?

    Cheers,
    _

Similar Threads

  1. Connecting QQuickImageProvider
    By guidupas in forum Qt Quick
    Replies: 3
    Last Post: 7th November 2015, 09:57
  2. Replies: 2
    Last Post: 8th December 2013, 05:53
  3. Replies: 0
    Last Post: 14th February 2012, 15:43
  4. Replies: 0
    Last Post: 26th October 2010, 17:59
  5. Replies: 2
    Last Post: 23rd March 2009, 17:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.