Introduction to Controls
控件简介
Using Qt Quick from scratch gives you primitive graphical and interaction elements from which you can build your user interfaces. Using Qt Quick Controls you start from a slightly more structured set of controls to build from.
使用Qt Quick可以为您提供基本的图形和交互元素类型,可以从中构建用户界面。使用Qt Quick Controls,可以从一组稍微结构化的控件开始构建。
The controls range from simple text labels and buttons to more complex ones such as sliders and dials. These elements are handy if you want to create a user interface based on classic interaction patterns, as they provide a good foundation to stand on.
控件的范围从简单的文本标签和按钮到更复杂的控件,如滑块和刻度盘。如果你想创建一个基于经典交互模式的用户界面,这些元素类型很方便,因为它们提供了一个很好的基础控件。
Qt Quick Controls come with a number of styles out of the box that are shown in the table below. The Basic style is a basic flat style. The Universal style is based on the Microsoft Universal Design Guidelines, while Material is based on Google’s Material Design Guidelines, and the Fusion style is a desktop-oriented style.
Qt Quick Controls具有许多开箱即用的样式,如下表所示。基本样式是基本的平面样式。Universal 样式基于Microsoft通用设计指南,而Material 样式基于Google的材质设计指南,Fusion样式是面向桌面的样式。
Some of the styles can be tweaked by modifying palettes. The Imagine style is based on image assets, this allows a graphical designer to create a new style without writing any code at all, not even for palette colour codes.
某些样式可以通过修改调色板来调整。Imagine样式基于图像资源,这允许图形设计师创建新样式,而无需编写任何代码,甚至连调色板颜色代码也不需要。
-
Basic
-
基本样式
-
Fusion
-
Fusion样式
-
macOS
-
macOS样式
-
Material
-
Material样式
-
Imagine
-
Imagine样式
-
Windows
-
Windows样式
-
Universal
-
Universal样式
Qt Quick Controls 2 is available from the QtQuick.Controls
import. The following modules are also of interest:
Qt Quick Controls 2可从QtQuick.Controls
导入。以下模块也很有趣:
QtQuick.Controls
- The basic controls.QtQuick.Controls
- 基本控件。QtQuick.Templates
- Provides the behavioral, non-visual base types for the controls.QtQuick.Templates
- 为控件提供行为的、非可视的基本类型。QtQuick.Controls.Imagine
- Imagine style theming support.QtQuick.Controls.Imagine
- 图片样式主题化支持。QtQuick.Controls.Material
- Material style theming support.QtQuick.Controls.Material
- 材质样式主题化支持。QtQuick.Controls.Universal
- Universal style theming support.QtQuick.Controls.Universal
- 通用样式主题化支持。Qt.labs.platform
- Support for platform native dialogs for common tasks such as picking files, colours, etc, as well as system tray icons and standard paths.Qt.labs.platform
- 用于支持常见任务(如拾取文件、颜色等)的平台本机对话框,以及系统托盘图标和标准路径。
Qt.Labs
Notice that the Qt.labs
modules are experimental, meaning that their APIs can have breaking changes between Qt versions.
请注意,Qt.labs
模块是实验性的,这意味着它们的API可以在Qt版本之间有较大的变化。