Creating Qt Quick Projects

Use the following wizard templates to create new Qt Quick projects:

  • Application (Qt) > Qt Quick Application
  • Application (Qt for Python) > Qt for Python - Qt Quick Application
  • Other Project > Qt Quick UI Prototype
  • Library > Qt Quick 2 Extension Plugin

The New Project dialog shows detailed information about each project wizard template.

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

Qt Creator creates the necessary boilerplate files. Some of the files are specific to a particular target platform. You can use wizard templates also to add files to the projects.

Qt Quick Applications

  1. Select File > New Project > Application (Qt) > Qt Quick Application > Choose.

    {New Project dialog}

    Note: To use qmake as the build system, develop with Qt 5, or add translations to the application, select Qt Quick Application (compat).

  2. In the Project Location dialog, Name field, enter a name for the project. Keep in mind that you cannot easily change the project name later.
  3. In the Create in field, enter the path for the project files. Select the Use as default project location check box to create new projects in this folder by default. You can move project folders later without problems.
  4. Select Next (or Continue on macOS) to open the Define Build System dialog.

    {Define Project Details dialog}

    To create a project that you can develop with a visual editor in Qt Design Studio, select Create a project that you can open in Qt Design Studio.

  5. In the Build system field, select the build system to use for building and running the project: CMake or Qbs.
  6. Select Next to open the Define Project Details dialog.
  7. Select the Qt version to develop with in the Minimum required Qt version field. The Qt version determines the Qt Quick imports that are used in the QML files.
  8. Select the Use Qt Virtual Keyboard check box to add support for Qt Virtual Keyboard to the application.

    Note: If you have not installed the Qt Virtual Keyboard module when you installed Qt, an error message will appear when you try to open Main.qml for editing. You can use Qt Maintenance Tool to install Qt Virtual Keyboard.

  9. Select Next to open the Kit Selection dialog.
  10. Select kits for the platforms that you want to build the application for.

    Note: Kits are listed if they have been specified in Preferences > Kits. For more information, see Add kits and Kits.

  11. Select Next to open the Project Management dialog.
  12. Review the project settings, and select Finish (on Windows and Linux) or Done (on macOS) to create the project.

Qt Creator creates a QML file, Main.qml, that you can modify in the Edit mode.

Qt Quick UI Projects

Qt Quick UI Prototype projects are useful for testing or prototyping user interfaces, or for setting up a separate project just for QML editing, for example. You cannot use them for application development because they do not have:

  • C++ code
  • Resource files (.qrc)
  • Code needed for deploying applications to devices

For more information about how to turn Qt Quick UI Prototype projects into Qt Quick Application projects, see Converting UI Projects to Applications.

To create a Qt Quick UI Prototype project:

  1. Select File > New Project > Other Project > Qt Quick UI Prototype.
  2. Select Choose to open the Project Location dialog.
  3. In the Name field, enter a name for the application.
  4. In the Create in field, enter the path for the project files. Select the Use as default project location check box to create new projects in this folder by default.
  5. Select Next (or Continue on macOS) to open the Define Project Details dialog.
  6. In the Minimum required Qt version field, select the Qt version to develop with. The Qt version determines the Qt Quick imports that are used in the QML files.

    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).

  7. Select the Use Qt Virtual Keyboard check box to add support for Qt Virtual Keyboard to the application.

    Note: If you have not installed the Qt Virtual Keyboard module when you installed Qt, an error message will appear when you try to open main.qml.

  8. Select Next to open the Kit Selection dialog.
  9. Select kits for the platforms that you want to build the application for.

    Note: Kits are listed if they have been specified in Preferences > Kits. For more information, see Add kits and Kits.

  10. Select Next to open the Project Management dialog.
  11. Review the project settings, and select Finish (on Windows and Linux) or Done (on macOS) to create the project.

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 a UI item, such as a component or the whole application UI.
  • ui.qml file defines a form for the application UI. This file is created if you selected the With .ui.qml file check box.

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

See also Creating a Qt for Python Application with Qt Quick.

© 2024 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.