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. What are the benefits of using QQuickItem and QQuickPaintedItem instead of QML elements ?

What are the benefits of using QQuickItem and QQuickPaintedItem instead of QML elements ?

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 3.9k 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
    aabc
    wrote on last edited by
    #1

    What are the benefits of using QQuickItem and QQuickPaintedItem instead of QML elements ?

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

      A very general question. They allow you to use c++ and remaining Qt classes to boost standard capabilities of QML. They allow to create new QML components. Hard to say anything without more specific questions, though.

      (Z(:^

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

        I'll try to be more specific:
        When I mean benefits I mean performance.
        Lets say If I create create 2 elements that looks the same - one with QML elements and the other with QQuickItem or QQuickPaintedItem.
        Which one of them will be loaded first ?

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

          Try it. It all depends.

          If you expand QML with QQuickItem, you are obviously adding to the code that is already there, so you can impact the performance negatively. However, QML uses meta objects to work anyway, so in most cases it's improbable that there would be any real difference.

          (Z(:^

          1 Reply Last reply
          0
          • C Offline
            C Offline
            chrisadams
            wrote on last edited by
            #5

            It depends on what you're painting.

            If you can implement a complex scene in a single QQuickPaintedItem or whatever, using raster painting, you still might outperform a similarly complex scene composed of multiple QQuickItems - at least instantiation will be faster, so your first time startup application performance will be quicker, even if rendering is slower.

            It depends on what sort of layouts you use, what sort of positioning you use, what sort of effects you use, what sort of animation you do.

            In general case applications, I'd be surprised if you could beat the performance of just using QtQuick items, but in some specific cases it's certainly possible.

            Cheers,
            Chris.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aabc
              wrote on last edited by
              #6

              Thanks Chris

              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