Qt World Summit: Submit your Presentation

What is .qmlproject file?

  • Hi All,

    Could you, please, explain me what is the .qmlproject file? I see that many QtQuick Controls tutorials contain both .pro and .qmlproject files, and some of the tutorials contain only .qmlproject file - why?

    Thank you very much!

  • They are qml-only project files for Qt Creator. Qt Creator will launch qmlviewer with mainFile specified in qmlproject.

  • .qmlproject is used by Qt Creator to handle projects that are QML-only. As Tomma already said, these kinds of projects use the Qmlviewer application to show QML files. This is rather convenient to play with small examples, but requires that a qmlviewer is installed. It also makes it close to impossible to use such projects on devices since it is very hard to limit these apps in what they can do. Basically the qmlviewer will need to have all the interesting permissions (access the network, etc.) so that all Qml applications will actually run in it and all these Qml applications will inherit those permissions.

    That is why bigger non-toy things have a .pro file that builds a small piece of code that is basically a stripped down Qmlviewer application and bundles that with the Qml files. This is a separate binary then which gets its own set of permissions. Since this binary is specific to one Qml application you can limit the program to those it actually needs to function.

Log in to reply