Qt-Creator CodeCompletion: C++ models exposing via Q_INVOKABLE to QML
-
Is there a change to get CodeCompletion running Qt-Creator with the following "design":
C++ Model app:
#define MODEL_ACCESSOR(method_name, model_member_) Q_INVOKABLE QObject* method_name() const { return model_member_; } ... MODEL_ACCESSOR(coffee, coffee_view_model_) ... qml_app_engine_.rootContext()->setContextProperty("app", this); ... qml_utils::owned_object(coffee_view_model_= new CoffeeModel(this)); ...
Coffee:
class Coffee: public QObject { Q_OBJECT Q_PROPERTY(int temperature READ temperature NOTIFY temperatureChanged)
QML:
Coffee{ temperature: app.coffee().temperature }
(my) problem in Qt-Creator:
Auto Completion works in the QML File for app.coffee() But it cant resolve and autocomplete the propertys of the Coffee class.
At this point: "app.coffee()." it cant resolve the propertys.
Does anyone knows an Solution?