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. Custom options from Qml Image to a custom ImageFormat
Forum Updated to NodeBB v4.3 + New Features

Custom options from Qml Image to a custom ImageFormat

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 369 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    Jerome.D
    wrote on last edited by
    #1

    Hi

    I am developing a custom QImageIOHandler (into a QImageIOPlugin) for a specific need. This new imageformat will need an encrytion key. I imagine i can use ImageOption (with a custom enum) and set in the QVariant my encryption key.

    But i want to use that new imageformat easily from Qml. Like this:

    Image {
        source: "file:///myfolder/myimage.mynewextension"
        *key: "xxxxxxxxxxxxxxxxxx"*
    }
    

    What solutions do i have? Is there a way to access the option list which will be passed to the ImageHandler ?
    I wonder also about subclassing QQuickImage but i think that it is not public...

    Thank you,
    Jérôme.

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      Does the handler/plugin allow you to open the file using the url?
      If this is true then you could embed the key in the url.
      Also, embedding the key in qml or c++ will make it trivial to read the key. You could also read the key in memory if stored in memory. If someone really wants the data they can get it.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jerome.D
        wrote on last edited by
        #3

        Thank you for your answer.
        Unfortunatly the url is open before reaching the ImageHandler. And the ImageHandler must work directly with a QIODevice.

        1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #4

          Another route is creating a custom image provider. With that you choose how to interpret the end of the url. The data will be provided to the Image item via a handler.

          C++ is a perfectly valid school of magic.

          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