Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2009

    Question QML Image: Failed to get image from provider

    Hi everybody,

    I have a problem when importing images from C++ into QML
    QML Image: Failed to get image from provider
    QmlApplicationViewer viewer;
        QDeclarativeEngine * engine = viewer.engine();
        engine->addImageProvider(QLatin1String("thumbnail"), new ContactsImageProvider);
    //QML delegate file
    Image {
            id: personPhoto
            height: 75
            width: 75
            source: "image://thumbnail/" + contactId
            anchors.left: parent.left
        m_contactsManager = new QContactManager;
        delete m_contactsManager;
    QImage ContactsImageProvider::requestImage(const QString& id, QSize* size, const QSize& requestedSize)
        QContact contact = m_contactsManager->contact(id.toUInt());
        QContactThumbnail thumb = contact.detail(QContactThumbnail::DefinitionName);
        QImage thumbnail = thumb.thumbnail();
            return thumbnail;
        return QImage();
    I always got the following error
    QML Image: Failed to get image from provider
    is there a solution?

  2. #2
    Super Contributor
    Join Date
    Jun 2006

    Re: QML Image: Failed to get image from provider

    you can try to set the property from qt like:

    QObject *rootObject = dynamic_cast<QObject*>(mDeclarativeView->rootObject());
    QObject *personPhoto= rootObject->findChild<QObject *>("personPhoto");
    QDeclarativeProperty property(personPhoto, "source");
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

Similar Threads

  1. Wrap text around image with proper margin between image and text in QML?
    By pasi.hytonen@starcut.com in forum [Archived] Qt Quick
    Replies: 0
    Last Post: 2011-03-31, 07:58
  2. How to get image path from image gallary
    By bnpawar in forum Symbian
    Replies: 6
    Last Post: 2010-11-26, 07:48
  3. Failed to get image from camera - N95
    By prchakal in forum Symbian
    Replies: 2
    Last Post: 2010-05-22, 06:14
  4. How to get informations about an image without creating the Image Object
    By cristi.mota in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2008-06-27, 08:47
  5. Moving Focus from one image to other image.
    By crazystar in forum Mobile Java General
    Replies: 3
    Last Post: 2007-09-25, 11:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts