Stefan Monov
Stefan Monov

Reputation: 11732

".import" statement (for importing Qml type in JS) fails with syntax error

I registered a C++ type as a QML singleton object via qmlRegisterSingletonType. Then I tried importing this QML singleton into JS via:

.import FileIO 1.0 as FileIO

...and got a "Syntax error" message at runtime.

Any solution?

Upvotes: 2

Views: 328

Answers (1)

Stefan Monov
Stefan Monov

Reputation: 11732

The problem was that I had some (non-comment) code before the .import. Moving the import before that code fixed it.

Upvotes: 2

Related Questions