Creating Projects

Creating a project enables you to:

  • Group files together
  • Include forms and resource files
  • Specify settings for previewing UIs

Setting up a new project in Qt Design Studio is aided by a wizard that guides you step-by-step through the project creation process. The wizards prompt you to enter the settings needed for that particular type of project and create the necessary files for you.

Studio projects are useful for creating UIs. You cannot use them for application development, because they do not contain:

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

Because the UIs do not contain any C++ code, you do not need to build them. To test how well your designs work, you can preview the UIs on the desktop or embedded Linux devices. For more information, see Previewing.

"A list of project wizards"

You can export designs from other design tools and import them to projects or create them from scratch using the following wizards:

  • General generates projects that are suitable for all target platforms.
  • Mobile generates projects that work well on mobile devices.
  • Desktop generates projects that work well on the desktop.

Using Project Wizards

  1. Select File > New File or Project.
  2. Select the type of your project, and then select Choose.
  3. In the Name field, enter a name for the project.
  4. In the Create in field, enter the path for the project files, and then select Next (or Continue on macOS).
  5. In the Screen resolution field, select the screen resolution for previewing the UI on the desktop or on a device.
  6. In the Qt Quick Controls 2 Style field, select one of the predefined UI styles to use, and then select Finish (or Done on macOS).

Qt Design Studio creates the following files and folders:

  • .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, screen, or the whole UI.
  • ui.qml file defines a form for the UI.
  • qtquickcontrols2.conf file specifies the preferred style and some style-specific arguments.
  • imports folder contains a Constants.qml file that specifies a font loader for the Arial font and a qmldir module definition file that declares the Constant QML type. For more information, see Module Definition qmldir Files. In addition, the QtQuick subfolder contains the Studio components and effects QML types.

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

Adding Files to Projects

You can use wizards also to add individual files to your projects. You can create the following types of files:

  • Qt Quick Files
  • Qt Quick Controls
    • Button creates a push button with a text label.
    • Switch creates a switch with on and off states.
    • Pane provides a background that matches the UI style and theme.
    • StackView provides a stack-based navigation model.
    • SwipeView enables users to navigate pages by swiping sideways.
  • QML Files
  • JavaScript File generates files that you can use to write the application logic. This is useful for testing the application before the developers implement the application logic in C++, for example. For more information, see Simulating Application Logic.

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