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. requestSize in QQuickImageProvider requestImage is always (-1, -1)
Forum Updated to NodeBB v4.3 + New Features

requestSize in QQuickImageProvider requestImage is always (-1, -1)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 208 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.
  • EmilieGE Offline
    EmilieGE Offline
    EmilieG
    wrote on last edited by
    #1

    Hello,

    I'm using a QQuickImageProvider to pass QImages to QML Images, using the requestImage function.
    I would like to use the requestedSize parameter to downsize my image if necessary.. but the parameter is always -1, -1.
    As I understood from the doc and from this old post, the requestedSize parameter should automatically be set to the sourceSize property of the QML image.. could I rather use the actual displayed size of the image ? And how ?

    Thanks !

    KroMignonK 1 Reply Last reply
    0
    • EmilieGE EmilieG

      Hello,

      I'm using a QQuickImageProvider to pass QImages to QML Images, using the requestImage function.
      I would like to use the requestedSize parameter to downsize my image if necessary.. but the parameter is always -1, -1.
      As I understood from the doc and from this old post, the requestedSize parameter should automatically be set to the sourceSize property of the QML image.. could I rather use the actual displayed size of the image ? And how ?

      Thanks !

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by KroMignon
      #2

      @EmilieG I think you want to show picture into a Image QML item.
      So you have to use sourceSize, otherwise, the image returned by image provider will be scaled.
      For example

      Image {
          source: "image://myProvider/imagename"
          sourceSize: Qt.size(width, height)
      }
      

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      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