is one that refers to a simple value, such as an
. This contrasts with a
QML Objects in Qt
, which refers to an object with properties, signals, methods and so on. Unlike an object type, a basic type cannot be used to declare QML objects: it is not possible, for example, to declare an
object or a
Some basic types are supported by the engine by default and do not require an import statement to be used, while others do require the client to import the module which provides them. All of the basic types listed below may be used as a
type in a QML document
The basic types supported natively in the QML language are listed below:
二进制 true/false 值
Whole number, e.g. 0, 10, or -20
QML modules may extend the QML language with more basic types. For example, the basic types provided by the
module are listed below:
Qt global object provides useful functions for manipulating values of basic types.
Currently only QML modules which are provided by Qt may provide their own basic types, however this may change in future releases of Qt QML. In order to use types provided by a particular QML module, clients must import that module in their QML documents.
另请参阅 QML Type System in Qt .