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

Qt Quick Views: Refactor common properties/methods/signals

    XMLWordPrintable

Details

    Description

      ListView, GridView, and TableView all inherit Flickable and provide duplicated properties/methods/signals. For example:

      • All views have their own pooled()/reused() attached signals
      • All views have their own forceLayout() method
      • All views have their own view attached property (although the types are different)

       

      Suggestion

      Instead of inheriting Flickable directly, the views could inherit a common (uncreatable) View type which holds the common properties/methods/signals. This would make it easier to implement delegates that can be used in different View types:

      // MyDelegate.qml
      Item {
          function foo() { ... }
          function bar() { ... }
      
          View.onPooled: foo()
          View.onReusued: bar()
          Component.onCompleted: console.log("This delegate was created by a ", View.view)
      }
      

       

      The existing duplicated properties/methods/signals can then be deprecated.

      Attachments

        Issue Links

          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
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes