Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Cannot call c++ function from qml

$
0
0
Wow, this is really strange way of instantiating QML engine and view. Why are you doing this in such a complicated manner?Is your MainWindowMC a QObject? Have you added the Q_OBJECT macro? MainWindowMC is dreived from a class which on the other hand derives from QObject. I had a an issue with Q_OBJECT. The thing is mainM has Q_OBJECT macro (base class of MainWindowMC). When I add Q_OBJECT in MainWindowMC, it throws some strange errors but I think Q_OBJECT moves to MainWindowMC ad it is derived from mainM I have added Q_OBJECT macro but still the same problem. Which part is complicated? I have just started using QML, so I don’t know much about it. I think everything is as it should be. I make engine, give the pointer of context to a class(I don’t want to make my main.cpp too long) and I create component with that context?

Viewing all articles
Browse latest Browse all 4972

Trending Articles