java.lang.Object
io.qt.qml.util.QmlTypes
This class allows to automatically load QML types from package.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
registerPackage
(Package pkg) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(Package pkg, int versionMajor) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(Package pkg, String uri) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(Package pkg, String uri, int versionMajor) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(String pkg) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(String pkg, int versionMajor) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(String pkg, String uri) Registers all scriptable classes and qml types in the given package.static void
registerPackage
(String pkg, String uri, int versionMajor) Registers all scriptable classes and qml types in the given package.static int
registerType
(Class<? extends QtObjectInterface> type) Registers the class as qml scriptable type.static int
registerType
(Class<? extends QtObjectInterface> type, int versionMajor) Registers the class as qml scriptable type.static int
registerType
(Class<? extends QtObjectInterface> type, String uri, int versionMajor) Registers the class as qml scriptable type.
-
Method Details
-
registerPackage
Registers all scriptable classes and qml types in the given package. The package needs to be annotated withQmlImportMajorVersion
.- Parameters:
pkg
- java package and qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImportMajorVersion
not available
-
registerPackage
Registers all scriptable classes and qml types in the given package.- Parameters:
pkg
- java package and qml import namespaceversionMajor
- major version for qml import
-
registerPackage
Registers all scriptable classes and qml types in the given package. The package needs to be annotated withQmlImportMajorVersion
.- Parameters:
pkg
- java packageuri
- qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImportMajorVersion
not available
-
registerPackage
Registers all scriptable classes and qml types in the given package.- Parameters:
pkg
- java packageuri
- qml import namespaceversionMajor
- major version for qml import
-
registerPackage
Registers all scriptable classes and qml types in the given package. The package needs to be annotated withQmlImportMajorVersion
.- Parameters:
pkg
- java package and qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImportMajorVersion
not available
-
registerPackage
Registers all scriptable classes and qml types in the given package. The package needs to be annotated withQmlImportMajorVersion
.- Parameters:
pkg
- java packageuri
- qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImportMajorVersion
not available
-
registerPackage
Registers all scriptable classes and qml types in the given package.- Parameters:
pkg
- java package and qml import namespaceversionMajor
- major version for qml import
-
registerPackage
Registers all scriptable classes and qml types in the given package.- Parameters:
pkg
- java packageuri
- qml import namespaceversionMajor
- major version for qml import
-
registerType
Registers the class as qml scriptable type. The class package needs to be annotated withQmlImportMajorVersion
.- Parameters:
type
- registered class- Returns:
- the new type id
- Throws:
QmlNoMajorVersionException
- ifQmlImportMajorVersion
not available in the packageQmlTypeRegistrationException
- when class cannot be registered as qml type
-
registerType
Registers the class as qml scriptable type.- Parameters:
type
- registered classversionMajor
- major version for qml import- Returns:
- the new type id
- Throws:
QmlTypeRegistrationException
- when class cannot be registered as qml type
-
registerType
public static int registerType(Class<? extends QtObjectInterface> type, String uri, int versionMajor) Registers the class as qml scriptable type.- Parameters:
type
- registered classuri
- qml import namespaceversionMajor
- major version for qml import- Returns:
- the new type id
- Throws:
QmlTypeRegistrationException
- when class cannot be registered as qml type
-