Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.0.0 Beta 1, 5.2.0 Beta1
-
None
-
Ubuntu 12.04 Precise, Qt5 Beta1
Description
When qmldir contains QML elements, plugin library and JavaScript libraries, the QML elements of the module cannot access the elements exported by the plugin library. If JavaScript files are removed, the module QML elements need to import the module URL still.
qmldir:
module com.module plugin testplugin TestItem 0.1 TestItem.qml JSLibrary 0.1 JSLibrary.js
TestItem.qml:
import QtQuick 2.0 import com.module 0.1 // this is not working TestElement { // this element is exported by testplugin }
If the "import com.module 0.1" is missing, the TestElement type is not known. If it is there, or import "." 0.1 is used, the "com.module 0.1 is ambiguous" error is reported.
Workaround: use named import. Works, but it is annoying.
TestItem.qml:
import QtQuick 2.0 import com.module 0.1 as Privates Privates.TestElement { // the element exported by the library }