ext SABROG wrote:
> I have directory MyQmlLibrary who contains files like:
>
> MyButton.qml
> MyLineEdit.qml
> MyStatusBar.qml
> ...
> qmldir
>
> File "qmldir" contains:
>
> MyButton 0.1 MyButton.qml
> MyLineEdit 0.1 MyLineEdit.qml
> MyStatusBar 0.1 MyStatusBar.qml
>
> Then i try use this modules like:
>
> import Qt 4.6
> import "MyQmlLibrary" 0.1 as MyQmlLibrary
> ...
>
> MyQmlLibrary.MyButton {
> }
>
>
> But qml compiler can't found MyQmlLibrary/MyButton while i don't remove
> version from "import "MyQmlLibrary" 0.1 as MyQmlLibrary"
Hi,
import "subDir" as SubDir
will allow you to use all ".qml" files inside the directory. This will
not do any version checking etc, it is assumed that the subdirectory is
part of your project. You don't need a qmldir file here.
import MyLib 0.1 as MyLib
imports MyLib as a _library_. It does read the qmldir file, and only
exposes the files/versions listed in there. But it will search for a
MyLib directory only in directories registered by
QmlEngine::addImportPath(), which by default only incudes $QTDIR/qml. If
you are using qmlviewer you can pass in directories on the command line
via -L.
As I understand it,
import "MyQmlLibrary" 0.1 as MyQmlLibrary
is actually wrong and should IMO lead to a compiler error.
The details are also in the documentation:
http://qt.nokia.com/doc/qml-snapshot/qmlmodules.html
Regards
Kai
--
Kai Koehne
Software Engineer
Nokia, Qt Development Frameworks
Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback