[Qt-qml] Changes to how QML files can import other QML files?

Jan Ekholm jan.ekholm at smultron.net
Thu Jul 22 16:17:01 CEST 2010


Hi,

I have a small stupid, dumb project that I haven't worked on for a few weeks. 
When I last touched it at the end of June all worked fine and there were no 
issues. Now, all my import statements in my QML files fail. The files have 
imports like:

import Qt 4.7
import "Buttons.qml"
import "Map.qml"
...

Each of my own QML file gives errors like:

file:///home/chakie/prog/c++/tactics/qml/Tactics.qml:3:1: "Buttons.qml": no 
such directory 
     import "Buttons.qml" 

Changing the import order gives similar errors for all other files. So 
something has changed and I can't find any mention about it in the docs, 
blogs, this mailing list or IRC. It's a tiny bit worrying to have perfectly 
fine code bit rot into oblivion in just some weeks. This did work fine in 
June.

The C++ executable that drives it all is located in:

	/home/chakie/prog/c++/tactics/

and the QML files are all in:

	/home/chakie/prog/c++/tactics/qml/

Randomly adding paths with:

	void QDeclarativeEngine::addImportPath ( const QString & path )

does not seem to help either. The main QML files are not compiled in as 
resources, as that does not work properly due to QMake(?) bugs. They are 
simply loaded from disk when needed.

My guess is that there have been changes to where QML files are allowed to be 
and I need to do something to something to get something to find them again. 
Also using complete paths for the import lines does not work.

Any hints? Would it be better to wait some months to let everything stabilize 
before trying QML for real apps?

Kind regards,
    Jan Ekholm


-- 
    Pets are always a great help in times of stress. And in times of 
    starvation too, o'course.
                                        -- Terry Pratchett, Small Gods



More information about the Qt-qml mailing list