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. How to implement UIImageView-like component?
QtWS25 Last Chance

How to implement UIImageView-like component?

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 2.1k 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.
  • V Offline
    V Offline
    Vincent007
    wrote on last edited by
    #1

    There is one "image" property in UIImageView. "image" is a UIImage object.
    pixel data can be accessed via "image" property. Therefore image processing tasks can be performed by using "image" property as a input and then new UIImage object can be assigned to "image" property. The UIImageView will be updated automatically after new UIImage is assigned.

    How to implement "image" property in my custom Image component?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Subclass QQuickItem, add a Q_PROPERTY with relevant getters and setters, and you should be fine. But I have a feeling I have misunderstood you.

      (Z(:^

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vincent007
        wrote on last edited by
        #3

        Thank for your quick reply.

        Is it feasible? It seems difficult in this way because in this way I need to reimplement Image component completely in order to get all features of built-in Image component.

        How to avoid reimplementing Image component completely?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Subclass the private class that creates the Image QML type. This, however, means you need to use custom build of Qt.

          (Z(:^

          1 Reply Last reply
          0
          • V Offline
            V Offline
            Vincent007
            wrote on last edited by
            #5

            Thanks again.

            I am going to propose making QQuickImage public.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Has been done maaaany times already :) But keep trying and one day it might be made public :)

              (Z(:^

              1 Reply Last reply
              0

              • Login

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