[Qt-creator] QML codecompletion for QML based component

Benjamin Zeller benjamin.zeller at canonical.com
Fri May 8 16:02:33 CEST 2015


Am 08.05.2015 um 15:56 schrieb Koehne Kai:
>
>> -----Original Message-----
>> From: Benjamin Zeller [mailto:benjamin.zeller at canonical.com]
>> Sent: Friday, May 08, 2015 1:14 PM
>> To: Koehne Kai; qt-creator at qt-project.org
>> Subject: Re: [Qt-creator] QML codecompletion for QML based component
>>
>> Am 08.05.2015 um 12:59 schrieb Koehne Kai:
>>>> -----Original Message-----
>>>> From: Benjamin Zeller [mailto:benjamin.zeller at canonical.com]
>>>> [...]
>>>>> What exactly is your 'Component'? Is it a Qt Quick plugin, a library
>>>>> ... and
>>>> how are the .qml files embedded?
>>>>> Regards
>>>>>
>>>>> Kai
>>>> The Component would be a pure QML based component. No library.
>>>> The QMake just makes sure they are in the import path when installed.
>>> Alright, but does the 'component' implement an import? If so, setting
>> QML_IMPORT_PATH in your .pro file is what you're looking for.
>>> Regards
>>>
>>> Kai
>> Yes it ships a qmldir file if that is what you mean.
>>
>> So it means I have to set the QML_IMPORT_PATH in my application subdir
>> project, or is it enough if I set it in the root level project.
> You should set it in the .pro file of the project that needs the import.
>
> But remember that QML_IMPORT_PATH works similar to e.g. QQmlEngine::addImportPath: It needs to point to the directory that contains the first part of your import as directory. E.g. if you have com.mycompany.Feature as import the import path should specify the directory that contains the 'com' directory.
>
> See also http://doc.qt.io/qt-5/qqmlengine.html#importPathList
>
> Regards
>
> Kai
Thank you , I got it working. It also works by setting the path in the root
project file though.

Regards,

Benjamin



More information about the Qt-creator mailing list