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

QML Nested Imports - some problems

    XMLWordPrintable

Details

    • Android, iOS/tvOS/watchOS, macOS
    • f7d502c80 (dev), 5251db718 (6.8)

    Description

      this is a follow up to the discussions at https://bugreports.qt.io/browse/QTBUG-111763

      Created a project to demonstrate the problems. see attached ekkeTestNested project.

      structure of used qml files:

      qml/Main.qml
          opens pages/HomePage.qml

      HomePage.qml uses
          common/LabelTitle.qml
          common/FloatingActionButon.qml
          popups/AdminDialog.qml

      AdminDialog uses
          common/LabelTitle.qml
          common/LabelSubheading.qml

      URL: Ekke.Apps.Main

      translations done for de

      root qmldir:

       

      module Ekke.Apps.Main
      typeinfo ekkeTestNested.qmltypes
      prefer :/qt/qml/Ekke/Apps/Main/
      Main 254.0 qml/Main.qml
      LabelTitle 254.0 qml/common/LabelTitle.qml
      LabelSubheading 254.0 qml/common/LabelSubheading.qml
      FloatingActionButton 254.0 qml/common/FloatingActionButton.qml
      LabelBody 254.0 qml/common/LabelBody.qml
      AdminDialog 254.0 qml/popups/AdminDialog.qml
      HomePage 254.0 qml/pages/HomePage.qml

       

      qmldir with

      prefer :/qt/qml/Ekke/Apps/Main/
      • generated into
      • qml
      • qml/common
      • qml/pages
      • qml/popups

       

      all looks good

      I'm also using QML_SINGLETON:
      MyApp and DataManager
      and a QML_ELEMENT
      SettingsData

      problems:
      I have to add explicit import Ekke.Apps.Main into AdminDialog.qml, otherwise running the app:

      HomePage.qml Type AdminDialog unavailable
      AdminDialog.qml SettingsData is not a type

      after adding the explicit import App runs OK

      running the App, in HomePage the implicit import is working as expected,
      but inside QtCreator I'm getting

      Unknown component (M300)
      for LabelTitle, FloatingActionButton, AdminDialog

      doing an explicit import M300 is gone

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              ekkescorner Ekkehard
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes