Qt Quick QML Types
The QtQuick QML module provides a variety of QML types for creating user interfaces and applications with QML. This page lists every QML type provided by this module, organized according to category and purpose.
Importing QtQuick
The types provided by the Qt Quick module are only available in a QML document if that document imports the QtQuick namespace.
The current version of the QtQuick module is version 2.0, and thus it may be imported via the following statement:
import QtQuick 2.0
See the Qt Quick module documentation for more information about the concepts which are central to QtQuick.
Submodules
Qt Quick includes several submodules which contain additional types.
- XML List Model - contains types for creating models from XML data
- Local Storage - a submodule containing a JavaScript interface for an SQLite database
- Particles - provides a particle system for QML applications
- Window - contains types for creating top-level windows and accessing screen information
- Dialogs - contains types for creating and interacting with system dialogs
- Controls - provides a set of reusable UI components
- Layouts - contains types that are used to arrange items in the user interface
Basic Types
There are a number of basic types that are supported by default in the QML language.
In addition, the QtQuick module provides the following basic types:
an ARGB color value. The color type refers to an ARGB color value. It can be specified in a number of ways: | |
a font value with the properties of QFont. The font type refers to a font value with the properties of QFont. | |
A vector2d type has x and y attributes. | |
a value with x, y, and z attributes. | |
A vector4d type has x, y, z and w attributes. | |
A quaternion type has scalar, x, y, and z attributes. | |
A matrix4x4 type is a 4-row and 4-column matrix |
Object Types
All of the object types provided by QtQuick are based on the Item type, which itself derives from QtObject. QML object types provided by the Qt QML module (such as QtObject and Component) are also available when you import QtQuick.
Visual Types
- Item - Basic visual object type inherited by visual object types (visual items)
- Rectangle - A rectangle type
- Image - For incorporating bitmaps into a scene
- BorderImage - Allows the use of images as borders
- AnimatedImage - For playing animations stored as an animated GIF
- AnimatedSprite - For playing animations stored as a series of frames
- SpriteSequence - For playing and transitioning between multiple animations stored as a series of frames
- Text - For inserting formatted text into a scene
- Window - Provides a top-level window
Visual Item Utility
- Accessible - Attached property to make components accessible
- Gradient - For defining a color gradient
- GradientStop - Used to define a color within a Gradient
- SystemPalette - Provides access to the Qt palettes
- Screen - Provides information about the screen on which an Item is displayed
- Sprite - Specifies sprite animations for other Items to display
- FontLoader - Loads fonts by name or URL
Visual Item Generation
Visual Item Transformations
- Transform - Allows specification of advanced transformations on Items
- Scale - Assigns item scaling behaviors
- Rotation - Assigns item rotation behaviors
- Translate - Assigns item translation behaviors
User Input
- MouseArea - Sets up an area for mouse interaction
- Keys - Provides components with attached properties to handle key input.
- KeyNavigation - Supports key navigation by arrow keys
- FocusScope - Mediates keyboard focus changes
- Flickable - Provides a surface that can be "flicked"
- PinchArea - Enables simple pinch gesture handling
- MultiPointTouchArea - Enables handling of multiple touch points
- Drag - For specifying drag and drop events for visual items
- DropArea - For specifying drag and drop event handling in an area
- TextInput - Captures user key input
- TextEdit - Displays multiple lines of editable formatted text
Text Input Utility
- IntValidator - Validates values as integers
- DoubleValidator - Validates real values
- RegExpValidator - Validator for string regular expressions
User Input Events
- TouchPoint - Describes a touch point in a MultiPointTouchArea
- PinchEvent - Specifies information about a pinch event
- WheelEvent - Provides information about a mouse wheel event
- MouseEvent - Provides information about a mouse click event
- KeyEvent - Provides information about a key press event
- DragEvent -Provides information about a drag event
Positioning
- Positioner - Attached property which provides information about where an Item has been positioned
- Column - Arranges its children vertically
- Row - Arranges its children horizontally
- Grid - Positions its children in a grid
- Flow - Positions its children with wrapping support
- LayoutMirroring - Attached property used to mirror layout behavior
States, Transitions and Animations
States
- State - Defines sets of configurations of objects and properties
- PropertyChanges - Describes property changes within a state
- StateGroup - Contains a set of states and state transitions
- StateChangeScript - Allows script binding in a state
- ParentChange - Re-parent an Item in a state change
- AnchorChanges - Change the anchors of an item in a state
Transitions and Animations
- Transition - Animates transitions during state changes
- ViewTransition - Specifies items under transition in a view
- SequentialAnimation - Runs animations sequentially
- ParallelAnimation - Runs animations in parallel
- Behavior - Specifies a default animation for property changes
- PropertyAction - Sets immediate property changes during animation
- PauseAnimation - Introduces a pause in an animation
- SmoothedAnimation - Allows a property to smoothly track a value
- SpringAnimation - Allows a property to track a value in a spring-like motion
- ScriptAction - Runs scripts during an animation
Type-specific Animations
- PropertyAnimation - Animates property changes
- NumberAnimation - Animates properties of type qreal
- Vector3dAnimation - Animates properties of type QVector3d
- ColorAnimation - Animates color changes
- RotationAnimation - Animates rotations
- ParentAnimation - Animates parent changes
- AnchorAnimation - Animates anchor changes
- PathAnimation - Animates position along a path
Lower-level Animation Types
- PathInterpolator - Allows manual animation along a path
- AnimationController - Allows manual control of animation progress
Animation paths
- Path - Defines a path used by PathView
- PathLine - Defines a line in Path
- PathQuad - Defines a quadratic Bezier curve in a Path
- PathCubic - Defines a cubic Bezier curve in a Path
- PathArc - Defines an arc in a Path
- PathCurve - Defines a point on a Catmull-Rom curve in a Path
- PathSvg - Defines a sub-path specified as a SVG path data string in a Path
- PathAttribute - Allows the setting of attributes along a Path
- PathPercent - Modifies the item distribution along a Path
Model/View Types And Data Storage And Access
QML Lists and Models
The Qt QML Models submodule provides the types for structuring data with models and lists.
These QML types are part of Qt Quick for backwards compatibility, but for newer applications, Qt QML Models provides the same functionality.
- VisualItemModel - Contains items that already defines its own visual delegate
- VisualDataModel - Encapsulates a model and a delegate
- VisualDataGroup - Encapsulates a filtered set of visual data items
XML Lists
- XmlListModel - Specifies a model using XPath expressions
- XmlRole - Specifies a role for an XmlListModel
Views
- ListView - Provides a list visualization of a model
- GridView - Provides a grid visualization of a model
- PathView - Visualizes a model's contents along a path. See Path Elements for more information.
- Package - Collection that enables sharing of items within different views
Data Storage
- QtQuick.LocalStorage 2 - Singleton type providing simplified SQL access
Graphical Effects
- Flipable - Provides a surface that produces "flipping" effects
- ShaderEffect - Allows GLSL shaders to be used as graphical effects
- ShaderEffectSource - Usable as a texture in ShaderEffect
- GridMesh - Generates a grid mesh of vertices for use by ShaderEffect
- The QtQuick.Particles 2 module provides a set of Particle System types for Qt Quick 2
Convenience Types
- Connections - Explicitly connects signals and signal handlers
- Binding - Binds any value to any property
- Timer - Provides timed triggers
- WorkerScript - Enables the use of threads in a Qt Quick application
Canvas (similar to HTML5 canvas)
- Canvas - Provides a 2D canvas type similar to the HTML5 canvas
- Context2D - Provides 2D context for shapes on a Canvas item
- CanvasGradient - Allows specification of a gradient on a Canvas
- CanvasPixelArray - Allows specification of a pixel array for use in a Canvas
- CanvasImageData - Allows specification of image data for use in a Canvas
- TextMetrics - Provides text and font measurement data for use in a Canvas