Merge remote-tracking branch 'origin/4.14'

Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
This commit is contained in:
Eike Ziller
2020-11-19 15:38:13 +01:00
271 changed files with 2816 additions and 1016 deletions

View File

@@ -6,6 +6,7 @@ set(QT_CREATOR_API_DEFINED TRUE)
set(IDE_QT_VERSION_MIN "5.14.0") set(IDE_QT_VERSION_MIN "5.14.0")
include(${CMAKE_CURRENT_LIST_DIR}/QtCreatorAPIInternal.cmake) include(${CMAKE_CURRENT_LIST_DIR}/QtCreatorAPIInternal.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/QtcSeparateDebugInfo.cmake)
set(IDE_APP_PATH "${_IDE_APP_PATH}") # The target path of the IDE application (relative to CMAKE_INSTALL_PREFIX). set(IDE_APP_PATH "${_IDE_APP_PATH}") # The target path of the IDE application (relative to CMAKE_INSTALL_PREFIX).
set(IDE_APP_TARGET "${_IDE_APP_TARGET}") # The IDE application name. set(IDE_APP_TARGET "${_IDE_APP_TARGET}") # The IDE application name.
@@ -266,6 +267,8 @@ function(add_qtc_library name)
OPTIONAL OPTIONAL
) )
qtc_enable_separate_debug_info(${name} "${IDE_LIBRARY_PATH}")
if (library_type STREQUAL "SHARED") if (library_type STREQUAL "SHARED")
set(target_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) set(target_prefix ${CMAKE_SHARED_LIBRARY_PREFIX})
if (WIN32) if (WIN32)
@@ -508,6 +511,8 @@ function(add_qtc_plugin target_name)
OPTIONAL OPTIONAL
) )
qtc_enable_separate_debug_info(${target_name} "${plugin_dir}")
if (_arg_EXPORT) if (_arg_EXPORT)
# export of external plugins # export of external plugins
install(EXPORT ${export} install(EXPORT ${export}
@@ -707,7 +712,8 @@ function(add_qtc_executable name)
get_target_property(_location ${_lib} LOCATION) get_target_property(_location ${_lib} LOCATION)
get_target_property(_is_framework ${_lib} FRAMEWORK) get_target_property(_is_framework ${_lib} FRAMEWORK)
if (_is_framework) if (_is_framework)
set(_location ${_location}/../..) # get rid of the whole Foo.framework/* part whereever it is
string(REGEX REPLACE "/[^/]*[.]framework/.*" "" _location ${_location})
endif() endif()
get_filename_component(_abs_location ${_location} ABSOLUTE) get_filename_component(_abs_location ${_location} ABSOLUTE)
list(APPEND _rpaths_to_remove "${_abs_location}") list(APPEND _rpaths_to_remove "${_abs_location}")
@@ -739,6 +745,8 @@ function(add_qtc_executable name)
) )
endif() endif()
qtc_enable_separate_debug_info(${name} "${_DESTINATION}")
update_cached_list(__QTC_INSTALLED_EXECUTABLES update_cached_list(__QTC_INSTALLED_EXECUTABLES
"${_DESTINATION}/${name}${CMAKE_EXECUTABLE_SUFFIX}") "${_DESTINATION}/${name}${CMAKE_EXECUTABLE_SUFFIX}")

View File

@@ -0,0 +1,16 @@
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.${BUNDLE_ID}</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}</string>
<key>CFBundleVersion</key>
<string>${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}</string>
</dict>
</plist>

View File

@@ -0,0 +1,159 @@
if(CMAKE_VERSION VERSION_LESS 3.17.0)
set(CMAKE_CURRENT_FUNCTION_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
endif()
# Enable separate debug information for the given target
# when doing RelWithDebInfo build
function(qtc_enable_separate_debug_info target installDestination)
if (NOT CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
return()
endif()
if (NOT UNIX AND NOT MINGW)
qtc_internal_install_pdb_files(${target} ${installDestination})
return()
endif()
get_target_property(target_type ${target} TYPE)
if (NOT target_type STREQUAL "MODULE_LIBRARY" AND
NOT target_type STREQUAL "SHARED_LIBRARY" AND
NOT target_type STREQUAL "EXECUTABLE")
return()
endif()
get_property(target_source_dir TARGET ${target} PROPERTY SOURCE_DIR)
get_property(skip_separate_debug_info DIRECTORY "${target_source_dir}" PROPERTY _qt_skip_separate_debug_info)
if (skip_separate_debug_info)
return()
endif()
unset(commands)
if(APPLE)
find_program(DSYMUTIL_PROGRAM dsymutil)
set(copy_bin ${DSYMUTIL_PROGRAM})
set(strip_bin ${CMAKE_STRIP})
set(debug_info_suffix dSYM)
set(copy_bin_out_arg --flat -o)
set(strip_args -S)
else()
set(copy_bin ${CMAKE_OBJCOPY})
set(strip_bin ${CMAKE_OBJCOPY})
if(QNX)
set(debug_info_suffix sym)
set(debug_info_keep --keep-file-symbols)
set(strip_args "--strip-debug -R.ident")
else()
set(debug_info_suffix debug)
set(debug_info_keep --only-keep-debug)
set(strip_args --strip-debug)
endif()
endif()
if(APPLE)
get_target_property(is_framework ${target} FRAMEWORK)
if(is_framework)
set(debug_info_bundle_dir "$<TARGET_BUNDLE_DIR:${target}>.${debug_info_suffix}")
set(BUNDLE_ID Qt${target})
else()
set(debug_info_bundle_dir "$<TARGET_FILE:${target}>.${debug_info_suffix}")
set(BUNDLE_ID ${target})
endif()
set(debug_info_contents_dir "${debug_info_bundle_dir}/Contents")
set(debug_info_target_dir "${debug_info_contents_dir}/Resources/DWARF")
configure_file(
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/QtcSeparateDebugInfo.Info.plist.in"
"Info.dSYM.plist"
)
list(APPEND commands
COMMAND ${CMAKE_COMMAND} -E make_directory ${debug_info_target_dir}
COMMAND ${CMAKE_COMMAND} -E copy "Info.dSYM.plist" "${debug_info_contents_dir}/Info.plist"
)
set(debug_info_target "${debug_info_target_dir}/$<TARGET_FILE_BASE_NAME:${target}>")
install(DIRECTORY ${debug_info_bundle_dir}
DESTINATION ${installDestination}
COMPONENT DebugInfo
EXCLUDE_FROM_ALL
)
else()
set(debug_info_target "$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.${debug_info_suffix}")
install(FILES ${debug_info_target}
DESTINATION ${installDestination}
COMPONENT DebugInfo
EXCLUDE_FROM_ALL
)
endif()
list(APPEND commands
COMMAND ${copy_bin} ${debug_info_keep} $<TARGET_FILE:${target}>
${copy_bin_out_arg} ${debug_info_target}
COMMAND ${strip_bin} ${strip_args} $<TARGET_FILE:${target}>
)
if(NOT APPLE)
list(APPEND commands
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${debug_info_target} $<TARGET_FILE:${target}>
)
endif()
if(NOT CMAKE_HOST_WIN32)
list(APPEND commands
COMMAND chmod -x ${debug_info_target}
)
endif()
add_custom_command(
TARGET ${target}
POST_BUILD
${commands}
)
endfunction()
# Installs pdb files for given target into the specified install dir.
#
# MSVC generates 2 types of pdb files:
# - compile-time generated pdb files (compile flag /Zi + /Fd<pdb_name>)
# - link-time genereated pdb files (link flag /debug + /PDB:<pdb_name>)
#
# CMake allows changing the names of each of those pdb file types by setting
# the COMPILE_PDB_NAME_<CONFIG> and PDB_NAME_<CONFIG> properties. If they are
# left empty, CMake will compute the default names itself (or rather in certain cases
# leave it up to te compiler), without actually setting the property values.
#
# For installation purposes, CMake only provides a generator expression to the
# link time pdb file path, not the compile path one, which means we have to compute the
# path to the compile path pdb files ourselves.
# See https://gitlab.kitware.com/cmake/cmake/-/issues/18393 for details.
#
# For shared libraries and executables, we install the linker provided pdb file via the
# TARGET_PDB_FILE generator expression.
#
# For static libraries there is no linker invocation, so we need to install the compile
# time pdb file. We query the ARCHIVE_OUTPUT_DIRECTORY property of the target to get the
# path to the pdb file, and reconstruct the file name. We use a generator expression
# to append a possible debug suffix, in order to allow installation of all Release and
# Debug pdb files when using Ninja Multi-Config.
function(qtc_internal_install_pdb_files target install_dir_path)
if(MSVC)
get_target_property(target_type ${target} TYPE)
if(target_type STREQUAL "SHARED_LIBRARY"
OR target_type STREQUAL "EXECUTABLE"
OR target_type STREQUAL "MODULE_LIBRARY")
install(FILES "$<TARGET_PDB_FILE:${target}>"
DESTINATION "${install_dir_path}"
OPTIONAL
COMPONENT DebugInfo
EXCLUDE_FROM_ALL
)
elseif(target_type STREQUAL "STATIC_LIBRARY")
get_target_property(lib_dir "${target}" ARCHIVE_OUTPUT_DIRECTORY)
if(NOT lib_dir)
message(FATAL_ERROR
"Can't install pdb file for static library ${target}. "
"The ARCHIVE_OUTPUT_DIRECTORY path is not known.")
endif()
set(pdb_name "${INSTALL_CMAKE_NAMESPACE}${target}$<$<CONFIG:Debug>:d>.pdb")
set(compile_time_pdb_file_path "${lib_dir}/${pdb_name}")
install(FILES "${compile_time_pdb_file_path}"
DESTINATION "${install_dir_path}"
OPTIONAL
COMPONENT DebugInfo
EXCLUDE_FROM_ALL
)
endif()
endif()
endfunction()

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -180,6 +180,47 @@
You can also press \key {Alt+Enter} to open a context menu that contains You can also press \key {Alt+Enter} to open a context menu that contains
refactoring actions available in the current cursor position. refactoring actions available in the current cursor position.
\if defined(qtcreator)
\section1 Creating Functions
You can apply refactoring actions to implement member functions, insert
virtual functions of base classes, and greate getter and setter functions.
\section2 Implementing Member Functions
You can apply the \uicontrol {Create Implementations for Member Functions}
refactoring action to create implementations for all member functions in
one go. In the \uicontrol {Member Function Implementations} dialog, you can
specify whether the member functions are generated inline or outside the
class.
\image qtcreator-refactoring-member-function-implementations.png "Implement Member Functions dialog"
\section2 Inserting Virtual Functions
You can apply the \uicontrol {Insert Virtual Functions of Base Classes}
refactoring action to insert declarations and the corresponding definitions
inside or outside the class or in an implementation file (if it exists).
\image qtcreator-refactoring-virtual-function-dialog.png "Insert Virtual Functions dialog"
Select the functions to insert in the list of available functions. You can
filter the list and hide reimplemented functions from it.
You can add \e virtual or the \e override equivalent to the function
declaration.
\section2 Creating Getters and Setters
You can apply the \uicontrol {Create Getter and Setter Member Functions}
refactoring action to create either both getter and setter member functions
for member variables or only a getter or setter.
\image qtcreator-refactoring-getters-and-setters.png "Getters and Setters dialog"
\endif
\section1 Summary of Refactoring Actions
\if defined(qtcreator) \if defined(qtcreator)
If you use the \l{Parsing C++ Files with the Clang Code Model} If you use the \l{Parsing C++ Files with the Clang Code Model}
{Clang code model} to parse the C++ files, the {Clang code model} to parse the C++ files, the
@@ -722,17 +763,10 @@
\li Function call or class name \li Function call or class name
\row \row
\li Insert (Pure) Virtual Functions \li Insert Virtual Functions of Base Classes
\li Select an insertion mode: \li Inserts declarations and the corresponding definitions inside or
\list outside the class or in an implementation file (if it exists).
\li Insert only declarations. For more information, see \l{Inserting Virtual Functions}.
\li Insert declarations and the corresponding definitions inside the class.
\li Insert declarations and the corresponding definitions outside the class.
\li Insert declarations and the corresponding definitions in the implementation file
(only if an implementation file exists).
\endlist
\image qtcreator-refactoring-virtual-function-dialog.png
\li Class or base class name \li Class or base class name
\row \row
\li Optimize for-Loop \li Optimize for-Loop
@@ -824,9 +858,9 @@
\li Converts a Qt 4 QObject::connect() to Qt 5 style. \li Converts a Qt 4 QObject::connect() to Qt 5 style.
\li QObject::connect() (Qt 4 style) \li QObject::connect() (Qt 4 style)
\endtable \endtable
\endif
\section2 Refactoring QML Code \section2 Refactoring QML Code
\endif
You can apply the following types of refactoring actions to QML code: You can apply the following types of refactoring actions to QML code:

View File

@@ -25,6 +25,14 @@
** **
****************************************************************************/ ****************************************************************************/
/*!
\externalpage https://doc.qt.io/QtForMCUs/index.html
\title Qt for MCUs
*/
/*!
\externalpage https://doc.qt.io/QtForMCUs/qtul-qmltypes.html
\title Qt for MCUs - All QML Types
*/
/*! /*!
\externalpage https://doc.qt.io/QtForMCUs/qtul-supported-platforms.html \externalpage https://doc.qt.io/QtForMCUs/qtul-supported-platforms.html
\title Qt for MCUs - Supported Target Platforms \title Qt for MCUs - Supported Target Platforms

View File

@@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
//! [mcu qtquick components]
\section1 Creating UIs for MCUs
\l{Qt for MCUs} enables you to use subsets of QML and Qt Quick Controls
types to create UIs for devices that are powered by microcontroller units
(MCU). The subset of supported types depends on the Qt for MCUs version
that you use for development. In this manual, we indicate which components
are supported at the time of writing, but you should always check the
\l{Qt for MCUs - All QML Types}{listing of supported QML types} for the
latest state.
To develop for MCUs, \l{Using Project Wizards}{create an MCU project}.
Only a subset of properties is supported for the supported types. The
properties that are not available on MCUs are marked in the
\uicontrol Properties view by enclosing them in square brackets.
//! [mcu qtquick components]
*/

View File

@@ -99,6 +99,7 @@
\li \l{Editing 2D Content} \li \l{Editing 2D Content}
\li \l{Shapes} \li \l{Shapes}
\li \l{Images} \li \l{Images}
\li \l{User Interaction Methods}
\li \l{Lists and Other Data Models} \li \l{Lists and Other Data Models}
\li \l{Creating Buttons} \li \l{Creating Buttons}
\li \l{Creating Scalable Buttons and Borders} \li \l{Creating Scalable Buttons and Borders}

View File

@@ -0,0 +1,880 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\page quick-controls.html
\previouspage quick-images.html
\nextpage quick-data-models.html
\title User Interaction Methods
You can use a set of basic QML types to add interaction methods to UIs,
such as performing actions by using a pointing device or the keyboard,
or flicking the visible area of the screen horizontally or vertically.
Further, you can use \l{Qt Quick Controls} types to inform users about
the progress of the application or to gather input from users.
\image qtquick-designer-qtquickcontrols-types.png "Qt Quick Controls 2 types in Library"
The following types of controls are available for user interaction:
\list
\li \l {Button Controls}
\li \l {Indicators}
\li \l {Selectors}
\li \l {Tab Bar}
\li \l {Tool Bar}
\li \l {Summary of User Interaction Methods}
\endlist
You can specify values for the properties of components in the
\uicontrol Properties view. Some properties are common to all components,
whereas some are common to particular types of controls. Some properties
are only available for a particular component. The following sections
describe the basic interaction methods, the controls, and their properties.
\section1 Basic Interaction Methods
Users can interact with applications by using pointing devices or the
keyboard. If the content does not fit the visible area of the screen,
it can be flicked horizontally or vertically.
\section2 Mouse Area
QML uses signals and handlers to deliver mouse interactions. Specifically,
Qt Quick provides a \uicontrol {Mouse Area} type that developers can use to
define JavaScript callbacks (also called signal handlers), which accept
mouse events within a defined area.
A mouse area receives events within a defined area. One quick way to define
this area is to \l{Setting Anchors and Margins}{anchor} the mouse area to
its parent's area. If the parent is a \l Rectangle (or any component that
is derived from an \l Item), the mouse area will fill the area defined by
the parent's dimensions. Alternatively, you can define an area smaller or
larger than the parent. Several controls,such as buttons, contain a mouse
area.
A mouse area emits \l{Connecting Objects to Signals}{signals} in response
to different mouse events:
\list
\li \c canceled()
\li \c clicked()
\li \c doubleClicked()
\li \c entered()
\li \c exited()
\li \c positionChanged()
\li \c pressAndHold()
\li \c pressed()
\li \c released()
\endlist
\if defined(qtcreator)
A more modern way of handling events from all pointing devices, including
mouse and touchscreen, is via \l {Qt Quick Input Handlers}.
\endif
\section2 Focus Scope
When a key is pressed or released, a key event is generated and delivered
to the focused component. If no component has active focus, the key event
is ignored. If the component with active focus accepts the key event,
propagation stops. Otherwise the event is sent to the component's parent
until the event is accepted, or the root item is reached and the event is
ignored.
A component has focus when the \uicontrol Focus property in the
\uicontrol Advanced tab is set to \c true. However, for reusable
or imported components, this is not sufficient, and you should use
a \uicontrol {Focus Scope} type.
Within each focus scope, one object may have focus enabled. If more
than one component have it enabled, the last component to enable it
will have the focus and the others are unset, similarly to when there
are no focus scopes.
When a focus scope receives active focus, the contained type with
focus set (if any) also gets the active focus. If this type is
also a focus scope, both the focus scope and the sub-focused item
will have active focus.
The \uicontrol {Focus Scope} type is not a visual type, and therefore the
properties of its children need to be exposed to the parent item of the
focus scope. \l{Using Layouts}{Layouts} and \l{Using Positioners}
{positioners} will use these visual and styling properties to create the
layout.
For more information, see \l {Keyboard Focus in Qt Quick}.
\section2 Flickable
\uicontrol Flickable places its children on a surface that can be dragged
and flicked, causing the view onto the child items to scroll. This
behavior forms the basis of components that are designed to show large
numbers of child items, such as \uicontrol {List View} and
\uicontrol {Grid View}. For more information, see \l{List and Grid Views}.
In traditional user interfaces, views can be scrolled using standard
controls, such as scroll bars and arrow buttons. In some situations, it
is also possible to drag the view directly by pressing and holding a
mouse button while moving the cursor. In touch-based user interfaces,
this dragging action is often complemented with a flicking action, where
scrolling continues after the user has stopped touching the view.
The contents of a flickable component are not automatically clipped. If
the component is not used as a full-screen item, consider selecting the
\uicontrol Clip check box in the \uicontrol Visibility section.
\image qtquick-designer-flickable-properties.png "Flickable properties"
Users can interact with a flickable component if the \uicontrol Interactive
property is set to \c true. Set it to \c false to temporarily disable
flicking. This enables special interaction with the components children.
For example, you might want to freeze a flickable map while scrolling
through a pop-up that is a child of the Flickable.
The \uicontrol {Flick direction} field determines whether the view can be
flicked horizontally or vertically. Select \uicontrol AutoFlickDirection
to enable flicking vertically if the content height is not equal to height
of the flickable and horizontally if the content width is not equal
to the width of the flickable. Select \uicontrol AutoFlickIfNeeded if
the content height or width is greater than that of the flickable.
Specify the maximum velocity for flicking the view in pixels per second in
the \uicontrol {Max. velocity} field. Specify the rate at which a flick
will decelerate in the \uicontrol Decelerate field.
The \uicontrol {Bounds movement} property determines whether the flickable
will give a feeling that the edges of the view are soft, rather than a hard
physical boundary. Select \uicontrol StopAtBounds for custom edge effects
where the contents do not follow drags or flicks beyond the bounds of the
flickable. Select \uicontrol FollowBoundsBehavior to have the contents
follow drags or flicks beyond the bounds of the flickable depending on the
value of the \uicontrol Behavior field.
In the \uicontrol {Press delay} field, specify the time in milliseconds
to delay delivering a press to children of a flickable. This can be useful
when reacting to a press before a flicking action has undesirable effects.
If the flickable is dragged or flicked before the delay times out,
the press event will not be delivered. If the button is released
within the timeout, both the press and release will be delivered.
\note For nested flickables with press delay set, the press delay of
outer flickables is overridden by the innermost flickable. If the drag
exceeds the platform drag threshold, the press event will be delivered
regardless of this property.
The \uicontrol {Pixel aligned} property sets the alignment of
\uicontrol {Content X} and \uicontrol {Content Y} to pixels (\c true)
or subpixels (\c false). Enable it to optimize for still content or
moving content with high constrast edges, such as one-pixel-wide lines,
text, or vector graphics. Disable this property when optimizing for
animation quality.
If \uicontrol {Synchronous drag} is set to \c true, then when the mouse or
touchpoint moves far enough to begin dragging the content, the content will
jump, so that the content pixel which was under the cursor or touchpoint
when pressed remains under that point. The default is \c false, which
provides a smoother experience (no jump) at the cost of losing some of the
drag distance at the beginning.
The \uicontrol {Content size} field specifies the dimensions of the
surface controlled by a flickable. Typically, set the values of the
\uicontrol W and \uicontrol H fields to the combined size of the items
placed in the flickable. You can set additional margins around the
content in the \uicontrol Margins field.
The \uicontrol Origin field specifies the origin of the content. It
refers to the top-left position of the content regardless of layout
direction. Usually, the \uicontrol X and \uicontrol Y are set to 0.
However, a \l{ListView}{List View} and \l {GridView}{Grid View}
may have an arbitrary origin due to delegate size variation, or item
insertion or removal outside the visible region.
\section1 General Control Properties
You can set control properties in the \uicontrol Properties view.
\image qtquick-designer-control-properties.png "Control section in Properties"
The \uicontrol Enabled check box indicates whether the control is enabled.
The value of the \uicontrol {Focus policy} field determines whether the
control accepts focus by tabbing, clicking, and using the mouse wheel.
Select the \uicontrol Hover and \uicontrol Wheel check boxes to enable the
control to accept mouse events. The hover value is propagated to all child
components, unless it has been explicitly set for them.
\note Take care when enabling wheel events for controls within scrollable
items, such as \l Flickable, because the control will consume the
events, and therefore interrupt scrolling of the flickable.
\uicontrol Spacing is useful for controls that have multiple or repetitive
building blocks. For example, some \l{Styling Controls}{styles} use spacing
to determine the distance between the text and indicator of a
\l {Check Box}. Spacing is not enforced by the controls, so each style may
interpret it differently, and some may ignore it altogether.
\section1 Button Controls
Qt Quick Controls offer a selection of button-like controls for specific
use cases. The following sections contain guidelines for choosing the button
most suitable for a use case and discuss the values you can set for button
properties in the \uicontrol Properties view.
\image qtquick-designer-button-types.png "Button controls in Form Editor"
Recommendations for buttons that contain text:
\list
\li Keep labels short and concise.
\li Use the default font unless you have UI guidelines specifying
otherwise.
\li If the text is localized, consider how a longer text affects the
layout.
\endlist
For more information about setting text properties, see \l Fonts and
\l Padding.
The properties that are shared by all button controls are described in:
\list
\li \l {Displaying Text and Icons}
\li \l {Checking Buttons}
\li \l {Button Signals}
\endlist
\section2 Button
\image qtquickcontrols2-button.gif "Button"
\uicontrol Button can be pushed or clicked by users. Typically, buttons
are used to perform an action or to answer a question. For example, \e OK,
\e Apply, \e Cancel, \e Close, \e Yes, \e No, and \e Help.
The button text should be a verb describing the action, or a noun matching
the title of the popup that will be opened.
Don't use a button to set state, because a \l Switch is more suitable for
that purpose.
Select the \uicontrol Highlighted check box to draw the users' attention
towards a button. Highlighting a button has no effect on keyboard
interaction.
\image qtquickcontrols2-button-highlighted.gif "Highlighted button"
A flat button typically does not draw a background unless it is pressed or
checked. To create a flat button, select the \uicontrol Flat check box.
\image qtquickcontrols2-button-flat.gif "Flat button"
\section2 Delay Button
\image qtquickcontrols2-delaybutton.gif "Delay button"
\uicontrol {Delay Button} incorporates a delay before triggering an action.
This delay prevents accidental presses.
Use delay buttons in touch user interfaces and for actions that must be
triggered with care.
You can set the delay in milliseconds in the \uicontrol Delay field.
\section2 Check Box
\image qtquickcontrols2-checkbox.gif "Check box"
\uicontrol {Check Box} presents an option button that can be toggled on
(checked) or off (unchecked). Check boxes are typically used to select
one or more options from a set of options. For larger sets of options,
such as those in a list, consider using \uicontrol {Check Delegate} instead.
\image qtquickcontrols2-checkdelegate.gif "Check delegate"
Use check boxes to build multi-selection option lists, where any number
of options can be selected, including none, but the options are not
mutually exclusive.
Use a single check box for a yes/no choice, such as when users have to
accept the terms of service agreement in a dialog. For a single yes/no
choice, you can also use a \l Switch. If users are choosing between options,
use a check box. If they are choosing between actions to be taken, a switch
is recommended.
The value of the \uicontrol Checked property determines the state of the
check box. However, in addition to the checked and unchecked states, a
check box has a third state: \e {partially checked}.
Select the \uicontrol Tri-state check box to enable the check box to cycle
between checked, partially checked, and unchecked states when users
toggle it by using touch, mouse, or keyboard.
\image qtquickcontrols2-checkbox-tristate.gif "Tri-state check box"
When options can be grouped, you can use a partially checked check box to
represent the whole group. Select \uicontrol PartiallyChecked in the
\uicontrol {Check state} field to indicate that users selected some
sub-items in the group, but not all of them.
The checkable options are often listed vertically.
The check box label should be a statement that the check mark makes true,
and that the absence of a check mark makes false. Therefore, the check box
label should not contain a negative statement.
\section2 Radio Button
\image qtquickcontrols2-radiobutton.gif "Radio button"
\uicontrol {Radio Button} is an option button that can be toggled on
(checked) or off (unchecked). Radio buttons are typically used to select
one option from a set of options. Selecting an option automatically clears
the previous selection.
If there are only two mutually exclusive options, combine them into a single
\l {Check Box} or a \l Switch.
\uicontrol {Radio Delegate} is similar to radio button, except that it is
typically used in views.
\image qtquickcontrols2-radiodelegate.gif "Radio delegate"
Recommendations for radio buttons:
\list
\li Limit the label text to one line.
\li Ensure that a sensible default option is checked.
\li List radio button options vertically.
\li Keep the list short.
\li In order to avoid confusion, do not put two groups of radio buttons
next to each other.
\endlist
\section2 Switch
\image qtquickcontrols2-switch.gif "Switch"
\uicontrol Switch is an option button that can be dragged or toggled on
(checked) or off (unchecked). Switches are typically used to select between
two states: \e on or \e off. For larger sets of options, such as those in a
list, consider using \uicontrol {Switch Delegate} instead.
\image qtquickcontrols2-switchdelegate.gif "Switch delegate"
Use a switch for binary operations that take effect immediately after the
switch is toggled. For example, use a switch to turn WiFi on or off.
\section2 Round Button
\uicontrol {Round Button} is a clickable control that starts an action,
or opens or closes a popup. A round button with a square image icon or
one-letter font icon is circular. A circular round button takes less space
than a normal button, and can also be used as a floating action button.
A round button has the same properties as a \l Button.
\section2 Displaying Text and Icons
A button can contain text, an icon, or both. Specify the button text in
the \uicontrol Text field. The value of the \uicontrol Display field
determines whether only text or an icon is displayed, or when both are
visible, whether the text is placed beside the icon or under it.
\image qtquick-designer-abstract-button-properties.png "General button properties"
\section2 Checking Buttons
A \e checkable button toggles between checked (on) and unchecked (off) when
users click on it or press the space bar while the button has active
focus. Select the \uicontrol Checkable check box to make a button checkable.
To make the button checked, select the \uicontrol Checked check box.
Buttons that belong to the same parent item can be mutually exclusive.
Users can click a button to check it, and the previous selection is
cleared. Users cannot uncheck the currently checked button by clicking
it. Instead, they must click another button in the group to set the new
checked button for that group.
Radio buttons and tab buttons are mutually exclusive by default. To make
other types of buttons mutually exclusive, select the \uicontrol Exclusive
check box.
If the buttons don't belong to the same parent, checking and unchecking
buttons does not affect the other buttons in the group.
\section2 Button Signals
A button emits the \c clicked() signal when it is activated by users.
\l{Connecting Objects to Signals}{Connect to this signal} to perform
the button's action. Buttons provide the following additional signals:
\c canceled(), \c doubleClicked(), \c pressed(), \c released(), and
\c pressAndHold() for long presses.
Select the \uicontrol Auto-repeat check box to repeat the \c pressed(),
\c released(), and \c clicked() signals while the button is pressed and
held down. The \c pressAndHold() signal will not be emitted.
\section1 Indicators
Qt Quick Controls offer a selection of indicator-like controls, such as
busy indicator, page indicator, and progress bar, for specific use cases.
The following sections contain guidelines for choosing the indicator most
suitable for a use case.
\image qtquick-designer-indicator-types.png "Indicator types"
\section2 Busy Indicator
\image qtquickcontrols2-busyindicator.gif "Busy indicator"
\uicontrol {Busy Indicator} indicates that an operation is in progress, and
that the UI has to wait for the operation to complete.
A busy indicator is similar to an indeterminate \l {Progress Bar}. Both can
be used to indicate background activity. The main difference is visual, and
that a progress bar can also present a concrete amount of progress (when it
can be determined). Due to the visual difference, busy indicators and
indeterminate progress bars fit in different places in UIs.
Select the \uicontrol Running check box to make the busy indicator visible.
Typical places for a busy indicator are:
\list
\li In the corner of a \uicontrol {Tool Bar}
\li As an overlay on top of a \uicontrol Page
\li On the side of an \uicontrol {Item Delegate}
\endlist
\section2 Page Indicator
\uicontrol {Page Indicator} is used to indicate the currently active page
in a container of multiple pages. Specify the number of pages in the
\uicontrol Count field. Select the current page in the \uicontrol Current
field.
\section2 Progress Bar
\image qtquickcontrols2-progressbar.gif "Progress bar"
\uicontrol {Progress Bar} indicates the progress of an operation. You
can specify the initial value in the \uicontrol Value field, but it
should be updated regularly. Specify the range in the \uicontrol From
and \uicontrol To fields, which can both contain any value.
\image qtquick-designer-progressbar-properties.png "Progress Bar properties"
Select the \uicontrol Indeterminate check box when unable to determine the
size of the item being downloaded, or if the download progress might get
interrupted due to a network failure.
\image qtquickcontrols2-progressbar-indeterminate.gif
The indeterminate mode is similar to a \l {Busy Indicator} in that both can
be used to indicate background activity. Due to their visual differences,
indeterminate progress bars and busy indicators fit in different places in
UIs.
Typical places for an indeterminate progress bar are:
\list
\li At the bottom of a \uicontrol {Tool Bar}
\li Inline within the content of a \uicontrol Page
\li In an \uicontrol {Item Delegate} to show the progress
of a particular item
\endlist
\section1 Selectors
Qt Quick Controls offers a set of selector-like controls, such as sliders,
dial, sping box, combo box, and tumbler, for specific use cases. The
following sections contain guidelines for choosing the selector most
suitable for a use case.
\image qtquick-designer-selector-types.png "Selector types"
\section2 Slider and Dial
\image qtquickcontrols2-slider.gif "Slider"
\uicontrol Slider is used to select a value by sliding a handle along a
track, whereas \uicontrol {Range Slider} is used to select a range
specified by two values, by sliding each handle along a track.
\image qtquickcontrols2-rangeslider.gif "Range slider"
\uicontrol Dial is similar to a traditional dial knob that is found on
devices such as stereos or industrial equipment. It allows users to
specify a value within a range.
\image qtquickcontrols2-dial-no-wrap.gif "Dial"
In the \uicontrol From and \uicontrol To fields, set the range of the
slider or dial. Set the value of the slide handle or dial in the
\uicontrol Value field. For a range slider, set the initial positions
of the first and second handles in the \uicontrol {First value} and
\uicontrol {Second value} fields.
\image qtquick-designer-range-slider-properties.png "Range slider properties"
In the \uicontrol {Snap mode} field, set how the slider handles or dial
behave with regards to the value of the \uicontrol {Step size} field. By
default, they do not snap to step size, but you can set them to snap to it
either while being dragged or after being released.
Select the \uicontrol Live check box to provide live updates of the value
properties.
You can set slider orientation to horizontal or vertical in the
\uicontrol Orientation field.
A dial supports circular, horizontal, and vertical input modes. For
applications where fast input is important, the circular input mode is
useful, as clicking the dial will move it directly to that position.
For applications where precise input is important, the horizontal and
vertical input modes are recommended, as these allow small adjustments to
be made relative to where the dial is clicked. These modes are also better
for dials where large jumps in values could be unsafe, such as a dial that
controls audio volume. Set the input mode in the \uicontrol {Input mode}
field.
\image qtquick-designer-dial-properties.png "Dial properties"
\section2 Spin Box
\image qtquickcontrols2-spinbox.png "Spin Box"
\uicontrol {Spin box} enables users to choose an integer value by clicking
the up or down indicator buttons, or by pressing up or down on the keyboard.
Select the \uicontrol Editable check box to enable users to enter a text
value in the input field.
The other spin box properties are similar to those of a dial.
\section2 Combo Box
\image qtquickcontrols2-combobox.gif "Combo box"
\uicontrol {Combo Box} is a combined button and popup list. It provides a
means of presenting a list of options to users in a way that takes up the
minimum amount of screen space.
A combo box is used to select a value from a static multiple-line drop-down
list. Users cannot add new values, and only one option can be selected.
Combo box values are provided by a \l{Lists and Other Data Models}
{data model}. The data model is usually a JavaScript array, a \l ListModel,
or an integer, but other types of data models are also supported.
Select the \uicontrol Editable check box to auto-complete combo box text
based on what is available in the model.
\image qtquick-designer-combobox-properties.png "Combo box properties"
When using models that have multiple named roles, specify the role of
the \uicontrol {Display text} property in the \uicontrol {Text role} field.
To use a role of the model item that corresponds to the text role, enter
\c valueRole in the field.
The \uicontrol Current property is the index of the current item in the
combo box. The default value is \c -1 when the combo box is empty, and
\c 0 otherwise.
A flat combo box does not draw a background unless it is
interacted with, which makes it blend into the UI. Use flat combo
boxes on a tool bar, for example, to match the flat look of tool
buttons. To create a flat combo box, select the \uicontrol Flat
check box.
Recommendations for combo boxes:
\list
\li If the number of values very large, consider applying a filter.
\li If the number of values is small, consider using \l {Radio Button},
so that users can see all options at the same time.
\li Set a default value, which should be the value that you expect
to be chosen most often.
\endlist
\section2 Tumbler
\image qtquickcontrols2-tumbler-wrap.gif
\uicontrol Tumbler allows users to select an option from a spinnable
\e wheel of items. It is useful when there are too many options to use, for
example, a \l {Radio Button}, and too few options to require the use of an
editable \l {Spin Box}. It is convenient in that it requires no keyboard
usage and wraps around at each end when there are a large number of items.
Specify the number of visible options in the \uicontrol {Visible count}
field. Select the index of the current option in the \uicontrol Current
field.
\image qtquick-designer-tumbler-properties.png "Tumbler properties"
To enable wrapping, select the \uicontrol Wrap check box.
\section1 Tab Bar
\image qtquickcontrols2-tabbar.gif "Tab Bar"
\uicontrol {Tab Bar} provides a tab-based navigation model, where users
can switch between different views or subtasks. A tab bar is commonly
used as a header or footer of an \l ApplicationWindow. Select the toolbar
position in the \uicontrol Position field.
Typically, a tab bar contains a static set of \uicontrol {Tab Button}
controls that are defined as its children. The \uicontrol Current
field shows the index of the current tab button. The default value is
\c -1 when the tab bar is empty, and \c 0 otherwise.
\image qtquick-designer-tabbar-properties.png "Tab Bar properties"
You can specify content size in the \uicontrol {Content width} and
\uicontrol {Content height} fields.
If the total width of the buttons exceeds the available width of the tab
bar, it automatically becomes \l{Flickable}{flickable}.
\image qtquickcontrols2-tabbar-flickable.png
\section1 Tool Bar
\image qtquickcontrols2-toolbar.png
\uicontrol {Tool Bar} contains application-wide and context-sensitive
actions and controls, such as navigation buttons and search fields. A
tool bar is commonly used as a header or footer of an \l ApplicationWindow.
Select the toolbar position in the \uicontrol Position field.
\image qtquick-designer-toolbar-properties.png "Tool Bar properties"
\uicontrol {Tool Button} is nearly identical to \l Button, but it has a
graphical appearance that makes it more suitable for insertion into a
tool bar.
A tool bar does not provide a layout of its own, but requires you to
position its contents, for instance by creating a \l RowLayout. If the
tool bar contains only one item, it will resize to fit the implicit item
size. This makes a tool bar particularly suitable for use together with
\l{Using Layouts}{layouts}. However, you can specify content size in the
\uicontrol {Content width} and \uicontrol {Content height} fields.
\uicontrol {Tool Separator} is used to visually distinguish between
groups of items on a tool bar by separating them with a line. It can
be used in horizontal or vertical toolbars by setting the value of
the \uicontrol Orientation field.
\section1 Summary of User Interaction Methods
The following table lists the QML types that you can use to add interaction
methods to UIs. The \e Location column contains the tab name where you can
find the type in \uicontrol Library. The \e MCU column indicates which types
are supported on MCUs.
\table
\header
\li Icon
\li Name
\li Location
\li MCU
\li Purpose
\row
\li \inlineimage icons/busyindicator-icon16.png
\li \l [QtQuickControls]{BusyIndicator}{Busy Indicator}
\li Qt Quick - Controls 2
\li
\li Indicates activity while content is being loaded.
\row
\li \inlineimage icons/button-icon16.png
\li \l [QtQuickControls]{Button}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li A push button that you can associate with an action.
\row
\li \inlineimage icons/checkbox-icon16.png
\li \l [QtQuickControls]{CheckBox}{Check Box}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li An option button that can be toggled on (checked) or off
(unchecked).
\row
\li \inlineimage icons/checkbox-icon16.png
\li \l [QtQuickControls]{CheckDelegate}{Check Delegate}
\li Qt Quick - Controls 2
\li
\li An item delegate that can be toggled on (checked) or off
(unchecked).
\row
\li \inlineimage icons/combobox-icon16.png
\li \l [QtQuickControls]{ComboBox}{Combo Box}
\li Qt Quick - Controls 2
\li
\li A combined button and popup list that is populated by using a data
model.
\row
\li \inlineimage icons/delaybutton-icon16.png
\li \l [QtQuickControls]{DelayButton}{Delay Button}
\li Qt Quick - Controls 2
\li
\li An option button that is triggered when held down long enough.
\row
\li \inlineimage icons/dial-icon16.png
\li \l [QtQuickControls]{Dial}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li A circular dial that is rotated to set a value.
\row
\li \inlineimage flickable-icon16.png
\li \l [QML]{Flickable}
\li Qt Quick - Basic
\li \inlineimage ok
\li Items can be flicked horizontally or vertically.
\row
\li \inlineimage focusscope-icon16.png
\li \l{FocusScope}{Focus Scope}
\li Qt Quick - Basic
\li
\li Assists in keyboard focus handling when building reusable QML
components.
\row
\li \inlineimage mouse-area-icon16.png
\li \l [QtQuick]{MouseArea}{Mouse Area}
\li Qt Quick - Basic
\li \inlineimage ok
\li Enables simple mouse handling.
\row
\li \inlineimage icons/pageindicator-icon16.png
\li \l [QtQuickControls]{PageIndicator}{Page Indicator}
\li Qt Quick - Controls 2
\li
\li Indicates the indicate the currently active page in a container of
multiple pages.
\row
\li \inlineimage icons/progressbar-icon16.png
\li \l [QtQuickControls]{ProgressBar}{Progress Bar}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li Indicates the progress of an operation.
\row
\li \inlineimage icons/radiobutton-icon16.png
\li \l [QtQuickControls]{RadioButton}{Radio Button}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li An option button that can be switched on (checked) or off
(unchecked).
\row
\li \inlineimage icons/radiobutton-icon16.png
\li \l [QtQuickControls]{RadioDelegate}{Radio Delegate}
\li Qt Quick - Controls 2
\li
\li An item delegate that can be toggled on (checked) or off
(unchecked).
\row
\li \inlineimage icons/rangeslider-icon16.png
\li \l [QtQuickControls]{RangeSlider}{Range Slider}
\li Qt Quick - Controls 2
\li
\li Enables users to select a range of values by sliding two handles
along a track.
\row
\li \inlineimage icons/roundbutton-icon16.png
\li \l [QtQuickControls]{RoundButton}{Round Button}
\li Qt Quick - Controls 2
\li
\li A push button with rounded corners that you can associate with an
action.
\row
\li \inlineimage icons/slider-icon16.png
\li \l [QtQuickControls]{Slider}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li Enables users to select a value by sliding a handle along a track.
\row
\li \inlineimage icons/spinbox-icon16.png
\li \l [QtQuickControls]{SpinBox}{Spin Box}
\li Qt Quick - Controls 2
\li
\li Enables users to specify 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.
\row
\li \inlineimage icons/switch-icon16.png
\li \l [QtQuickControls]{Switch}
\li Qt Quick - Controls 2
\li \inlineimage ok
\li An option button that can be toggled on or off.
\row
\li \inlineimage icons/switch-icon16.png
\li \l [QtQuickControls]{SwitchDelegate}{Switch Delegate}
\li Qt Quick - Controls 2
\li
\li An item delegate with a switch indicator that can be toggled on or
off.
\row
\li \inlineimage icons/toolbar-icon16.png
\li \l [QtQuickControls] {TabBar}{Tab Bar}
\li Qt Quick - Controls 2
\li
\li Enables users to switch between different views or subtasks.
\row
\li \inlineimage icons/toolbutton-icon16.png
\li \l [QtQuickControls]{TabButton}{Tab Button}
\li Qt Quick - Controls 2
\li
\li A button that is functionally similar to \uicontrol Button, but
provides a look that is more suitable for a \uicontrol {Tab Bar}.
\row
\li \inlineimage icons/toolbar-icon16.png
\li \l [QtQuickControls]{ToolBar}{Tool Bar}
\li Qt Quick - Controls 2
\li
\li A container of application-wide and context sensitive actions and
controls, such as navigation buttons and search fields.
\row
\li \inlineimage icons/toolbutton-icon16.png
\li \l [QtQuickControls]{ToolButton}{Tool Button}
\li Qt Quick - Controls 2
\li
\li A button that is functionally similar to \uicontrol Button, but
provides a look that is more suitable for a \uicontrol {Tool Bar}.
\row
\li \inlineimage icons/toolseparator-icon16.png
\li \l [QtQuickControls]{ToolSeparator}{Tool Separator}
\li Qt Quick - Controls 2
\li
\li Separates a group of items from adjacent items on a
\uicontrol {Tool Bar}.
\row
\li \inlineimage icons/tumbler-icon16.png
\li \l [QtQuickControls]{Tumbler}
\li Qt Quick - Controls 2
\li
\li A spinnable wheel of items that can be selected.
\endtable
*/

View File

@@ -25,7 +25,7 @@
/*! /*!
\page quick-data-models.html \page quick-data-models.html
\previouspage quick-images.html \previouspage quick-controls.html
\nextpage quick-buttons.html \nextpage quick-buttons.html
\title Lists and Other Data Models \title Lists and Other Data Models

View File

@@ -26,7 +26,7 @@
/*! /*!
\page quick-images.html \page quick-images.html
\previouspage quick-text.html \previouspage quick-text.html
\nextpage quick-data-models.html \nextpage quick-controls.html
\title Images \title Images

View File

@@ -222,33 +222,39 @@
The following table lists the QML types that you can use to draw shapes. The following table lists the QML types that you can use to draw shapes.
The \e Location column contains the tab name where you can find the type The \e Location column contains the tab name where you can find the type
in \uicontrol Library. in \uicontrol Library. The \e MCU column indicates which types are supported
on MCUs.
\table \table
\header \header
\li Icon \li Icon
\li Name \li Name
\li Location \li Location
\li MCU
\li Purpose \li Purpose
\row \row
\li \inlineimage icons/item-arc-16px.png \li \inlineimage icons/item-arc-16px.png
\li \l Arc \li \l Arc
\li Studio Components \li Studio Components
\li
\li An arc that begins and ends at given positions. \li An arc that begins and ends at given positions.
\row \row
\li \inlineimage icons/custom-border-16px.png \li \inlineimage icons/custom-border-16px.png
\li \l Border \li \l Border
\li Studio Components \li Studio Components
\li
\li A line with four segments that you can show and shape individually. \li A line with four segments that you can show and shape individually.
\row \row
\li \inlineimage icons/item-pie-16px.png \li \inlineimage icons/item-pie-16px.png
\li \l Pie \li \l Pie
\li Studio Components \li Studio Components
\li
\li A pie slice or a pie with a slice missing from it. \li A pie slice or a pie with a slice missing from it.
\row \row
\li \inlineimage rect-icon16.png \li \inlineimage rect-icon16.png
\li \l Rectangle \li \l Rectangle
\li Qt Quick - Basic \li Qt Quick - Basic
\li \inlineimage ok
\li A rectangle that is painted with a solid fill color or linear \li A rectangle that is painted with a solid fill color or linear
gradient and an optional border. You can use the radius property gradient and an optional border. You can use the radius property
to draw circles. to draw circles.
@@ -256,6 +262,7 @@
\li \inlineimage icons/custom-rectangle-16px.png \li \inlineimage icons/custom-rectangle-16px.png
\li \l{Studio Rectangle}{Rectangle} \li \l{Studio Rectangle}{Rectangle}
\li Studio Components \li Studio Components
\li
\li An extended rectangle that is painted with a solid fill color or \li An extended rectangle that is painted with a solid fill color or
linear, conical, or radial gradients, and corners that you can linear, conical, or radial gradients, and corners that you can
shape independently of each other. shape independently of each other.
@@ -263,6 +270,7 @@
\li \inlineimage icons/item-triangle-16px.png \li \inlineimage icons/item-triangle-16px.png
\li \l Triangle \li \l Triangle
\li Studio Components \li Studio Components
\li
\li A triangle with different dimensions and shapes that is \li A triangle with different dimensions and shapes that is
enclosed in an invisible rectangle. enclosed in an invisible rectangle.
\endtable \endtable

View File

@@ -141,7 +141,7 @@
change the appearance of the button depending on other mouse events, change the appearance of the button depending on other mouse events,
such as hovered. such as hovered.
Add a \l [QML]{MouseArea}{Mouse Area} type that covers the whole area and Add a \l {Mouse Area} type that covers the whole area and
reacts to mouse events. reacts to mouse events.
You can use states also to change the button text color and font size. For You can use states also to change the button text color and font size. For

View File

@@ -120,8 +120,7 @@
\list \list
\li \l Shapes \li \l Shapes
\li \l Images \li \l Images
\li UI controls \li \l {User Interaction Methods}
\li Screens
\li \l {Lists and Other Data Models} \li \l {Lists and Other Data Models}
\endlist \endlist
@@ -150,91 +149,34 @@
\li \l [QtQuick]{TextInput}{Text Input} adds a single line of editable \li \l [QtQuick]{TextInput}{Text Input} adds a single line of editable
plain text that can be validated. plain text that can be validated.
\endlist \endlist
\section1 User Interaction Methods
You can use the following QML types to add basic interaction methods to
UIs:
\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.
\li \l [QtQuick]{MouseArea}{Mouse Area} enables simple mouse handling.
\endlist
Since Qt 5.7, you can also use the following \l{Qt Quick Controls} types
to inform users about the progress of the application or to gather input
from the user:
\list
\li \l [QtQuickControls]{BusyIndicator}{Busy Indicator} indicates
activity while content is being loaded.
\li \l [QtQuickControls]{Button} provides a push button that you can
associate with an action.
\li \l [QtQuickControls]{CheckBox}{Check Box} provides an option button
that can be toggled on (checked) or off (unchecked).
\li \l [QtQuickControls]{CheckDelegate}{Check Delegate} presents an
item delegate that can be toggled on (checked) or off (unchecked).
\li \l [QtQuickControls]{ComboBox}{Combo Box} is a combined button and
popup list that is populated by using a data model.
\li \l [QtQuickControls]{DelayButton}{Delay Button} provides an option
button that is triggered when held down long enough.
\li \l [QtQuickControls]{Dial} is a circular dial that is rotated to
set a value.
\li \l [QtQuickControls]{ProgressBar}{Progress Bar} indicates the
progress of an operation.
\li \l [QtQuickControls]{RadioButton}{Radio Button} provides an option
button that can be switched on (checked) or off (unchecked).
\li \l [QtQuickControls]{RadioDelegate}{Radio Delegate} presents an
item delegate that can be toggled on (checked) or off (unchecked).
\li \l [QtQuickControls]{RangeSlider}{Range Slider} enables users to
select a range of values by sliding two handles along a track.
\li \l [QtQuickControls]{RoundButton}{Round Button} provides a push
button with rounded corners that you can associate with an action.
\li \l [QtQuickControls]{Slider} selects a value by sliding a handle
along a track.
\li \l [QtQuickControls]{SpinBox}{Spin Box} enables the user to specify
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.
\li \l [QtQuickControls]{Switch} is an option button that can be
toggled on or off.
\li \l [QtQuickControls]{SwitchDelegate}{Switch Delegate} presents an
item delegate with a switch indicator that can be toggled on or off.
\li \l [QtQuickControls] {TabBar}{Tab Bar} enables users to switch
between different views or subtasks.
\li \l [QtQuickControls]{TabButton}{Tab Button} is a button
that is functionally similar to \uicontrol Button, but provides a
look that is more suitable for a \uicontrol {Tab Bar}.
\li \l [QtQuickControls]{TextArea}{Text Area} displays multiple lines
of editable formatted text.
\li \l [QtQuickControls]{TextField}{Text Field} displays a single line
of editable plain text.
\li \l [QtQuickControls]{ToolBar}{Tool Bar} is a container of
application-wide and context sensitive actions and controls, such as
navigation buttons and search fields.
\li \l [QtQuickControls]{ToolButton}{Tool Button} is a button
that is functionally similar to \uicontrol Button, but provides a
look that is more suitable for a \uicontrol {Tool Bar}.
\li \l [QtQuickControls]{ToolSeparator}{Tool Separator} separates a
group of items from adjacent items on a \uicontrol {Tool Bar}.
\li \l [QtQuickControls]{Tumbler} is a spinnable wheel of items that
can be selected.
\endlist
You can also use the \l Dialog type in the Qt Quick Dialogs module to wrap
arbitrary content into a dialog window including a row of platform-tailored
buttons.
\include qtquick-animation-types.qdocinc qtquick animation types \include qtquick-animation-types.qdocinc qtquick animation types
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\include qtdesignstudio-visual-effects.qdocinc qml visual effects \include qtdesignstudio-visual-effects.qdocinc qml visual effects
\include qtdesignstudio-components.qdocinc creating studio components
\include qtdesignstudio-components.qdocinc studio components
\endif \endif
\include qtquick-mcu-support.qdocinc mcu qtquick components
\section1 Styling Controls
Qt Quick Controls provide lightweight QML types for creating performant
user interfaces for \l{glossary-device}{devices}. The controls can be
\l {Styling Qt Quick Controls}{styled}. The visual editor reads the
\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.
\image qtquick-designer-style-list.png "Style menu on the toolbar"
For an example of defining your own style and using it in the Design mode,
see \l {Qt Quick Controls 2 - Flat Style}.
For more information about how to customize a particular control, see
\l{Customization Reference}.
\if defined(qtcreator)
\section1 History of Qt Quick Controls \section1 History of Qt Quick Controls
In Qt 4, ready-made Qt Quick 1 Components were provided for creating In Qt 4, ready-made Qt Quick 1 Components were provided for creating
@@ -247,20 +189,6 @@
Qt Labs Controls. They provide lightweight QML types for creating performant Qt Labs Controls. They provide lightweight QML types for creating performant
user interfaces for \l{glossary-device}{devices}. user interfaces for \l{glossary-device}{devices}.
Qt Quick Controls 2 achieve improved efficiency by employing a simplified
\l {Styling Qt Quick Controls}{styling architecture} when compared to
Qt Quick Controls, on which the module is based. The visual editor reads the
\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.
For an example of defining your own style and using it in the Design mode, see
\l {Qt Quick Controls 2 - Flat Style}.
For more information about how to customize a particular control, see
\l{Customization Reference}.
Qt Quick Controls 2 work in conjunction with Qt Quick and Qt Quick Layouts. Qt Quick Controls 2 work in conjunction with Qt Quick and Qt Quick Layouts.
The \QC project wizards create Qt Quick applications that use Qt Quick The \QC project wizards create Qt Quick applications that use Qt Quick
@@ -271,6 +199,7 @@
Some ready-made controls, such as a gauge, dial, status indicator, and Some ready-made controls, such as a gauge, dial, status indicator, and
tumbler, are provided by the \l {Qt Quick Extras} module. tumbler, are provided by the \l {Qt Quick Extras} module.
\endif
\section1 Creating Components in Design Mode \section1 Creating Components in Design Mode
@@ -313,6 +242,10 @@
\endlist \endlist
\if defined(qtdesignstudio)
\include qtdesignstudio-components.qdocinc creating studio components
\endif
\section1 Moving Within Components \section1 Moving Within Components
Components can consist of several other components. To view the component Components can consist of several other components. To view the component

View File

@@ -37,8 +37,8 @@
JavaScript code to be executed when the signal handler is invoked. JavaScript code to be executed when the signal handler is invoked.
QML types have predefined signals that are emitted when users interact with QML types have predefined signals that are emitted when users interact with
the application. For example, the \l MouseArea type from the \l QtQuick the application. For example, the \l {Mouse Area} type has a
module has a \c clicked signal that is emitted whenever the mouse is \c clicked signal that is emitted whenever the mouse is
clicked within the area. Since the signal name is \c clicked, the signal clicked within the area. Since the signal name is \c clicked, the signal
handler for receiving this signal is named \c onClicked. handler for receiving this signal is named \c onClicked.
@@ -48,7 +48,7 @@
\e <Property> is the name of the property, with the first letter \e <Property> is the name of the property, with the first letter
capitalized. capitalized.
For example, the MouseArea type has a \c pressed property. To receive a For example, the Mouse Area type has a \c pressed property. To receive a
notification whenever this property changes, you would use a signal handler notification whenever this property changes, you would use a signal handler
called \c onPressedChanged. called \c onPressedChanged.

View File

@@ -454,10 +454,6 @@
\li \inlineimage icons/page-icon16.png \li \inlineimage icons/page-icon16.png
\li \l [QtQuickControls]{Page} \li \l [QtQuickControls]{Page}
\li A styled page control with support for a header and footer. \li A styled page control with support for a header and footer.
\row
\li \inlineimage icons/pageindicator-icon16.png
\li \l [QtQuickControls]{PageIndicator}{Page Indicator}
\li An indicator for the currently active page.
\row \row
\li \inlineimage icons/pane-icon16.png \li \inlineimage icons/pane-icon16.png
\li \l [QtQuickControls]{Pane} \li \l [QtQuickControls]{Pane}

View File

@@ -181,7 +181,7 @@
\section1 Connecting Buttons to States \section1 Connecting Buttons to States
QML types have predefined signals that are emitted when users interact QML types have predefined signals that are emitted when users interact
with the UI. The \e PushButton QML type contains a \l{MouseArea} type with the UI. The \e PushButton QML type contains a \l{Mouse Area} type
that has a \e clicked signal. The signal is emitted whenever the mouse that has a \e clicked signal. The signal is emitted whenever the mouse
is clicked within the area. is clicked within the area.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -142,7 +142,7 @@
\li Asset layers are exported as \e merged. \li Asset layers are exported as \e merged.
\li Text layers can only be exported as \e child or \e skipped. \li Text layers can only be exported as \e child or \e skipped.
\li A \e hotspot layer can only be exported as \e child or \e skipped. \li A \e hotspot layer can only be exported as \e child or \e skipped.
It is always exported as an instance of the \l MouseArea QML type. It is always exported as an instance of the \l {Mouse Area} type.
\li A symbol instance layer can only be exported as \e child or \li A symbol instance layer can only be exported as \e child or
\e skipped. \e skipped.
\li Images are exported in JPG, PNG, or SVG format, depending on your \li Images are exported in JPG, PNG, or SVG format, depending on your
@@ -157,7 +157,7 @@
later in \QDS. If you are familiar with the \l{QML Syntax Basics} later in \QDS. If you are familiar with the \l{QML Syntax Basics}
{QML syntax}, you can modify the settings to tailor the generated QML to {QML syntax}, you can modify the settings to tailor the generated QML to
a certain degree. For example, you can specify the QML type or a certain degree. For example, you can specify the QML type or
\l {Studio Components}{Qt Quick Studio Component} to use for a component or \l {Shapes}{Qt Quick Studio Component} to use for a component or
layer. If you have drawn an arc that you mean to animate, you can export it layer. If you have drawn an arc that you mean to animate, you can export it
as an \l Arc component to avoid having to replace the arc image with an Arc as an \l Arc component to avoid having to replace the arc image with an Arc
component in \QDS. Or you could export a button as a Qt Quick Controls component in \QDS. Or you could export a button as a Qt Quick Controls
@@ -191,7 +191,7 @@
\li \uicontrol Skipped completely skips the selected layer. \li \uicontrol Skipped completely skips the selected layer.
\endlist \endlist
\li In the \uicontrol {QML Type} field, specify the QML type or \li In the \uicontrol {QML Type} field, specify the QML type or
\l {Studio Components}{Qt Quick Studio Component} to morph this \l {Shapes}{Qt Quick Studio Component} to morph this
layer into. The component that is generated during import will be layer into. The component that is generated during import will be
of this type. For example, if you drew a rectangle, you can export of this type. For example, if you drew a rectangle, you can export
it as a \l Rectangle component. it as a \l Rectangle component.

View File

@@ -23,26 +23,6 @@
** **
****************************************************************************/ ****************************************************************************/
/*!
//! [studio components]
\section1 Studio Components
A set of ready-made studio components are available for creating objects with
particular abilities, such as being visibly \e flipped between their front
and back sides, like a card. The studio components are built on top of
\l {Qt Quick Shapes QML Types}, with some additional properties.
You can drag-and-drop the following studio components from
\uicontrol Library to \uicontrol {Form Editor} or \uicontrol Navigator:
\list
\li \l Flipable provides a surface that can be flipped.
\li \l Group provides an item with the size property.
\endlist
//! [studio components]
//! [creating studio components] //! [creating studio components]
\section1 Creating Custom Controls \section1 Creating Custom Controls

View File

@@ -63,7 +63,7 @@
or create them from scratch using the following wizards: or create them from scratch using the following wizards:
\list \list
\li \uicontrol {MCU Support Application} creates an application that \li \uicontrol {Qt for MCUs Application} creates an application that
uses a subset of \l{Qt QML} and \l{Qt Quick Controls} types (as uses a subset of \l{Qt QML} and \l{Qt Quick Controls} types (as
supported by Qt for MCUs) that you can deploy, run, and debug on supported by Qt for MCUs) that you can deploy, run, and debug on
MCU boards. MCU boards.

View File

@@ -83,6 +83,7 @@
\li \l{Editing 2D Content} \li \l{Editing 2D Content}
\li \l{Shapes} \li \l{Shapes}
\li \l{Images} \li \l{Images}
\li \l{User Interaction Methods}
\li \l{Lists and Other Data Models} \li \l{Lists and Other Data Models}
\li \l{Creating Buttons} \li \l{Creating Buttons}
\li \l{Creating Scalable Buttons and Borders} \li \l{Creating Scalable Buttons and Borders}

View File

@@ -30,37 +30,61 @@
\title Adding 3D Views \title Adding 3D Views
You can use a wizard to create a Qt Quick 3D UI project that imports To create a Qt Quick 3D UI project, we recommend using a \uicontrol
the \l{Qt Quick 3D} QML types to the \uicontrol {QML Types} tab in {Qt Quick 3D Application Template} wizard template that imports the
\uicontrol Library and contains a 3D view, scene light, camera, and \l{Qt Quick 3D} QML types to the \uicontrol {QML Types} tab in
model. A default material is attached to the model. You can attach \uicontrol Library and contains a 3D view. A 3D view type includes a
textures to materials. For more information about creating projects, \l {Setting Scene Environment}{scene environment} as well as a scene
see \l{Creating Projects}. \l {Using Lights}{light}, \l {Using Scene Camera}{camera}, and \l {Adding
Models}{model}. A default \l {Using Materials and Shaders}{material} is
attached to the model. You can attach \l {Attaching Textures to Materials}
{textures} to materials. For more information about creating projects, see
\l{Creating Projects}.
To add a 3D view to some other kind of project and to display the Qt Quick To add a 3D view to some other kind of project and to display the Qt Quick
3D QML types in \uicontrol Library, select \uicontrol Library > 3D QML types in \uicontrol Library, select \uicontrol Library >
\uicontrol {QML Imports} > \uicontrol {Add Import} > \uicontrol QtQuick3D. \uicontrol {QML Imports} > \uicontrol {Add Import} > \uicontrol QtQuick3D.
\image studio-qtquick-3d-components.png \image studio-qtquick-3d-components.png "Qt Quick 3D components in Library"
To add components to the scene, drag and drop them to \uicontrol Navigator After importing the Qt Quick 3D QML types, drag and drop a \uicontrol
or \uicontrol {Form Editor}. View3D type to \uicontrol Navigator or to \uicontrol {Form Editor}.
\image studio-navigator-view3d.png "View 3D component in the Navigator" \image studio-navigator-view3d.png "A View 3D component in the Navigator"
By default, a directional light and a perspective camera are used. By default, a directional light and a perspective camera are used in a 3D
To use other light and camera types, change the type of the component scene created by using the wizard template mentioned above. To use other
in the \uicontrol Type field in \uicontrol Properties. For example, light and camera types, select the component in \uicontrol {3D Editor} or
to use a point light, enter \e {PointLight}. \uicontrol Navigator and change the type of the component in the \uicontrol
Type field in \uicontrol Properties. For example, to use a point light,
enter \e {PointLight}.
\image studio-3d-properties-type.png "Type field in Properties view" \image studio-3d-properties-type.png "Type field in Properties view"
To edit component properties, select the component in Similarly to other components, you can select a 3D view in \uicontrol
\uicontrol {Form Editor} or \uicontrol Navigator and Navigator or \uicontrol {3D Editor} and modify its property values in the
modify the property values in \uicontrol Properties. \uicontrol Properties view. Use the properties in the \uicontrol View3D
tab to set some properties specific to a 3D view component.
\image studio-qtquick-3d-view.png "View 3D component properties" \image studio-qtquick-3d-view.png "View 3D component properties"
For more information about the available components and their properties, The \uicontrol Camera property defines which camera is used to render the
see \l{Using 3D Components}. scene to \uicontrol {Form Editor}. If this property is not defined, the
first enabled camera in the scene will be used.
The \uicontrol Environment property specifies the \uicontrol
{Scene Environment} used to render the scene. By default, the first
\uicontrol {Scene Environment} in the scene is set as the property value.
The \uicontrol {Import Scene} property defines the ID of the component to
render to \uicontrol {Form Editor}. The component does not have to be a
child of a 3D view type. This referenced component becomes a sibling to
child items of a 3D view, if there are any. You can use this property, for
example, to create a split screen view showing your scene from multiple
cameras. For more information on how to to use a 3D view to show a scene
from multiple cameras, see \l {Qt Quick 3D - View3D Example}.
\note The \uicontrol {Import Scene} property can only be set once.
Subsequent changes will have no effect.
*/ */

View File

@@ -103,7 +103,9 @@ def get_arguments():
action='append', dest='config_args', default=[]) action='append', dest='config_args', default=[])
parser.add_argument('--zip-infix', help='Adds an infix to generated zip files, use e.g. for a build number.', parser.add_argument('--zip-infix', help='Adds an infix to generated zip files, use e.g. for a build number.',
default='') default='')
return parser.parse_args() args = parser.parse_args()
args.with_debug_info = args.build_type == 'RelWithDebInfo'
return args
def build_qtcreator(args, paths): def build_qtcreator(args, paths):
if not os.path.exists(paths.build): if not os.path.exists(paths.build):
@@ -175,6 +177,10 @@ def build_qtcreator(args, paths):
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install, common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install,
'--component', 'Devel'], '--component', 'Devel'],
paths.build) paths.build)
if args.with_debug_info:
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.debug_install,
'--component', 'DebugInfo'],
paths.build)
if not args.no_docs: if not args.no_docs:
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install,
'--component', 'qch_docs'], '--component', 'qch_docs'],
@@ -245,6 +251,11 @@ def package_qtcreator(args, paths):
os.path.join(paths.result, 'qtcreator' + args.zip_infix + '_dev.7z'), os.path.join(paths.result, 'qtcreator' + args.zip_infix + '_dev.7z'),
'*'], '*'],
paths.dev_install) paths.dev_install)
if args.with_debug_info:
common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, 'qtcreator' + args.zip_infix + '-debug.7z'),
'*'],
paths.debug_install)
if common.is_windows_platform(): if common.is_windows_platform():
common.check_print_call(['7z', 'a', '-mmt2', common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, 'wininterrupt' + args.zip_infix + '.7z'), os.path.join(paths.result, 'wininterrupt' + args.zip_infix + '.7z'),
@@ -271,8 +282,8 @@ def package_qtcreator(args, paths):
def get_paths(args): def get_paths(args):
Paths = collections.namedtuple('Paths', Paths = collections.namedtuple('Paths',
['qt', 'src', 'build', ['qt', 'src', 'build',
'install', 'dev_install', 'wininterrupt_install', 'install', 'dev_install', 'debug_install',
'qtcreatorcdbext_install', 'result', 'wininterrupt_install', 'qtcreatorcdbext_install', 'result',
'elfutils', 'llvm']) 'elfutils', 'llvm'])
build_path = os.path.abspath(args.build) build_path = os.path.abspath(args.build)
install_path = os.path.join(build_path, 'install') install_path = os.path.join(build_path, 'install')
@@ -281,6 +292,7 @@ def get_paths(args):
build=os.path.join(build_path, 'build'), build=os.path.join(build_path, 'build'),
install=os.path.join(install_path, 'qt-creator'), install=os.path.join(install_path, 'qt-creator'),
dev_install=os.path.join(install_path, 'qt-creator-dev'), dev_install=os.path.join(install_path, 'qt-creator-dev'),
debug_install=os.path.join(install_path, 'qt-creator-debug'),
wininterrupt_install=os.path.join(install_path, 'wininterrupt'), wininterrupt_install=os.path.join(install_path, 'wininterrupt'),
qtcreatorcdbext_install=os.path.join(install_path, 'qtcreatorcdbext'), qtcreatorcdbext_install=os.path.join(install_path, 'qtcreatorcdbext'),
result=build_path, result=build_path,

View File

@@ -59,7 +59,9 @@ def get_arguments():
action='store_true', default=False) action='store_true', default=False)
parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)', parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)',
default='RelWithDebInfo') default='RelWithDebInfo')
return parser.parse_args() args = parser.parse_args()
args.with_debug_info = args.build_type == 'RelWithDebInfo'
return args
def build(args, paths): def build(args, paths):
if not os.path.exists(paths.build): if not os.path.exists(paths.build):
@@ -117,6 +119,10 @@ def build(args, paths):
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install, common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install,
'--component', 'Devel'], '--component', 'Devel'],
paths.build) paths.build)
if args.with_debug_info:
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.debug_install,
'--component', 'DebugInfo'],
paths.build)
def package(args, paths): def package(args, paths):
if not os.path.exists(paths.result): if not os.path.exists(paths.result):
@@ -127,11 +133,15 @@ def package(args, paths):
common.check_print_call(['7z', 'a', '-mmt2', common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, args.name + '_dev.7z'), '*'], os.path.join(paths.result, args.name + '_dev.7z'), '*'],
paths.dev_install) paths.dev_install)
if args.with_debug_info:
common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, args.name + '-debug.7z'), '*'],
paths.debug_install)
def get_paths(args): def get_paths(args):
Paths = collections.namedtuple('Paths', Paths = collections.namedtuple('Paths',
['qt', 'src', 'build', 'qt_creator', ['qt', 'src', 'build', 'qt_creator',
'install', 'dev_install', 'result']) 'install', 'dev_install', 'debug_install', 'result'])
build_path = os.path.abspath(args.build) build_path = os.path.abspath(args.build)
install_path = os.path.join(build_path, 'install') install_path = os.path.join(build_path, 'install')
result_path = os.path.abspath(args.output_path) if args.output_path else build_path result_path = os.path.abspath(args.output_path) if args.output_path else build_path
@@ -141,6 +151,7 @@ def get_paths(args):
qt_creator=os.path.abspath(args.qtc_path), qt_creator=os.path.abspath(args.qtc_path),
install=os.path.join(install_path, args.name), install=os.path.join(install_path, args.name),
dev_install=os.path.join(install_path, args.name + '-dev'), dev_install=os.path.join(install_path, args.name + '-dev'),
debug_install=os.path.join(install_path, args.name + '-debug'),
result=result_path) result=result_path)
def main(): def main():

View File

@@ -1213,6 +1213,16 @@ def qdumpHelper_Qt5_QMap(d, value, keyType, valueType):
d.putPairItem(i, pair, 'key', 'value') d.putPairItem(i, pair, 'key', 'value')
def qdumpHelper_Qt6_QMap(d, value, keyType, valueType):
d_ptr = d.extractPointer(value)
if d_ptr == 0:
d.putItemCount(0)
return
m = value['d']['d']['m']
d.putItem(m)
d.putBetterType('QMap<%s, %s>' % (keyType.name, valueType.name))
def qform__QMap(): def qform__QMap():
return [DisplayFormat.CompactMap] return [DisplayFormat.CompactMap]
@@ -1222,18 +1232,32 @@ def qdump__QMap(d, value):
def qdumpHelper_QMap(d, value, keyType, valueType): def qdumpHelper_QMap(d, value, keyType, valueType):
if d.qtVersion() < 0x50000: if d.qtVersion() >= 0x60000:
qdumpHelper_Qt4_QMap(d, value, keyType, valueType) qdumpHelper_Qt6_QMap(d, value, keyType, valueType)
else: elif d.qtVersion() >= 0x50000:
qdumpHelper_Qt5_QMap(d, value, keyType, valueType) qdumpHelper_Qt5_QMap(d, value, keyType, valueType)
else:
qdumpHelper_Qt4_QMap(d, value, keyType, valueType)
def qform__QMultiMap(): def qform__QMultiMap():
return [DisplayFormat.CompactMap] return [DisplayFormat.CompactMap]
def qdumpHelper_Qt6_QMultiMap(d, value, keyType, valueType):
d_ptr = d.extractPointer(value)
if d_ptr == 0:
d.putItemCount(0)
return
m = value['d']['d']['m']
d.putItem(m)
d.putBetterType('QMultiMap<%s, %s>' % (keyType.name, valueType.name))
def qdump__QMultiMap(d, value): def qdump__QMultiMap(d, value):
qdump__QMap(d, value) if d.qtVersion() >= 0x60000:
qdumpHelper_Qt6_QMultiMap(d, value, value.type[0], value.type[1])
else:
qdump__QMap(d, value)
def qform__QVariantMap(): def qform__QVariantMap():
@@ -1518,7 +1542,10 @@ def qform__QStack():
def qdump__QStack(d, value): def qdump__QStack(d, value):
qdump__QVector(d, value) if d.qtVersion() >= 0x60000:
qdump__QList(d, value)
else:
qdump__QVector(d, value)
def qdump__QPolygonF(d, value): def qdump__QPolygonF(d, value):

View File

@@ -1,4 +1,4 @@
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD $$PWD/../interfaces
HEADERS += $$PWD/synchronizecommand.h \ \ HEADERS += $$PWD/synchronizecommand.h \ \
$$PWD/captureddatacommand.h \ $$PWD/captureddatacommand.h \

View File

@@ -225,6 +225,7 @@ static void readStream(QDataStream &in, ImageContainer &container)
in >> imageSize; in >> imageSize;
in >> imageFormat; in >> imageFormat;
in >> byteCount; in >> byteCount;
in >> pixelRatio;
QImage image = QImage(imageSize, QImage::Format(imageFormat)); QImage image = QImage(imageSize, QImage::Format(imageFormat));

View File

@@ -105,23 +105,26 @@ bool operator ==(const InformationContainer &first, const InformationContainer &
&& first.m_thirdInformation == second.m_thirdInformation; && first.m_thirdInformation == second.m_thirdInformation;
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) static bool isFirstLessThenSecond(const QVariant &first, const QVariant &second)
static bool operator <(const QVariant &first, const QVariant &second)
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) || QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
if (first.userType() == second.userType()) { if (first.userType() == second.userType()) {
if (first.canConvert<QByteArray>()) if (first.canConvert<QByteArray>())
return first.value<QByteArray>() < second.value<QByteArray>(); return first.value<QByteArray>() < second.value<QByteArray>();
} }
return true; return true;
} #else
return first < second;
#endif #endif
}
bool operator <(const InformationContainer &first, const InformationContainer &second) bool operator <(const InformationContainer &first, const InformationContainer &second)
{ {
return (first.m_instanceId < second.m_instanceId) return (first.m_instanceId < second.m_instanceId)
|| (first.m_instanceId == second.m_instanceId && first.m_name < second.m_name) || (first.m_instanceId == second.m_instanceId && first.m_name < second.m_name)
|| (first.m_instanceId == second.m_instanceId && first.m_name == second.m_name && first.m_information < second.m_information); || (first.m_instanceId == second.m_instanceId && first.m_name == second.m_name
&& isFirstLessThenSecond(first.m_information, second.m_information));
} }
QDebug operator <<(QDebug debug, const InformationContainer &container) QDebug operator <<(QDebug debug, const InformationContainer &container)

View File

@@ -25,7 +25,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick3D 1.15 import QtQuick3D 1.15
import QtQuick3D.Effects 1.15
Item { Item {
id: root id: root
@@ -39,7 +38,6 @@ Item {
property var previewObject property var previewObject
property var materialViewComponent property var materialViewComponent
property var effectViewComponent
property var modelViewComponent property var modelViewComponent
property var nodeViewComponent property var nodeViewComponent
@@ -59,8 +57,6 @@ Item {
if (obj instanceof Material) if (obj instanceof Material)
createViewForMaterial(obj); createViewForMaterial(obj);
else if (obj instanceof Effect)
createViewForEffect(obj);
else if (obj instanceof Model) else if (obj instanceof Model)
createViewForModel(obj); createViewForModel(obj);
else if (obj instanceof Node) else if (obj instanceof Node)
@@ -79,16 +75,6 @@ Item {
view = materialViewComponent.createObject(viewRect, {"previewMaterial": material}); view = materialViewComponent.createObject(viewRect, {"previewMaterial": material});
} }
function createViewForEffect(effect)
{
if (!effectViewComponent)
effectViewComponent = Qt.createComponent("EffectNodeView.qml");
// Always recreate the view to ensure effect is up to date
if (effectViewComponent.status === Component.Ready)
view = effectViewComponent.createObject(viewRect, {"previewEffect": effect});
}
function createViewForModel(model) function createViewForModel(model)
{ {
if (!modelViewComponent) if (!modelViewComponent)

View File

@@ -838,6 +838,19 @@ QVector3D MouseArea3D::getMousePosInPlane(const MouseArea3D *helper,
return sceneTrans.inverted().transform(intersectGlobalPos).toVec3(); return sceneTrans.inverted().transform(intersectGlobalPos).toVec3();
} }
static QPoint getPosFromMoveEvent(QEvent *event)
{
switch (event->type()) {
case QEvent::MouseMove:
return static_cast<QMouseEvent *>(event)->pos();
case QEvent::HoverMove:
return static_cast<QHoverEvent *>(event)->pos();
default:
break;
}
return {};
}
bool MouseArea3D::eventFilter(QObject *, QEvent *event) bool MouseArea3D::eventFilter(QObject *, QEvent *event)
{ {
if (!m_active || (m_grabsMouse && s_mouseGrab && s_mouseGrab != this if (!m_active || (m_grabsMouse && s_mouseGrab && s_mouseGrab != this
@@ -951,10 +964,9 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event)
} }
case QEvent::MouseMove: case QEvent::MouseMove:
case QEvent::HoverMove: { case QEvent::HoverMove: {
auto const mouseEvent = static_cast<QMouseEvent *>(event); const QPoint pos = getPosFromMoveEvent(event);
const QVector3D mousePosInPlane = getMousePosInPlane(m_dragging ? m_dragHelper : this, const QVector3D mousePosInPlane = getMousePosInPlane(m_dragging ? m_dragHelper : this, pos);
mouseEvent->pos()); const bool hasMouse = mouseOnTopOfMouseArea(mousePosInPlane, pos);
const bool hasMouse = mouseOnTopOfMouseArea(mousePosInPlane, mouseEvent->pos());
setHovering(hasMouse); setHovering(hasMouse);
@@ -970,7 +982,7 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event)
if (m_dragging && (m_circlePickArea.y() > 0. || !qFuzzyCompare(mousePosInPlane.z(), -1))) { if (m_dragging && (m_circlePickArea.y() > 0. || !qFuzzyCompare(mousePosInPlane.z(), -1))) {
m_mousePosInPlane = mousePosInPlane; m_mousePosInPlane = mousePosInPlane;
emit dragged(mousePosInPlane.toVector2D(), mouseEvent->pos()); emit dragged(mousePosInPlane.toVector2D(), pos);
} }
break; break;

View File

@@ -132,6 +132,9 @@ bool IconRenderer::eventFilter(QObject *watched, QEvent *event)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (watched == m_quickView && event->type() == QEvent::Expose) if (watched == m_quickView && event->type() == QEvent::Expose)
QTimer::singleShot(0, this, &IconRenderer::createIcon); QTimer::singleShot(0, this, &IconRenderer::createIcon);
#else
Q_UNUSED(watched)
Q_UNUSED(event)
#endif #endif
return false; return false;
} }

View File

@@ -45,7 +45,6 @@
<file>mockfiles/ModelNode3DImageView.qml</file> <file>mockfiles/ModelNode3DImageView.qml</file>
<file>mockfiles/ModelNode2DImageView.qml</file> <file>mockfiles/ModelNode2DImageView.qml</file>
<file>mockfiles/MaterialNodeView.qml</file> <file>mockfiles/MaterialNodeView.qml</file>
<file>mockfiles/EffectNodeView.qml</file>
<file>mockfiles/ModelNodeView.qml</file> <file>mockfiles/ModelNodeView.qml</file>
<file>mockfiles/NodeNodeView.qml</file> <file>mockfiles/NodeNodeView.qml</file>
<file>mockfiles/meshes/arrow.mesh</file> <file>mockfiles/meshes/arrow.mesh</file>

View File

@@ -152,6 +152,9 @@ TextInput {
onCanceled: mouseArea.endDrag() onCanceled: mouseArea.endDrag()
onClicked: { onClicked: {
if (textInput.edit)
mouse.accepted = false
if (mouseArea.wasDragging) { if (mouseArea.wasDragging) {
mouseArea.wasDragging = false mouseArea.wasDragging = false
return return
@@ -162,11 +165,19 @@ TextInput {
} }
onPressed: { onPressed: {
if (textInput.edit)
mouse.accepted = false
mouseArea.potentialDragStart = true mouseArea.potentialDragStart = true
mouseArea.pressStartX = mouseArea.mouseX mouseArea.pressStartX = mouseArea.mouseX
} }
onReleased: mouseArea.endDrag() onReleased: {
if (textInput.edit)
mouse.accepted = false
mouseArea.endDrag()
}
function endDrag() { function endDrag() {
if (!mouseArea.dragging) if (!mouseArea.dragging)
@@ -237,7 +248,6 @@ TextInput {
PropertyChanges { PropertyChanges {
target: mouseArea target: mouseArea
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
enabled: true
} }
}, },
State { State {
@@ -260,7 +270,6 @@ TextInput {
PropertyChanges { PropertyChanges {
target: mouseArea target: mouseArea
cursorShape: Qt.IBeamCursor cursorShape: Qt.IBeamCursor
enabled: false
} }
}, },
State { State {

View File

@@ -5,7 +5,7 @@
<style name="Selection" foreground="#bec0c2" background="#1d545c"/> <style name="Selection" foreground="#bec0c2" background="#1d545c"/>
<style name="LineNumber" foreground="#bec0c2" background="#404244"/> <style name="LineNumber" foreground="#bec0c2" background="#404244"/>
<style name="SearchResult" background="#8a7f2c"/> <style name="SearchResult" background="#8a7f2c"/>
<style name="SearchResultAlt1" background="#8a402c"/> <style name="SearchResultAlt1" foreground="#aaaaff" background="#363655"/>
<style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/> <style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/>
<style name="SearchScope" background="#8a602c"/> <style name="SearchScope" background="#8a602c"/>
<style name="Parentheses" foreground="#bec0c2" background="#1d545c"/> <style name="Parentheses" foreground="#bec0c2" background="#1d545c"/>

View File

@@ -33,7 +33,7 @@
<style name="AutoComplete" foreground="#a0a0ff" background="#333333"/> <style name="AutoComplete" foreground="#a0a0ff" background="#333333"/>
<style name="Preprocessor" foreground="#5555ff"/> <style name="Preprocessor" foreground="#5555ff"/>
<style name="SearchResult" background="#555500"/> <style name="SearchResult" background="#555500"/>
<style name="SearchResultAlt1" background="#363636"/> <style name="SearchResultAlt1" foreground="#aaaaff" background="#363655"/>
<style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/> <style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/>
<style name="SearchScope" background="#222200"/> <style name="SearchScope" background="#222200"/>
<style name="Selection" foreground="#000000" background="#aaaaaa"/> <style name="Selection" foreground="#000000" background="#aaaaaa"/>

View File

@@ -5,8 +5,6 @@
<style name="Selection" foreground="#ffffff" background="#308cc6"/> <style name="Selection" foreground="#ffffff" background="#308cc6"/>
<style name="LineNumber" foreground="#9f9d9a" background="#efebe7"/> <style name="LineNumber" foreground="#9f9d9a" background="#efebe7"/>
<style name="SearchResult" background="#ffef0b"/> <style name="SearchResult" background="#ffef0b"/>
<style name="SearchResultAlt1" background="#b4b4b4"/>
<style name="SearchResultAlt2" background="#ff6464"/>
<style name="SearchScope" background="#f5fafd"/> <style name="SearchScope" background="#f5fafd"/>
<style name="Parentheses" foreground="#ff0000" background="#b4eeb4"/> <style name="Parentheses" foreground="#ff0000" background="#b4eeb4"/>
<style name="ParenthesesMismatch" background="#ff00ff"/> <style name="ParenthesesMismatch" background="#ff00ff"/>

View File

@@ -40,7 +40,7 @@
<style name="Preprocessor" foreground="#409090"/> <style name="Preprocessor" foreground="#409090"/>
<style name="RemovedLine" foreground="#ff0000"/> <style name="RemovedLine" foreground="#ff0000"/>
<style name="SearchResult" foreground="#000000" background="#ffef0b"/> <style name="SearchResult" foreground="#000000" background="#ffef0b"/>
<style name="SearchResultAlt1" foreground="#000000" background="#616161"/> <style name="SearchResultAlt1" foreground="#000000" background="#6464ff"/>
<style name="SearchResultAlt2" foreground="#000000" background="#ff6464"/> <style name="SearchResultAlt2" foreground="#000000" background="#ff6464"/>
<style name="SearchScope" foreground="#000000" background="#f8fafc"/> <style name="SearchScope" foreground="#000000" background="#f8fafc"/>
<style name="Selection" foreground="#ffffff" background="#4e4e8f"/> <style name="Selection" foreground="#ffffff" background="#4e4e8f"/>

View File

@@ -14,7 +14,7 @@
<style name="Selection" background="#11404c"/> <style name="Selection" background="#11404c"/>
<style name="LineNumber" foreground="#888888" background="#272822"/> <style name="LineNumber" foreground="#888888" background="#272822"/>
<style name="SearchResult" background="#555500"/> <style name="SearchResult" background="#555500"/>
<style name="SearchResultAlt1" background="#aa0000"/> <style name="SearchResultAlt1" foreground="#aaaaff" background="#363655"/>
<style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/> <style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/>
<style name="SearchScope" background="#222200"/> <style name="SearchScope" background="#222200"/>
<style name="Parentheses" foreground="#ffffff" background="#11404c"/> <style name="Parentheses" foreground="#ffffff" background="#11404c"/>

View File

@@ -11,8 +11,8 @@
<style name="Selection" foreground="#002b36" background="#586e75"/> <style name="Selection" foreground="#002b36" background="#586e75"/>
<style name="LineNumber" foreground="#586e75" background="#073642"/> <style name="LineNumber" foreground="#586e75" background="#073642"/>
<style name="SearchResult" background="#073642"/> <style name="SearchResult" background="#073642"/>
<style name="SearchResultAlt1" background="#586e75"/> <style name="SearchResultAlt1" foreground="#aaaaff" background="#363655"/>
<style name="SearchResultAlt2" background="#073642"/> <style name="SearchResultAlt2" foreground="#ffaaaa" background="#553636"/>
<style name="SearchScope" background="#073642"/> <style name="SearchScope" background="#073642"/>
<style name="Parentheses" foreground="#dc322f" background="#586e75" bold="true"/> <style name="Parentheses" foreground="#dc322f" background="#586e75" bold="true"/>
<style name="ParenthesesMismatch" foreground="#fdff2c" background="#d33682" bold="true"/> <style name="ParenthesesMismatch" foreground="#fdff2c" background="#d33682" bold="true"/>

Some files were not shown because too many files have changed in this diff Show More