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

Missing ambiguity error message on type clash (Qt.labs.settings, QtQuick.Controls.Private clash on order)

XMLWordPrintable

      It seems the order of QML Imports does matter in specific cases:

      import QtQuick.Controls 1.0
      import Qt.labs.settings 1.0
      import QtQuick.Controls.Private 1.0
      
      ApplicationWindow {
          width: 1300
          height: 900
          visible: true
      
          Settings {
              id : appSettings
          }
      }
      

      Leads to a runtime error

      qrc:/main.qml:10 Element is not creatable.
      

      Moving "import Qt.labs.settings 1.0" after "import QtQuick.Controls.Private 1.0" fixes this.

      As both imports provide a "Settings" type (one as QML singleton), the engine should produce an error message that there exists an ambiguity.

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

            qtqmlteam Qt Qml Team User
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes