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, Class<?>... classes) 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<?> type) Registers the class as qml scriptable type.static int
registerType
(Class<?> type, int versionMajor) Registers the class as qml scriptable type.static int
registerType
(Class<?> 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 withQmlImport
.- Parameters:
pkg
- java package and qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImport
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 withQmlImport
.- Parameters:
pkg
- java packageuri
- qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImport
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 withQmlImport
.- Parameters:
pkg
- java package and qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImport
not available
-
registerPackage
Registers all scriptable classes and qml types in the given package. The package needs to be annotated withQmlImport
.- Parameters:
pkg
- java packageuri
- qml import namespace- Throws:
QmlNoMajorVersionException
- ifQmlImport
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 withQmlImport
.- Parameters:
type
- registered class- Returns:
- the new type id
- Throws:
QmlNoMajorVersionException
- ifQmlImport
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
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
-