2021-02-12 18:16:06 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2021 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of the Qt Creator documentation.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of
|
|
|
|
|
** this file. Please review the following information to ensure
|
|
|
|
|
** the GNU Free Documentation License version 1.3 requirements
|
|
|
|
|
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\page quick-library.html
|
|
|
|
|
\if defined(qtdesignstudio)
|
2021-03-09 15:17:22 +02:00
|
|
|
\previouspage studio-3d-editor.html
|
2021-02-12 18:16:06 +01:00
|
|
|
\else
|
|
|
|
|
\previouspage creator-using-qt-quick-designer.html
|
|
|
|
|
\endif
|
|
|
|
|
\nextpage qtquick-navigator.html
|
|
|
|
|
|
|
|
|
|
\title Library
|
|
|
|
|
|
|
|
|
|
The \uicontrol Library view lists the available components and assets.
|
|
|
|
|
|
|
|
|
|
\section1 Components
|
|
|
|
|
|
|
|
|
|
\image qtquick-components-tab.png "Library view Components tab"
|
|
|
|
|
|
2021-05-19 11:17:05 +03:00
|
|
|
\uicontrol Library > \uicontrol 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.
|
2021-02-12 18:16:06 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
\uicontrol {Qt.Multimedia} module adds support for audio and video
|
|
|
|
|
files to your UI.
|
|
|
|
|
|
|
|
|
|
\section2 Component Types
|
|
|
|
|
|
|
|
|
|
You can add the following types of components to your project:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li \l Shapes
|
|
|
|
|
\li \l Text
|
|
|
|
|
\li \l Images
|
2021-05-19 13:11:29 +02:00
|
|
|
\li \l {UI Controls}
|
2021-02-12 18:16:06 +01:00
|
|
|
\li \l {User Interaction Methods}
|
|
|
|
|
\li \l {Lists and Other Data Models}
|
|
|
|
|
\if defined(qtdesignstudio)
|
|
|
|
|
\li \l {2D Effects}
|
|
|
|
|
\li \l {Logic Helpers}
|
|
|
|
|
\endif
|
|
|
|
|
\li \l Animations
|
2021-06-07 16:13:00 +02:00
|
|
|
\li \l{3D Views}
|
|
|
|
|
\li \l{Group}
|
|
|
|
|
\li \l{3D Models}
|
|
|
|
|
\li \l{Materials and Shaders}
|
|
|
|
|
\li \l{Textures}
|
|
|
|
|
\li \l{3D Materials}
|
|
|
|
|
\li \l{3D Effects}
|
|
|
|
|
\li \l{Custom Shaders}
|
|
|
|
|
\li \l{Lights}
|
|
|
|
|
\li \l{Cameras}
|
|
|
|
|
\li \l{Scene Environment}
|
2021-02-12 18:16:06 +01:00
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
For more information about creating your own components, see
|
2021-06-07 16:13:00 +02:00
|
|
|
\l{Creating Custom Components}.
|
2021-02-12 18:16:06 +01:00
|
|
|
|
|
|
|
|
\section2 Adding and Removing Modules
|
|
|
|
|
|
2021-04-01 15:17:08 +03:00
|
|
|
When you \l{Creating Projects}{create projects}, modules typically needed in
|
|
|
|
|
them are added by default. For example, an empty application project
|
2021-04-20 09:31:34 +02:00
|
|
|
contains basic components and UI controls, while a 3D application project
|
|
|
|
|
contains additional 3D components.
|
2021-02-12 18:16:06 +01:00
|
|
|
|
2021-04-01 15:17:08 +03:00
|
|
|
To view the list of available modules, select \inlineimage plus.png
|
|
|
|
|
. 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 \uicontrol Search field.
|
|
|
|
|
|
|
|
|
|
Select the module to add it to \uicontrol Library > \uicontrol Components.
|
2021-02-12 18:16:06 +01:00
|
|
|
|
|
|
|
|
\image qtquick-components-tab-add.png "Select Modules to Add"
|
|
|
|
|
|
|
|
|
|
This adds an \e {import statement} to the component code that you
|
2021-04-09 13:58:54 +02:00
|
|
|
can see in \l {Text Editor}. For example, if you add the
|
2021-02-12 18:16:06 +01:00
|
|
|
\uicontrol QtQuick.Controls module, the following import statement
|
|
|
|
|
is added to the code: \c {import QtQuick.Controls}.
|
|
|
|
|
|
2021-04-01 15:17:08 +03:00
|
|
|
Since the added components and modules are packaged with your UI into the
|
|
|
|
|
final application package, it is recommended that you select
|
2021-02-12 18:16:06 +01:00
|
|
|
\uicontrol {Remove Module} to remove the ones you don't use in the project.
|
|
|
|
|
|
|
|
|
|
\section1 Assets
|
|
|
|
|
|
2021-04-23 16:34:13 +03:00
|
|
|
\uicontrol Library > \uicontrol {Assets} displays the images and other files
|
|
|
|
|
that you add to the project folder by selecting \inlineimage plus.png
|
2021-06-24 15:09:07 +03:00
|
|
|
. To add assets to your UI, drag-and-drop them to \l Navigator or
|
|
|
|
|
\l {Form Editor}.
|
|
|
|
|
|
|
|
|
|
To add multiple assets to your UI simultaneously, multiselect them first by
|
|
|
|
|
holding \key Ctrl and clicking the asset files you wish to select.
|
2021-02-12 18:16:06 +01:00
|
|
|
|
|
|
|
|
\image qtquick-assets-tab.png "Library view Assets tab"
|
|
|
|
|
|
2021-04-23 16:34:13 +03:00
|
|
|
When you drag-and-drop assets from \uicontrol Assets to \l Navigator
|
|
|
|
|
or \l {Form Editor}, component instances with a suitable type are
|
|
|
|
|
automatically created for you. For example, instances of the
|
|
|
|
|
\l{Images}{Image} component will be created for graphics files.
|
2021-04-13 16:08:57 +03:00
|
|
|
|
|
|
|
|
\section1 Context Menu Commands
|
|
|
|
|
|
|
|
|
|
\image qtquick-library-context-menu.png "Context menu commands in Library"
|
|
|
|
|
\image qtquick-library-context-menu-hide.png "Context menu command Hide Category"
|
|
|
|
|
|
2021-05-19 11:17:05 +03:00
|
|
|
To use the context menu commands in \uicontrol Library, right-click the
|
|
|
|
|
name of a module or category and select one of the following commands:
|
2021-04-13 16:08:57 +03:00
|
|
|
|
|
|
|
|
\list
|
2021-05-19 11:17:05 +03:00
|
|
|
\li \uicontrol {Remove Module}: removes the module and all of its
|
|
|
|
|
components from \uicontrol Library > \uicontrol Components.
|
2021-04-13 16:08:57 +03:00
|
|
|
\li \uicontrol {Expand All}: expands all the modules.
|
|
|
|
|
\li \uicontrol {Collapse All}: collapses all the modules.
|
|
|
|
|
\li \uicontrol {Hide Category}: hides the category from the module.
|
|
|
|
|
\li \uicontrol {Show Module Hidden Categories}: shows the hidden
|
|
|
|
|
categories of the module.
|
|
|
|
|
\li \uicontrol {Show All Hidden Categories}: shows the hidden
|
|
|
|
|
categories in all of the modules.
|
|
|
|
|
\endlist
|
2021-05-19 11:17:05 +03:00
|
|
|
|
|
|
|
|
\note The context menu commands for the \uicontrol Library categories do not
|
|
|
|
|
function if you have entered something into the \uicontrol Search field.
|
|
|
|
|
Clear the \uicontrol Search field to resume using the context menu commands.
|
2021-02-12 18:16:06 +01:00
|
|
|
*/
|