Important: Please read the Qt Code of Conduct -

Using QML with Qt 4.5 SDK

  • Now I know this is completely a novice question but am currently considering creating a plugin for an application (maya 2011) Currently I was able to compile a small plugin using the QT 4.5 sdk that Maya 2011 was compiled with. and got that working just fine Now I would like to be able to add a QML interface to my plugin but when I compiled my application after adding the "QDeclarativeView" to the main .cpp I got an error stating "QDeclarativeView error: no such file or directory" Now I am guessing that this is because the class QDeclarativeView is only available in 4.7 ? Is this correct? I just want to make sure that I have not missed something along the way and to see if there was in fact a way to run the QML from a plugin compiled with the 4.5 sdk.

  • add to your .pro:

    QT += declarative

  • Moderators

    Yes, QML is available from Qt 4.7.0 onwards. Autodesk is using it's own branch of Qt, though, so maybe they have imported it in some recent release (just guessing).

  • Thanks Volker, I had actually already tried that and that was what was creating the error. Which to Sierdzio's point, is why I had a feeling it would only work with QT 4.7.0. forward. I had actually read a thread somewhere that indicated that it was possible to use QML with QT 4.5 but it did not give an explanation on how it was done which is why I decided to ask here.

Log in to reply