Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    QML and Qt Quick
    3
    6
    3317
    Loading More Posts
    • 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
      aabc last edited by

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

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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 Reply Quote 0
        • A
          aabc last edited by

          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 Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            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 Reply Quote 0
            • C
              chrisadams last edited by

              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 Reply Quote 0
              • A
                aabc last edited by

                Thanks Chris

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post