[Qt-creator] QtCreator + QBS + QML plugins

Ruslan Nigmatullin euroelessar at yandex.ru
Tue Mar 3 03:51:51 CET 2015


Hi friends,

Pre-restrictions: Using QtCreator with QBS Project Manager.

Let's suggest a simple case, a project consists of two products:
1. QtQuick plugin with QML components
2. QtQuick application which uses this plugin

Looks like it's impossible to get working auto-completion in case if you try to use plugin's QML Components in application's QML code.

At the same time this workflow works for qmake-based projects due to QML_IMPORT_PATH variable support (it allows application to tell QtCreator project-specific qml import paths, so QtCreator is able to find all "qmldir" files in subdirs and parse them).

I've thought a bit how it possible to implement support of this feature for QbsProject as well. QmlJS::ModelManagerInterface has a method which makes possible to extract information about QML Components from passed "qmldir" file, but this method is private. The public API allows only to pass "import" path by ProjectInfo updates.

So the question is: is it OK to add qmlDirs property to ProjectInfo, collect paths of all "qmldir"s in QbsProject and pass them to QmlJS::ModelManagerInterface by ProjectInfo's update?

Or may be there is a better solution?

Ruslan



More information about the Qt-creator mailing list