P3: Somewhat important
I have some QObject-derived class Foo.
I register it using: qmlRegisterType<Foo>();
I have 2 classes exported to QML: one has this method:
Q_INVOKABLE Foo* createFoo();
Second one has this method:
Q_INVOKABLE void useFoo(const Foo*)
The code in QML:
var foo = firstClass.createFoo();
The last line of code generates exception that the parameter is unknown.
WORKAROUND: I had to remove const specifier from the useFoo parameter.