Singleton signal c++ qml example
-
@
#include <QtQml>
#include "singletontypeexample.h"int main(int argc, char* argv[])
{
...
qmlRegisterSingletonType<SingletonTypeExample>("Qt.example.qobjectSingleton", 1, 0, "MyApi", example_qobject_singletontype_provider);
...@
-
Instead of
@
import Qt.example.qobjectSingleton 1.0
@try
@
import Qt.example.qobjectSingleton 1.0 as ExampleApi
property int someValue: ExampleApi.MyApi.someProperty
@From the docs.
-
Yes I can access the value .. "ExampleApi.MyApi.someProperty" there is no error message
But still a red line underneath the Import statement and no code completionis this maybe normal on Qt if I use pointers ?
-
This could be the parsing problems in QtCreator. Try restarting the QtCreator.
-
Hello.
I have exact the same problem.
At this time i have create a QtQuick Plugin project and register my singletontype in this project. In my other project i have add QML_IMPORT_PATH = PathToMyQtQuickPlugin and now i have no red line underneath the import statement in QML but i have no code completion.
When i run the project all works fine.
I am a little bit confused.
Have anybody a solution?
Thanks.
-
Hello.
I have exact the same problem.
At this time i have create a QtQuick Plugin project and register my singletontype in this project. In my other project i have add QML_IMPORT_PATH = PathToMyQtQuickPlugin and now i have no red line underneath the import statement in QML but i have no code completion.
When i run the project all works fine.
I am a little bit confused.
Have anybody a solution?
Thanks.
-
I still have no solution. A restart of Qt did not solve the problem
-
I still have no solution. A restart of Qt did not solve the problem
-
Hello.
I have seen the following video from Qt Developer Days 2013 about Qt Quick Controls.
https://www.youtube.com/watch?v=JLLIYysXsj8In this Video shows Jens Bache-Wiig live coding with Qt Quick Controls and bind controls to a c++ class. This c++ class has he registered as singleton and he has the same problem. He has no auto complete in Qt Creator.
I think at this time, we must life with this problem. I hope that this feature comes in Qt Creator in a future release.
@xenotrax: Thanks for reply.
-
Hello.
I have seen the following video from Qt Developer Days 2013 about Qt Quick Controls.
https://www.youtube.com/watch?v=JLLIYysXsj8In this Video shows Jens Bache-Wiig live coding with Qt Quick Controls and bind controls to a c++ class. This c++ class has he registered as singleton and he has the same problem. He has no auto complete in Qt Creator.
I think at this time, we must life with this problem. I hope that this feature comes in Qt Creator in a future release.
@xenotrax: Thanks for reply.