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

Self import plugin to use registered types

    XMLWordPrintable

Details

    Description

      In Qt-Components framework some Enum types are registered in MeeGoPlugin class which extends QDeclarativeExtensionPlugin.
      However, even registering these types in the plugin initialization, they are not recognized in the QML files inside the same plugin unless adding a self import.

      Example (myplugin registers PageStatus):

      qmldir:

      plugin myplugin
      Dummy 1.0 Dummy.qml
      

      Dummy.qml:

      import Qt 4.7
      // commenting the line below will result in error:
      // "Can't find variable: PageStatus"
      import myplugin 1.0
      
      Item {
          property int status: PageStatus.Inactive
      }
      

      For components, it's necessary to remove this internal imports, to avoid the same plugin to be loaded twice when using a different namespace externally (symlinks).

      Attachments

        Activity

          People

            aakenned Aaron Kennedy
            arezende Adriano Rezende
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: