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

Can't import QtQml.Models without first importing QtQml

    XMLWordPrintable

Details

    • 172d12c7a6daa036f477f0a76c787a0f76ac21b5 (qt/qtdeclarative/5.15)

    Description

      The following code will produce errors unless QtQml is imported first:

      import QtQml.Models 2.14
      import QtQuick 2.14
      import QtQuick.Window 2.14
      
      Window {
          width: 640
          height: 480
          visible: true
      
          ObjectModel {
              id: itemModel
              Rectangle { height: 30; width: 80; color: "red" }
              Rectangle { height: 30; width: 80; color: "green" }
              Rectangle { height: 30; width: 80; color: "blue" }
          }
      
          ListView {
              anchors.fill: parent
              model: itemModel
          }
      }
      
      QQmlApplicationEngine failed to load component
      qrc:/main.qml:1:1: plugin cannot be loaded for module "QtQml.Models": Cannot protect module QtQml.Models 2 as it was never registered
      

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes