Hi all,

I built an QML extension plugin for reusability.

I linked it to my app project. No problem during execution. Everything works fine except...code completion within QtCreator : my custom QML type (defined in a QML file, not a QML binding from C++) isn't recognized by the QML editor. It's very frustrating.

Here's my project's structure :

src
-- app
---- some things
---- qml.qrc
------ main.qml // error M300
-- libs
---- customquick // Folder of QML plugins
------ controls // my extension plugin
-------- customquickcontrolsplugin.(h/cpp)
-------- gridmenulogic.(h/cpp) // C++ binding class
-------- GridMenu.qml // the type which isn't recognized in main.qml
-------- qmldir

My qmldir :
Qt Code:
  1. module customquick.controls
  2. GridMenu 1.0 GridMenu.qml
  3. plugin customquickcontrolsplugin
  4. classname CustomQuickControlsPlugin
To copy to clipboard, switch view to plain text mode 


main.qml
Qt Code:
  1. import QtQuick 2.2
  2. import QtQuick.Window 2.1
  3. import customquick.controls 1.0
  4.  
  5. Window {
  6. visible: true
  7. width: 360
  8. height: 360
  9.  
  10. GridMenu { // <-- M300 error
  11. id: menu
  12. anchors.fill: parent
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

GridMenu.qml
Qt Code:
  1. import QtQuick 2.0
  2. import customquick.controls 1.0
  3.  
  4. Item {
  5. width: 100
  6. height: 80
  7.  
  8. GridMenuLogic {
  9.  
  10. }
  11. }
To copy to clipboard, switch view to plain text mode 

And my CustomQuickControlsPlugin class :
Qt Code:
  1. void CustomQuickControlsPlugin::registerTypes(const char *uri)
  2. {
  3. // @uri controls
  4. Q_ASSERT(uri == QLatin1String("customquick.controls"));
  5. qmlRegisterType<GridMenuLogic>(uri, 1, 0, "GridMenuLogic");
  6. }
To copy to clipboard, switch view to plain text mode 

The project copies the .qml files to the build directory and I setted the "QML2_IMPORT_PATH" environment var. But GridMenu is still underlined in main.qml...

I works with QtCreator 3.2.0 and Ubuntu 14.04.

Thanks for your help.