Qt Quick QML 類型

The Qt Quick 模塊提供圖形圖元類型。這些類型僅在 QML 文檔中可用,若該文檔導入 QtQuick 名稱空間。

當前版本的 QtQuick module is version 2.7, and thus it may be imported via the following statement:

import QtQuick 2.7
					

拜訪 Qt Quick 模塊文檔編製瞭解有關概念的更多信息,其中樞是 QtQuick .

子模塊

Qt Quick 包括多個包含額外類型的子模塊。

  • XML List Model - 包含來自 XML 數據用於創建模型的類型
  • 本地存儲 - 包含 JavaScript 接口的子模塊,對於 SQLite database
  • 粒子 - 為 QML 應用程序提供粒子係統
  • Window - 包含用於創建頂層窗口和訪問屏幕信息的類型
  • 對話框 - 包含用於采用係統對話框創建和交互的類型
  • 控件 - 提供一組可重用 UI 組件
  • 布局 - 包含用於在用戶界麵中排列項的類型
  • 測試 - 用於測試 QML 應用程序的類型。

基本類型

有許多基本類型 由 QML 語言默認支持 .

此外, QtQuick import 提供瞭下列基本類型:

date 日期值
point 具有 X 和 Y 屬性的值
rect 具有 X、Y、寬度及高度屬性的值
size 具有寬度和高度屬性的值
color ARGB color value. The color type refers to an ARGB color value. It can be specified in a number of ways:
font Font value with the properties of QFont. The font type refers to a font value with the properties of QFont
matrix4x4 A matrix4x4 type is a 4-row and 4-column matrix
quaternion A quaternion type has scalar, x, y, and z attributes
vector2d A vector2d type has x and y attributes
vector3d Value with x, y, and z attributes
vector4d A vector4d type has x, y, z and w attributes

對象類型

All object types provided by the QtQuick import 基於 Item 類型,其自身派生自 QtObject . QML 對象類型 提供通過 Qt QML 模塊 (譬如 QtObject and Component ) 也是可用的當 import QtQuick .

Canvas Provides a 2D canvas item enabling drawing via JavaScript
CanvasGradient Provides an opaque CanvasGradient interface
CanvasImageData Contains image pixel data in RGBA order
CanvasPixelArray Provides ordered and indexed access to the components of each pixel in image data
Context2D Provides 2D context for shapes on a Canvas item
Accessible 啓用 QML 項的可訪問性
AnimatedImage Plays animations stored as a series of images
AnimatedSprite 繪製子畫麵動畫
BorderImage 基於圖像描繪邊框
Drag For specifying drag and drop events for moved Items
DragEvent Provides information about a drag event
DropArea For specifying drag and drop handling in an area
KeyEvent Provides information about a key event
MouseEvent Provides information about a mouse event
WheelEvent Provides information about a mouse wheel event
Flickable 提供可以 "輕彈" 的錶麵
Flipable Provides a surface that can be flipped
FocusScope Explicitly creates a focus scope
GraphicsInfo Provides information about the used Qt Quick backend
GridView For specifying a grid view of items provided by a model
Image 顯示圖像
EnterKey Provides a property to manipulate the appearance of Enter key on an on-screen keyboard
Item A basic visual QML type
KeyNavigation Supports key navigation by arrow keys
Keys Provides key handling to Items
LayoutMirroring Property used to mirror layout behavior
Transform For specifying advanced transformations on Items
AnchorAnimation 動畫錨點值的變化
ParentAnimation Animates changes in parent values
PathAnimation Animates an item along a path
ItemGrabResult Contains the results from a call to Item::grabToImage()
ViewTransition Specifies items under transition in a view
ListView Provides a list view of items provided by a model
Loader Allows dynamic loading of a subtree from a URL or Component
MouseArea Enables simple mouse handling
GestureEvent Parameter given with the gestureStarted signal
MultiPointTouchArea 啓用處理多觸摸點
TouchPoint Describes a touch point in a MultiPointTouchArea
PathView Lays out model-provided items on a path
PinchArea 啓用簡單捏閤手勢處理
PinchEvent For specifying information about a pinch event
Column Positions its children in a column
Flow Positions its children side by side, wrapping as necessary
Grid Positions its children in grid formation
Positioner Provides attached properties that contain details on where an item exists in a positioner
Row Positions its children in a row
漸變 Defines a gradient fill
GradientStop Defines the color at a position in a Gradient
Rectangle Paints a filled rectangle with an optional border
Repeater Instantiates a number of Item-based components using a provided model
ShaderEffect Applies custom shaders to a rectangle
BorderImageMesh Defines a mesh with vertices arranged like those of a BorderImage
GridMesh Defines a mesh with vertices arranged in a grid
ShaderEffectSource Renders a Qt Quick item into a texture and displays it
Sprite 指定子畫麵動畫
SpriteSequence 繪製子畫麵動畫
AnchorChanges 指定如何按狀態改變項錨點
ParentChange 指定如何在狀態改變時重設項父級
Text Specifies how to add formatted text to a scene
TextEdit Displays multiple lines of editable formatted text
TextInput 顯示可編輯文本行
Matrix4x4 Provides a way to apply a 4x4 tranformation matrix to an Item
Rotation Provides a way to rotate an Item
Scale Provides a way to scale an Item
Translate Provides a way to move an Item without changing its x or y properties
Animation 所有 QML 動畫的基
ColorAnimation Animates changes in color values
NumberAnimation Animates changes in qreal-type values
ParallelAnimation Enables animations to be run in parallel
PauseAnimation Provides a pause for an animation
PropertyAction Specifies immediate property changes during animation
PropertyAnimation Animates changes in property values
RotationAnimation Animates changes in rotation values
ScriptAction Defines scripts to be run during an animation
SequentialAnimation Allows animations to be run sequentially
Vector3dAnimation Animates changes in QVector3d values
AnimationController 啓用動畫的手動控製
Animator 所有 QML 動畫師的基
OpacityAnimator Type animates the opacity of an Item
RotationAnimator Type animates the rotation of an Item
ScaleAnimator Type animates the scale factor of an Item
UniformAnimator Type animates a uniform of a ShaderEffect
XAnimator Type animates the x position of an Item
YAnimator Type animates the y position of an Item
Behavior Defines a default animation for a property change
FontLoader Allows fonts to be loaded by name or URL
FontMetrics Provides metrics for a given font
Path Defines a path for use by PathView
PathArc Defines an arc with the given radius
PathAttribute Specifies how to set an attribute at a given position in a Path
PathCubic Defines a cubic Bezier curve with two control points
PathCurve Defines a point on a Catmull-Rom curve
PathElement 基路徑類型
PathLine 定義直綫
PathPercent Manipulates the way a path is interpreted
PathQuad Defines a quadratic Bezier curve with a control point
PathSvg Defines a path using an SVG path data string
PathInterpolator Specifies how to manually animate along a path
PropertyChanges 描述狀態的新特性綁定或值
Shortcut 提供鍵盤快捷鍵
SmoothedAnimation Allows a property to smoothly track a value
SpringAnimation Allows a property to track a value in a spring-like motion
State 定義對象和特性的配置
StateChangeScript 指定如何按狀態運行腳本
StateGroup 為非項類型提供內置狀態支持
SystemPalette Provides access to the Qt palettes
TextMetrics Provides metrics for a given font and text
Transition Defines animated transitions that occur on state changes
DoubleValidator Defines a validator for non-integer numbers
IntValidator Defines a validator for integer values
RegExpValidator Provides a string validator