Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18245

Provide a way to disable bindings, signal handlers and animations

    XMLWordPrintable

Details

    Description

      I'm often having QML items that are connected with a C++ backend. Those items listen to signals emitted by the backend and react accordingly. E.g. by changing the data displayed or by playing an animation. Often those items are not visible to the user. But, while invisible, they still react to all signals fired by the backend.

      This is bad for performance and battery consumption.

      There is also the special case that the application is in the background or screen lock is enabled. In this case most signal handlers and animations should be stopped to prevent power drain.

      To solve this, I propose a property 'active' or 'enabled' on Item. Setting this property to false would disconnect all signal handlers of this and all child items.

      MyScreen {
       active: isCurrentScreen
       SomeItem {
         text: backend.actitvePoi.name  // Does not update if active == false
         image: backend.activePoi.image // Does not update if active == false
       }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            conny Cornelius Hald
            Votes:
            9 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes