A component provides a way of defining a new visual item that you can re-use in other QML files. A component is like a black box; it interacts with the outside world through properties, signals, and slots, and is generally defined in its own QML file. You can import components to screens and applications.
You can use the following QML types to create components:
QML types allow you to write cross-platform applications with custom look and feel. You can also use ready-made Qt Quick Components (for Qt 4) to create screens with a native look and feel for a particular target platform. Since Qt 5.1, a set of Qt Quick Controls is available for creating classic desktop-style user interfaces using Qt Quick 2.1.
You can install Qt Quick 1 Components as part of the Qt 4 SDK and the Qt Quick Controls as part of Qt 5.1, or later.
The Qt Creator project wizards create Qt Quick applications that use Qt Quick Components or Controls.
Even if you use the Qt Quick Components, you can still write cross-platform applications, by using different sets of QML files for each platform.
Note: Components are listed in the QML Components section of the Library pane only if the filename begins with a capital letter.
The available properties depend on the QML type.
The following sections contain examples of how to create some common components:
Components can consist of several other components. To view the component hierarchy as a bread crumb path when you edit a component on the canvas, select Go into Component or press F2. Click the component names in the path to navigate to them. You can easily navigate back to the top level when you are done editing the component.