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

QML, TableView.view is null in TableView.onCommit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0
    • None
    • Linux/X11

    Description

      I get the TypeError: Cannot call method 'index' of null when I try to get the table view index. Funny thing is that the code is behaving correctly on 6.8.2. Here is the attached code, while below is the excerpt where the error is reported.

      However, if instead of the TableView.view I call the actual id of the TableView (contactsView in this case), then the code works as expected.

      Furthermore, the same thing is happening if I use the the table model from c++, so I think that the problem is not related to the TableModel from Qt.labs.qmlmodels.

      Am I missing something? Am I doing something wrong? What changed from 6.8.2 to 6.9.0 to cause this problem?

      (code:  tv_problem.qml)

       

      TableView.onCommit:

      Unknown macro: {                 let index = TableView.view.index(row, column)                 contactsModel.setData(index, "display", text)             }

       

      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
            fantaz fantaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes