Hi Christian,

QML_IMPORT_PATH was exactly the variable I was looking for, thanks. But 
unfortunately it doesn't work :(

I have a directory structure that looks like this:

project/
   qml/
     Most QML files here
   mylib/
     qml/
       More QML files

The mylib.pri installs the qml files to the same qml directory as the 
main qml files, so at runtime this is fine.

I have added "QML_IMPORT_PATH = mylib/qml" to the pro file. This doesn't 
make any difference to the QtC code model. I have tried stuff like 
adding $$PWD and other attempts. No difference. The components are not 
recognised.

In the meantime, I have worked around it by adding a line saying
'import "../mylib/qml"' and installing the library components to a 
separate directory that has the same path in the runtime dir as in the 
source dir. It does work, but it means I restrict the way the source 
tree is set up, and I really don't like that.

If anyone know why QML_IMPORT_PATH doesn't work for me, please tell. 
Otherwise, I'll enter a bug report.

Cheers,

Bo.

Den 10-03-2012 10:18, [email protected] skrev:
> If it is a qmake project, set QML_IMPORT_PATH in the .pro file to add paths 
> to Creator's code model.
>
> Cheers,
> Christian
>
> ________________________________________
> From: [email protected] 
> [[email protected]] on behalf of ext Bo 
> Thorsen [[email protected]]
> Sent: Thursday, March 08, 2012 11:04 PM
> To: [email protected]
> Subject: [Qt-qml] Adding QML components dirs
>
> Hi people,
>
> I'm working on a project, where I have QML files in several directories.
> This isn't a problem at runtime, because they're all copied to the same
> qml dir.
>
> But in QtC, I get the red error line under the components from other
> dirs, and no completion.
>
> I seem to remember that there is a way I can add dirs to the QML parser
> to complete from, but I can't find it anymore. Anyone here have a good idea?
>
> The setup is that I have a library that's shared between different
> projects, and some of the files in this library are QML files, some are
> C++. The C++ code isn't a problem, of course, but the QML files are
> annoying.
>
> Using svn externals directly on the file would put them in the same qml
> dir as the files specific to the other projects, but that's a
> maintenance nightmare.
>
> Bo Thorsen,
> Fionia Software.
>
> --
>
> Expert Qt and C++ developer for hire
> Contact me if you need expert Qt help
> http://www.fioniasoftware.dk
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml


Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to