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

Cannot assign to property of unknown type "QAbstractItemModel*".

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      528547f5d9d6929f41c94e11591dae36f2794ba2 (qt/qtdeclarative/dev)

      Description

      If we define a custom model with a property of type `QAbstractItemModel *` like that:

      Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
      

      and bind it in qml, we get a runtime qml error:

      Cannot assign to property of unknown type "QAbstractItemModel*".
      

      Interesting that if we import quick controls 1 in the qml module:

      import QtQuick.Controls 1.6 as QC1
      

      the problem disappears. Even if don't use the QC1(because we use quick controls 2).

      Full minimal example with the problem is attached.

      Old related bug(I think it's the same problem) is https://bugreports.qt.io/browse/QTBUG-67294

        Attachments

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

          Activity

            People

            Assignee:
            mitch_curtis Mitch Curtis
            Reporter:
            herolover Anton Zhvakin
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There is 1 open Gerrit change