Library

The Library view lists the available components and assets.

Components

"Library view Components tab"

Components displays modules that have been added to your project. In many modules the components have been further organized into different categories. The modules contain visual components, such as basic shapes, UI controls, and 3D components, and add functionality to the project. All components have a type.

The UI controls can be styled to have the look and feel of a particular operating system, such as macOS, Windows, Android, or iOS.

Some modules have no visible components. For example, the Qt.Multimedia module adds support for audio and video files to your UI.

Component Types

You can add the following types of components to your project:

For more information about creating your own components, see Creating Components.

Adding and Removing Modules

When you create projects, modules typically needed in them are added by default. For example, an empty application project contains basic components and UI controls, while a 3D application project contains additional 3D components.

To view the list of available modules, select . Most commonly used modules are placed at the top of the list in alphabetical order. You can search for components and modules by entering search criteria in the Search field.

Select the module to add it to Library > Components.

"Select Modules to Add"

This adds an import statement to the component code that you can see in Text Editor. For example, if you add the QtQuick.Controls module, the following import statement is added to the code: import QtQuick.Controls.

Since the added components and modules are packaged with your UI into the final application package, it is recommended that you select Remove Module to remove the ones you don't use in the project.

Assets

Library > Assets displays the images and other files that you add to the project folder by selecting .

"Library view Assets tab"

When you drag-and-drop assets from Assets to Navigator or Form Editor, component instances with a suitable type are automatically created for you. For example, instances of the Image component will be created for graphics files.

Context Menu Commands

"Context menu commands in Library"

"Context menu command Hide Category"

To use the context menu commands in Library, right-click on the name of a module or category and select one of the following commands:

  • Remove Module: removes the component module added to Library.
  • Expand All: expands all the modules.
  • Collapse All: collapses all the modules.
  • Hide Category: hides the category from the module.
  • Show Module Hidden Categories: shows the hidden categories of the module.
  • Show All Hidden Categories: shows the hidden categories in all of the modules.

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