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. Understanding QQuickItem
QtWS25 Last Chance

Understanding QQuickItem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 4 Posters 884 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.
  • C Offline
    C Offline
    Creaperdown
    wrote on last edited by
    #1

    Hey, I need to display a pixmap to qml via a QQuickItem and after reading the documentation, I am still not entirely sure how it works.

    From what I get, the key methods are geometryChange and updatePaintNode. updatePaintNode seems to be called (only?) when QQuickItem::update is called and it is the function that does the actual updating of the visual item, is that correct?

    Also, when exactly is geometryChange called? Does this simply happen every time when an QQuickObject's size, position, ... changes?

    Is the QQuickItem::update method ever called from Qt itself, or am I responsible to do this, in react to geometryChange being called?

    Thanks in advance.

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

      Why not use Image paired with QQuickImageProvider? That way you can quite easily pass any pixmap to QML and have it displayed there.

      C 1 Reply Last reply
      0
      • A aran

        Why not use Image paired with QQuickImageProvider? That way you can quite easily pass any pixmap to QML and have it displayed there.

        C Offline
        C Offline
        Creaperdown
        wrote on last edited by
        #3

        @aran It is a pixmap that is generated from a book page that is supposed to be scrolled, zoomed, etc. so it needs the flexibility and the extra properties as well as implicit widths and more.

        A 1 Reply Last reply
        0
        • C Creaperdown

          @aran It is a pixmap that is generated from a book page that is supposed to be scrolled, zoomed, etc. so it needs the flexibility and the extra properties as well as implicit widths and more.

          A Offline
          A Offline
          aran
          wrote on last edited by
          #4

          @Creaperdown Do you have access to the full pixmap? You could load it on the qml side and implement the scrolling (e.g., Flickable) and zooming (scale property) there. If that's no applicable to your use case, then I don't know, I have no experience with using QQuickItem directly unfortunately...

          1 Reply Last reply
          0
          • jeremy_kJ Offline
            jeremy_kJ Offline
            jeremy_k
            wrote on last edited by
            #5

            QQuickImageProvider is likely the easier route to follow.

            Image inherits Item, which instantiates QQuickItem. I don't believe that any of the properties in QQuickItem are final.

            Asking a question about code? http://eel.is/iso-c++/testcase/

            C 1 Reply Last reply
            0
            • C Creaperdown

              Hey, I need to display a pixmap to qml via a QQuickItem and after reading the documentation, I am still not entirely sure how it works.

              From what I get, the key methods are geometryChange and updatePaintNode. updatePaintNode seems to be called (only?) when QQuickItem::update is called and it is the function that does the actual updating of the visual item, is that correct?

              Also, when exactly is geometryChange called? Does this simply happen every time when an QQuickObject's size, position, ... changes?

              Is the QQuickItem::update method ever called from Qt itself, or am I responsible to do this, in react to geometryChange being called?

              Thanks in advance.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              @Creaperdown are you mixing qwidget and qml?

              C 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @Creaperdown are you mixing qwidget and qml?

                C Offline
                C Offline
                Creaperdown
                wrote on last edited by
                #7

                @JoeCFD No

                1 Reply Last reply
                0
                • jeremy_kJ jeremy_k

                  QQuickImageProvider is likely the easier route to follow.

                  Image inherits Item, which instantiates QQuickItem. I don't believe that any of the properties in QQuickItem are final.

                  C Offline
                  C Offline
                  Creaperdown
                  wrote on last edited by
                  #8

                  @jeremy_k I am following an example of how Okular (the document viewer) is doing it, and they are using QQuickItem to generate and display items as well.

                  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