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

Not possible to use DelegateChooser with TableView to specify delegates based on column indices

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.12
    • None

    Description

      I'm trying to use DelegateChooser with the manual test in https://codereview.qt-project.org/#/c/233125/, but I get the following warnings:

      TableView: delegate is not an item: 0
      qrc:/main.qml:109:9: QML TableView: the delegate's implicitHeight needs to be greater than zero
      TableView: delegate is not an item: 3
      TableView: delegate is not an item: 6
      TableView: delegate is not an item: 9
      TableView: delegate is not an item: 12
      TableView: delegate is not an item: 1
      TableView: delegate is not an item: 4
      TableView: delegate is not an item: 7
      TableView: delegate is not an item: 10
      TableView: delegate is not an item: 13
      TableView: delegate is not an item: 2
      TableView: delegate is not an item: 5
      TableView: delegate is not an item: 8
      TableView: delegate is not an item: 11
      TableView: delegate is not an item: 14
      

      I've tried setting role: "display" on the DelegateChooser, but it didn't help (and judging by the code, this isn't necessary, thankfully).

      Debugging the code, I see that QQuickTableViewPrivate::resolveRowHeight() is called before e.g. QQmlTableInstanceModel::resolveDelegate() (and by extension, QQmlDelegateChooser::delegate()).

      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
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes