Qt Forum

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

    Call for Presentations - Qt World Summit

    Solved How to measure time taken for QML item to appear on the screen since it was loaded?

    QML and Qt Quick
    qml loader qtquick2 time item
    3
    5
    890
    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.
    • D
      diredko last edited by

      Hi everyone,
      In my QtQuick application I want measure time passed since the moment source or sourceComponent property of QML Loader has been changed to the moment visual item actually appeared on the screen (got painted).
      How can I do this?

      Loader {
          id: _loader
          source: "MyVisualItem.qml"
      }
      

      I already tried using statusChanged and Component.onCompleted signals but neither is accurate enough - it is easy to see that actual time is significantly greater.

      Thanks in advance

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Status change may give some near time. Componet.Oncompleted will fire when the object is created not when shown. So best bet qmlprofiler to check accurate time.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        D 1 Reply Last reply Reply Quote 1
        • D
          diredko @dheerendra last edited by

          @dheerendra is there any way to do this from within my application?

          1 Reply Last reply Reply Quote 0
          • dheerendra
            dheerendra Qt Champions 2022 last edited by

            I don't see a possibility.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply Reply Quote 0
            • S
              shaan7 last edited by

              If you need this for just measuring the performance of your application, maybe you should use the QML Profiler instead http://doc.qt.io/qtcreator/creator-qml-performance-monitor.html

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