Creating Qt Quick Projects

"New File or Project dialog"

When you create a new Qt Quick project from scratch, you have the following options:

  • Qt Quick Application creates a Qt Quick application project that can contain both QML and C++ code. The project includes a QDeclarativeView or QQuickView. You can build the application and deploy it to desktop and mobile target platforms.
  • Qt Quick UI creates a Qt Quick UI project with a single QML file that contains the main view. You can review Qt Quick UI projects in a preview tool and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of project.
  • Qt Quick Extension Plugins (in the Libraries category) create C++ plugins that make it possible to offer extensions that can be loaded dynamically into Qt Quick applications. Select Qt Quick 1 Extension Plugin to create extensions for Qt Quick 1 applications and Qt Quick 2 Extension Plugin to create extensions for Qt Quick 2 applications.

Creating Qt Quick UI Projects

  1. Select File > New File or Project > Application > Qt Quick UI > Choose.
  2. In the Qt Quick component set field, select the component set to use for the project. The Qt Quick imports enable you to use the basic QML types to create user interfaces, whereas the Qt Quick Controls provide a set of ready-made controls that you can customize by using Qt Quick Controls Styles:
    • Select Qt Quick Controls or Qt Quick 2.1, or later, to develop for platforms that run Qt 5.
    • Select Qt Quick 1.1 to develop for platforms that run Qt 4.7.4. To develop for platforms that run Qt 4.7.1, 4.7.2, or 4.7.3, you must change the import statement to import Qt Quick 1.0.

    You can add imports later to combine Qt Quick basic types with Qt Quick Controls, Qt Quick Dialogs, and Qt Quick Layouts (available since Qt 5.1).

Qt Creator creates the following files:

  • .qmlproject project file defines that all QML, JavaScript, and image files in the project folder belong to the project. Therefore, you do not need to individually list all the files in the project.
  • .qml file defines an UI item, such as a component, screen, or the whole application UI.
  • .qml.ui files defines a form for the application UI. It is created if you select Qt Quick Controls 1.3, or later, or Qt Quick 2.4, or later. The forms can contain a subset of the QML language. Similarly as with the UI forms for Qt Designer, it is recommended that you use Qt Quick Designer to edit the UI forms. For more information, see Qt Quick UI Forms.

To use JavaScript and image files in the application, copy them to the project folder.

Creating Qt Quick Applications

  1. Select File > New File or Project > Application > Qt Quick Application > Choose.
  2. In the Qt Quick component set field, select the component set to use for the project. For more information, see Creating Qt Quick UI Projects.
  3. Select kits for running and building your project, and then click Next.

    Note: Kits are listed if they have been specified in Tools > Options > Build & Run > Kits.

  4. Review the project settings, and click Finish (on Windows and Linux) or Done (on OS X) to create the project.

Note: The SDK for a particular target platform might install additional templates for that platform. For example, the BlackBerry 10 and QNX templates are installed as part of the BlackBerry 10 NDK, BlackBerry NDK, or QNX SDK.

Qt Creator creates the necessary boilerplate files. Some of the files are specific to a particular target platform.

© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.