2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/****************************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								**
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-25 11:24:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** Copyright (C) 2020 The Qt Company Ltd.
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-15 14:51:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** Contact: https://www.qt.io/licensing/
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								**
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-15 14:51:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** This file is part of the Qt Creator documentation.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								**
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-15 14:51:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** 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.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								**
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-15 14:51:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** GNU Free Documentation License Usage
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								** Alternatively, this file may be used under the terms of the GNU Free
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								** Documentation License version 1.3 as published by the Free Software
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-15 14:51:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								** 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.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								**
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								****************************************************************************/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// **********************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// NOTE: the sections are not ordered by their logical order to avoid
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// reshuffling the file each time the index order changes (i.e., often).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Run the fixnavi.pl script to adjust the links to the index order.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// **********************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/*!
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \page quick-components.html
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-29 15:10:22 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \if defined(qtdesignstudio)
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-24 11:27:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \previouspage quick-uis.html
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-29 15:10:22 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \else
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-24 13:46:38 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \previouspage creator-using-qt-quick-designer.html
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-29 15:10:22 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \endif
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-21 16:18:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \nextpage qtquick-form-editor.html
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \title Creating Components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 11:39:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    A \l{glossary-component}{component} provides a way of defining a new visual item
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    that you can re-use in other QML files. A component is like a black box; it
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    interacts with the outside world through properties, signals, and slots, and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    is generally defined in its own QML file. You can import components to
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    applications.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-25 11:24:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The \uicontrol {Library} view lists the available QML types, UI
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-20 16:32:01 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    components, assets, and QML imports.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-qml-components.png "QML Components"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The \uicontrol {QML Types} tab displays the QML types grouped by category,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    such as your own QML components, basic types, layouts, positioner types, and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    views.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Sets of UI components with the look and feel of a particular mobile device
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    platform have been defined for Qt Quick 1. Since Qt 5.1, ready-made Qt
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Quick Controls, Dialogs, and Layouts are available for creating user
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    interfaces using Qt Quick 2. The components and controls are based on
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    standard QML types. To view the components and controls in
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-20 16:32:01 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Library}, import the component sets in \uicontrol {QML Imports}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    The \uicontrol {Qt Quick Application} wizards for a particular platform add
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the import statements automatically. You can remove import statements in
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-22 16:03:39 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {QML Imports}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-13 13:11:07 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Assets} displays the images and other files that you copy
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    to the project folder (to the same subfolder as the QML files).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section1 Adding Components to Designs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-editing-components.png "Editing QML components in Design mode"
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list 1
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Drag and drop components from \uicontrol Library (1) to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \uicontrol Navigator (2) or \uicontrol {Form Editor} (3).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li Select components in \uicontrol Navigator to edit their
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            properties in \uicontrol Properties.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \image qmldesigner-properties-view.png "Properties view"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            For more information, see \l {Specifying Item Properties}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Connect components to signals or create bindings between components
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            in the \uicontrol Connections view.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \image qmldesigner-bindings.png "Connections view Bindings tab"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            For more information, see \l{Adding Connections}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Add states to apply sets of changes to the properties of one or
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            several components in the \uicontrol States view.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            For more information, see \l{Adding States}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li Animate component properties in the \uicontrol Timeline view.
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-22 16:06:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            For more information, see \l{Creating Animations}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section1 Using Basic QML Types
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 11:39:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can use the following QML types to create components:
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{AnimatedImage}{Animated Image} provides a way to play
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:59:05 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            animations stored as images containing a series of frames, such
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            as those stored in GIF files.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{BorderImage}{Border Image} uses an image as a border or
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            background.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{Image} adds a bitmap to the scene. You can stretch and
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            tile images.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{Item} is the most basic of all visual types in QML. Even
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            though it has no visual appearance, it defines all the properties
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            that are common across visual types, such as the x and y position,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            width and height, anchoring, and key handling.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick] {Rectangle} adds a rectangle that is painted with a solid
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            fill color and an optional border. You can use the radius property
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            to create rounded rectangles.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{Text} adds formatted read-only text.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{TextEdit}{Text Edit} adds a single line of editable
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            formatted text that can be validated.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{TextInput}{Text Input} adds a single line of editable
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            plain text that can be validated.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section1 Using Data Models
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can create the following types of views to organize items provided by
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{Models and Views in Qt Quick}{data models}:
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{GridView}{Grid View} provides a grid vizualization of a model.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{ListView}{List View} provides a list vizualization of a model.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{PathView}{Path View} visualizes the contents of a model along a
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            path. For more information, see \l{Editing PathView Properties}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls] {ScrollView}{Scroll View} provides scrolling
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            for user-defined content. It can be used instead of a \l Flickable
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            item.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls] {StackView}{Stack View} provides a stack-based
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            navigation model.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l[QtQuickControls] {SwipeView}{Swipe View} enables users to
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            navigate pages by swiping sideways.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    When you add a \l{GridView}{Grid View}, \l{ListView}{List View}, or
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{PathView}{Path View}, the ListModel and the delegate component that
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    creates an instance for each item in the model are added automatically.
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can edit item properties in \uicontrol Properties or in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Text Editor}. You can also replace the default model and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    delegate with other, more complex models and delegates in
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Text Editor}. \l{ItemDelegate}{Item Delegate} and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{SwipeDelegate}{Swipe Delegate} delegate components are also available
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    in \uicontrol Library.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section1 Positioning Items in UIs
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The position of an item in the UI can be either absolute or
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    relative to other items. If you are designing a static UI,
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \l{Important Concepts In Qt Quick - Positioning#manual-positioning}
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    {manual positioning} provides the most efficient form of positioning
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    items. For a dynamic UI, you can employ the following positioning
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    methods provided by Qt Quick:
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{Setting Bindings}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{Setting Anchors and Margins}
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-04 18:03:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l{Aligning and Distributing Items}
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l{Using Positioners}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{Using Layouts}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{Organizing Items}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section2 Setting Bindings
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{Positioning with Bindings} {Property binding} is a declarative way of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    specifying the value of a property. Binding allows a property value to be
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    expressed as a JavaScript expression that defines the value relative to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    other property values or data accessible in the application. The property
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    value is automatically kept up to date if the other properties or data
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    values change.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Property bindings are created implicitly in QML whenever a property is
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    assigned a JavaScript expression. To set JavaScript expressions as values
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 15:52:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    of properties in the Design mode, select the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \inlineimage icons/action-icon.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol Actions) menu next to a property, and then select
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Set Binding}.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-set-expression.png "Type properties context menu"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    In \uicontrol {Binding Editor}, select an item and a property from
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 15:52:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    lists of available items and their properties.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-binding-editor.png "Binding Editor"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Alternatively, start typing a
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    string and press \key Ctrl+Space to display a list of properties, IDs, and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    code snippets. When you enter a period (.) after a property name, a list of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    available values is displayed. Press \key Enter to accept the first
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    suggestion in the list and to complete the code.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 15:52:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    When a binding is set, the \uicontrol Actions menu icon changes to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \inlineimage icons/action-icon-binding
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    . To remove bindings, select \uicontrol Actions > \uicontrol Reset.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can set bindings also in the \uicontrol Connections view. For more
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    information, see \l {Adding Bindings Between Properties}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    For more information on the JavaScript environment provided by QML, see
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{Integrating QML and JavaScript}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Bindings are a black box for the Design mode and using them might have a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    negative impact on performance, so consider setting anchors and margins for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    items, instead. For example, instead of setting \c {parent.width} for an
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    item, you could anchor the item to its sibling items on the left and the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    right.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section2 Setting Anchors and Margins
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    In an \l{Important Concepts In Qt Quick - Positioning#anchors}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {anchor-based} layout, each QML type can be thought of as having a set of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    invisible \e anchor lines: top, bottom, left, right, fill, horizontal
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    center, vertical center, and baseline.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-25 11:24:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    In the \uicontrol Layout tab you can set anchors and margins for items. To
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    set the anchors of an item, click the anchor buttons. You can combine the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    top/bottom, left/right, and horizontal/vertical anchors to anchor items in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the corners of the parent item or center them horizontally or vertically
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    within the parent item.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-anchor-buttons.png "Anchor buttons"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-24 16:18:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    For convenience, you can click the \inlineimage anchor-fill.png
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to an
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    item and the \inlineimage qtcreator-anchors-reset-icon.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol {Reset Anchors}) button to reset the anchors to their saved
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    state.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can specify the baseline anchor in \uicontrol {Text Editor} in the
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Design mode.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    For performance reasons, you can only anchor an item to its siblings
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    and direct parent. By default, an item is anchored to its parent when
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    you use the anchor buttons. Select a sibling of the item in the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol Target field to anchor to it, instead.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Arbitrary anchoring is not supported. For example, you cannot specify:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \c {anchor.left: parent.right}. You have to specify:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \c {anchor.left: parent.left}. When you use the anchor buttons, anchors to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the parent item are always specified to the same side. However, anchors to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    sibling items are specified to the opposite side:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \c {anchor.left: sibling.right}. This allows you to keep sibling items
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    together.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    In the following image, \uicontrol{Rectangle 2} is anchored to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Rectangle 1} on its left and to the bottom of its parent.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-anchors.png "Anchoring sibling items"
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The anchors for \uicontrol{Rectangle 2} are specified as follows in code:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \qml
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Rectangle {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        id: rectangle2
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        anchors.left: rectangle1.right
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-04 18:03:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        anchors.leftMargin: 10
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        anchors.bottom: parent.bottom
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-04 18:03:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        anchors.bottomMargin: 10
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        //
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endqml
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Margins specify the amount of empty space to leave to the outside of an
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    item. Margins only have meaning for anchors. They do not take any effect
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    when using layouts or absolute positioning.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-04 18:03:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section2 Aligning and Distributing Items
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    When you're working with a group of items, you can select them to align
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    and distribute them evenly. As the positions of the items are fixed, you
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    cannot apply these functions to anchored items. For scalability, you can
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    anchor the aligned and distributed items when your design is ready.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-alignment.png "Aligning sibling items"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Select the buttons in the \uicontrol Align group to align the top/bottom
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    or left/right edges of the items in the group to the one farthest away from
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the center of the group. For example, when left-aligning, the items are
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    aligned to the leftmost item. You can also align the horizontal/vertical
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    centers of items, or both, as in the image above.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    In the \uicontrol {Align to} field, select whether to align the items in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    respect to the selection, the root item, or a \e {key object} that you
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    select in the \uicontrol {Key object} field. The key object must be a part
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    of the selection.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can distribute either \e objects or the \e spacing between them. If the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    objects or spacing cannot be distributed to equal pixel values without
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ending up with half pixels, you receive a notification. You can either allow
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \QDS to distribute objects or spacing using the closest values possible or
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    tweak your design so that the objects and spacing can be distributed
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    perfectly.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    When distributing objects, you can select whether the distance between
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    them is calculated from their top/bottom or left/right edges or their
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    horizontal/vertical center.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-distribute-objects.png "Distribute objects buttons"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can distribute spacing either evenly within a target area or at
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    specified distances, calculated from a starting point.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can select the orientation in which the objects are distributed evenly
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    within the target area: horizontally along the x axis or vertically along
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the y axis.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-distribute-spacing-evenly.png "Distribute spacing evenly"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Alternatively, you can distribute spacing in pixels by selecting one of the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    starting point buttons: left/right or top/bottom edge of the target area,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    or its horizontal/vertical center. Note that some items might end up outside
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the target area.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-distribute-spacing-pixels.png "Distribute spacing in pixels"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can set the space between objects in pixels. You can
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    disable the distribution of spacing in pixels by clicking
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the \inlineimage qmldesigner-distribute-spacing-x.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    button.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section2 Using Positioners
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{Important Concepts In Qt Quick - Positioning#positioners}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {Positioner items} are container items that manage the positions of items
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    in a declarative user interface. Positioners behave in a similar way to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the layout managers used with standard Qt widgets, except that they are
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    also containers in their own right.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can use the following positioners to arrange items in UIs:
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l[QtQuick] {Column} arranges its child items vertically.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l[QtQuick] {Row} arranges its child items horizontally.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l[QtQuick] {Grid}
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            arranges its child items so that they are aligned in a grid and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            are not overlapping.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l[QtQuick] {Flow}
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            arranges its child items side by side, wrapping as necessary.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-20 15:20:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    To position several items in a \uicontrol Column, \uicontrol Row,
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol Grid, or \uicontrol Flow, select the items in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Form Editor}, and then select \uicontrol Position in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the context menu.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section2 Using Layouts
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Since Qt 5.1, you can use QML types in the \l{qtquicklayouts-index.html}
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    {Qt Quick Layouts} module to arrange Qt Quick items in UIs. Unlike
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    positioners, they manage both the positions and sizes of items in a
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    declarative interface. They are well suited for resizable UIs.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can use the following layout types to arrange items in UIs:
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{ColumnLayout}{Column Layout} provides a grid layout with only
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            one column.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{RowLayout}{Row Layout} provides a grid layout with only one row.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{GridLayout}{Grid Layout} provides a way of dynamically arranging
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            items in a grid.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{StackLayout}{Stack Layout} provides a stack of items where only
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            one item is visible at a time.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-20 15:20:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    To lay out several items in a column, row, grid, or
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Stack Layout}, select the items in \uicontrol {Form Editor},
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    and then select \uicontrol Layout in the context menu.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can also click the \inlineimage column.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol {Column Layout}), \inlineimage row.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol {Row Layout}), and \inlineimage grid.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol {Grid Layout}) toolbar buttons to apply
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    layouts to the selected items.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    To make an item within a layout as wide as possible while respecting the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    given constraints, select the item in \uicontrol {Form Editor}, and then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    select \uicontrol Layout > \uicontrol {Fill Width} in the context menu. To
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    make the item as high as possible, select \uicontrol {Fill Height}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section2 Editing Stack Layouts
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qtquick-designer-stacked-view.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    To add items to a \uicontrol {Stack Layout}, select the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \inlineimage plus.png
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    button next to the type name in \uicontrol {Form Editor}. To move
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    between items, select the \inlineimage prev.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol Previous) and \inlineimage next.png
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    (\uicontrol Next) buttons.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    To add a tab bar to a stack layout, select \uicontrol {Stacked Container} >
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Add Tab Bar}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    To raise or lower the stacking order of an item, select
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Stacked Container} > \uicontrol {Increase Index} or
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Decrease Index}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section2 Organizing Items
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Since Qt 5.7, you can use the following \l{Qt Quick Controls} types to
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    organize items in UIs:
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Frame} places a logical group of controls
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            within a visual frame.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{GroupBox}{Group Box} is used to lay out a
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            logical group of controls together, within a titled visual frame.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Label} is a text label with inherited styling
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            and font.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Page} provides a styled page control with
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            support for a header and footer.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{PageIndicator}{Page Indicator} indicates the
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            currently active page.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Pane} provides a background matching with the
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            application style and theme.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section1 Adding User Interaction Methods
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    You can use the following QML types to add basic interaction methods to
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    UIs:
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{Flickable}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            items can be flicked horizontally or vertically.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        \li \l{FocusScope}{Focus Scope}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            assists in keyboard focus handling when building reusable QML
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            components.
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-14 16:00:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuick]{MouseArea}{Mouse Area} enables simple mouse handling.
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Since Qt 5.7, you can also use the following \l{Qt Quick Controls} types
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    to inform users about the progress of the application or to gather input
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    from the user:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{BusyIndicator}{Busy Indicator} indicates
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            activity while content is being loaded.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Button} provides a push button that you can
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            associate with an action.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{CheckBox}{Check Box} provides an option button
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            that can be toggled on (checked) or off (unchecked).
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{CheckDelegate}{Check Delegate} presents an
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            item delegate that can be toggled on (checked) or off (unchecked).
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{ComboBox}{Combo Box} is a combined button and
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            popup list that is populated by using a data model.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{DelayButton}{Delay Button} provides an option
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            button that is triggered when held down long enough.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Dial} is a circular dial that is rotated to
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            set a value.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{ProgressBar}{Progress Bar} indicates the
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            progress of an operation.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{RadioButton}{Radio Button} provides an option
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            button that can be switched on (checked) or off (unchecked).
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{RadioDelegate}{Radio Delegate} presents an
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            item delegate that can be toggled on (checked) or off (unchecked).
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{RangeSlider}{Range Slider} enables users to
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            select a range of values by sliding two handles along a track.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{RoundButton}{Round Button} provides a push
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            button with rounded corners that you can associate with an action.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Slider} selects a value by sliding a handle
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            along a track.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{SpinBox}{Spin Box} enables the user to specify
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            a value by clicking the up or down buttons, by pressing up or down
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            on the keyboard, or by entering a value in the box.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Switch} is an option button that can be
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            toggled on or off.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{SwitchDelegate}{Switch Delegate} presents an
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            item delegate with a switch indicator that can be toggled on or off.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls] {TabBar}{Tab Bar} enables users to switch
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            between different views or subtasks.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{TabButton}{Tab Button} is a button
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            that is functionally similar to \uicontrol Button, but provides a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            look that is more suitable for a \uicontrol {Tab Bar}.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{TextArea}{Text Area} displays multiple lines
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            of editable formatted text.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{TextField}{Text Field} displays a single line
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            of editable plain text.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{ToolBar}{Tool Bar} is a container of
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            application-wide and context sensitive actions and controls, such as
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            navigation buttons and search fields.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{ToolButton}{Tool Button} is a button
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            that is functionally similar to \uicontrol Button, but provides a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            look that is more suitable for a \uicontrol {Tool Bar}.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{ToolSeparator}{Tool Separator} separates a
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-12 15:52:43 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            group of items from adjacent items on a \uicontrol {Tool Bar}.
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-08 16:56:13 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l [QtQuickControls]{Tumbler} is a spinnable wheel of items that
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            can be selected.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-27 14:04:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    You can also use the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l {https://doc-snapshots.qt.io/qt5-5.13/qml-qtquick-dialogs-dialog.html}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {Dialog} type in the Qt Quick Dialogs module to wrap arbitrary content into
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    a dialog window including a row of platform-tailored buttons.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-21 16:57:07 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \if defined(qtdesignstudio)
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-03 11:49:25 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \include qtdesignstudio-visual-effects.qdocinc qml visual effects
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-21 16:57:07 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \include qtdesignstudio-components.qdocinc creating studio components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \include qtdesignstudio-components.qdocinc studio components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-11 13:36:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section1 History of Qt Quick Controls
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    In Qt 4, ready-made Qt Quick 1 Components were provided for creating
							 | 
						
					
						
							
								
									
										
										
										
											2019-04-16 11:15:09 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    UIs with a native look and feel for a particular target platform.
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    In Qt 5.1, Qt Quick Controls, Dialogs, and Layouts were added for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    creating classic desktop-style user interfaces using Qt Quick 2.1. The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Qt Quick Controls Styles could be used to customize Qt Quick Controls.
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-08 17:20:20 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-30 14:23:05 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Since Qt 5.7, \l {Qt Quick Controls 2} replace Qt Quick Controls 1 and
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Qt Labs Controls. They provide lightweight QML types for creating performant
							 | 
						
					
						
							
								
									
										
										
										
											2017-08-17 17:02:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    user interfaces for \l{glossary-device}{devices}.
							 | 
						
					
						
							
								
									
										
										
										
											2016-03-22 16:14:09 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Qt Quick Controls 2 achieve improved efficiency by employing a simplified
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-29 10:43:01 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \l {Styling Qt Quick Controls}{styling architecture} when compared to
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-25 17:46:23 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Qt Quick Controls, on which the module is based. The visual editor reads the
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \c qtquickcontrols2.conf file that specifies the preferred style and some
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    style-specific arguments. To change the style, select another style from
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    the list on the toolbar. This enables you to check how your UI looks when
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    using the available styles.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-25 17:46:23 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    For an example of defining your own style and using it in the Design mode, see
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-05 14:28:08 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \l {Qt Quick Controls 2 - Flat Style}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-16 16:42:15 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    For more information about how to customize a particular control, see
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \l{Customization Reference}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Qt Quick Controls 2 work in conjunction with Qt Quick and Qt Quick Layouts.
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-26 16:40:58 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-08 17:20:20 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The \QC project wizards create Qt Quick applications that use Qt Quick
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    2 types or Qt Quick Controls 2 types.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Even if you use Qt Quick Controls 2, you can still write cross-platform
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    applications, by using different sets of QML files for each platform.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-04 11:47:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Some ready-made controls, such as a gauge, dial, status indicator, and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    tumbler, are provided by the \l {Qt Quick Extras} module.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-25 17:46:23 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \section1 Creating Components in Design Mode
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list 1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-11 15:43:19 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Select \uicontrol File > \uicontrol {New File or Project} >
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-30 14:26:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            \if defined(qtcreator)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \uicontrol Qt > \uicontrol {QML File (Qt Quick 2)} >
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \else
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \uicontrol {Qt Quick Files} > \uicontrol {Qt Quick File} >
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            \uicontrol Choose to create a new .qml file.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            \note Components are listed in the \uicontrol {My QML Components}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            tab in the \uicontrol Library view only if the filename begins with
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            a capital letter.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-25 17:46:23 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Click \uicontrol Design to open the .qml file in the Design mode.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Drag and drop a QML type from \uicontrol Library to
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-03 15:43:05 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            \uicontrol Navigator or \uicontrol {Form Editor}.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li Edit its properties in \uicontrol Properties.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-13 11:39:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            The available properties depend on the QML type.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    The following sections contain more information about how to use
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-21 16:18:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Form Editor} to edit 2D content, as well as examples of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    how to create some common components using basic QML types:
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \list
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-21 16:18:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l{Editing 2D Content}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-02-06 08:50:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l{Creating Buttons}
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-02-06 08:50:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        \li \l{Creating Scalable Buttons and Borders}
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \endlist
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \section1 Moving Within Components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    Components can consist of several other components. To view the component
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-07 09:24:14 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    hierarchy as a bread crumb path when you edit a component in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \uicontrol {Form Editor}, select \uicontrol {Go into Component} or press
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \key F2. Click the component names in the path to navigate to them. You
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    can easily navigate back to the top level when you are done editing the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    component.
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 15:07:05 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    \image qmldesigner-breadcrumbs.png "Go into Component command"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								*/
							 |