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

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

    XMLWordPrintable

Details

    • Windows
    • 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

        For Gerrit Dashboard: QTBUG-86428
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes