Qt Creator Manual

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. You can build the application and deploy it on desktop and mobile target platforms.

    You can select a template that uses either the built-in QML elements or Qt Quick components for a particular platform. The built-in QML elements enable you to create cross-platform applications with a custom look and feel, whereas the components provide the look and feel for a particular platform.

    The Qt Quick 1 Application wizard imports Qt Quick 1.1, and therefore, you can use it without changes to develop for platforms that run Qt 4.7.4 (such as MeeGo). To develop for platforms that run Qt 4.7.3 (such as Maemo), you must change the import statement to import Qt Quick 1.0.

    The Qt Quick 2 Application wizard imports Qt Quick 2.0. Use it to develop for platforms that run Qt 5.

  • 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 projects.
  • Qt Quick 1 Application (from Existing QML File) converts existing Qt Quick 1 applications to Qt Quick application projects. This enables you to run them from Qt Creator and to deploy them to mobile devices.
  • 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

Select File > New File or Project > Applications > Qt Quick UI > Choose and follow the instructions of the wizard.

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 element, such as a component, screen, or the whole application UI.

The import statement in the beginning of the .qml file specifies the Qt modules to import. Each Qt module contains a set of default elements. Specify a version to get the features you want.

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

Creating Qt Quick Applications

Select File > New File or Project > Applications > Qt Quick Application 1 (Built-in Elements) or Qt Quick Application 2 (Built-in Elements) > Choose, and follow the instructions of the wizard.

Note: The SDK for a particular target platform might install additional templates for that platform. For example, the Qt Quick Application for MeeGo Harmattan template is installed as part of the MeeGo Harmattan tool chain and the QNX templates are installed as part of the BlackBerry NDK or the QNX SDK.

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

Importing QML Applications

If you have existing QML applications that you want to run in Qt Creator or deploy to mobile devices, select the Qt Quick Application (from Existing QML File) template to import the main .qml file in your project.

"Select Existing QML File dialog"

All the other files in the project are automatically added to the application project. Qt Creator adds references to the QML files to a project and creates the additional files necessary for deploying applications to mobile devices.