QML types, components, and documents

QML introduces some new concepts that you should be familiar with. A QML type is a concept similar to C++ class. Any value or object in QML should have some type and should be exposed to JavaScript code in a certain way. There are two major kinds of QML types:

  • Basic types are types that hold a concrete value and do not refer to any other objects, for example, string or point
  • Object types are types that can be used to create objects with certain functionality and consistent interface

Basic QML types are similar to C++ primitive types and data structures, such as QPoint. Object types are closer to widget classes, such as QLineEdit, but they are not necessarily tied to GUI.

There are numerous QML types ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.