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 Qt Quick

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.2, and thus it may be imported via the following statement:

import QtQuick 2.2

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:

date

a date value.

point

a value with x and y attributes.

rect

a value with x, y, width and height attributes.

size

a value with width and height attributes

color

an ARGB color value. The color type refers to an ARGB color value. It can be specified in a number of ways:

font

a font value with the properties of QFont. The font type refers to a font value with the properties of QFont.

vector2d

A vector2d type has x and y attributes.

vector3d

a value with x, y, and z attributes.

vector4d

A vector4d type has x, y, z and w attributes.

quaternion

A quaternion type has scalar, x, y, and z attributes.

matrix4x4

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

  • Repeater - Uses a model to create multiple Item instances
  • Loader - Eases on-demand loading of Items

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

User Input Events

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

Transitions and Animations

Type-specific Animations

Lower-level Animation Types

Animation paths

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.

XML Lists

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 for more information.
  • Package - Collection that enables sharing of items within different views

Data Storage

Graphical Effects

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

QtTest Types

  • TestCase - Represents a unit test case
  • SignalSpy - Enables introspection of signal emission
Notes provided by the Qt Community

No notes