Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] QdeclarativeImageprovider issues
QtWS25 Last Chance

[Solved] QdeclarativeImageprovider issues

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 6.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    archerabi
    wrote on last edited by
    #1

    Hello,
    i have been trying to use qdeclarative plugin for a while now.I have been following "this":http://doc.trolltech.org/4.7-snapshot/qdeclarativeimageprovider.html.

    I am trying to use it in my mainwindow.cpp class but i always get a runtime warning saying

    QML Image: Failed to get image from provider: image://colors/red
    QML Image: Failed to get image from provider: image://colors/yellow

    Any suggestions ?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      anselmolsm
      wrote on last edited by
      #2

      Hi there!

      Hm... besides the obvious ('there is something wrong in you provider'), I can point you one of the Qt examples that shows QDeclarativeImageProvider in action. You can find it in

      $(path_to_Qt_source)/examples/declarative/cppextensions/imageprovider

      or "online at the Qt git repository":http://qt.gitorious.org/qt/qt/trees/4.7/examples/declarative/cppextensions/imageprovider

      Check if you forgot an important step, post here your results =)

      Anselmo L. S. Melo (anselmolsm)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        archerabi
        wrote on last edited by
        #3

        thats exactly the example i am using...except instead of using it as a plugin i am trying to use it in main.cpp.

        I have commented out the QDeclarativeExtensionPlugin.
        and included

        @
        QDeclarativeEngine engine ;
        engine.addImageProvider("colors", new ColorImageProvider);
        @

        in main.cpp.

        I put debug statements in requestPixmap function and found out that the function is never called.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          archerabi
          wrote on last edited by
          #4

          It was a silly mistake on my side.

          I was using a random Engine when instead i should have been using the engine from the QDecalrativeview .

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            zing0000
            wrote on last edited by
            #5

            Thanks, save me a lot of work!
            and remember to addImageProvider before loading QML source.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved