Module qtjambi.qml

Class QmlTypes

java.lang.Object
io.qt.qml.util.QmlTypes

public final class QmlTypes extends Object
This class allows to automatically load QML types from package.
  • Method Details

    • registerPackage

      public static void registerPackage(Package pkg)
      Registers all scriptable classes and qml types in the given package. The package needs to be annotated with QmlImport.
      Parameters:
      pkg - java package and qml import namespace
      Throws:
      QmlNoMajorVersionException - if QmlImport not available
    • registerPackage

      public static void registerPackage(Package pkg, int versionMajor)
      Registers all scriptable classes and qml types in the given package.
      Parameters:
      pkg - java package and qml import namespace
      versionMajor - major version for qml import
    • registerPackage

      public static void registerPackage(Package pkg, String uri)
      Registers all scriptable classes and qml types in the given package. The package needs to be annotated with QmlImport.
      Parameters:
      pkg - java package
      uri - qml import namespace
      Throws:
      QmlNoMajorVersionException - if QmlImport not available
    • registerPackage

      public static void registerPackage(Package pkg, String uri, int versionMajor, Class<?>... classes)
      Registers all scriptable classes and qml types in the given package.
      Parameters:
      pkg - java package
      uri - qml import namespace
      versionMajor - major version for qml import
    • registerPackage

      public static void registerPackage(String pkg)
      Registers all scriptable classes and qml types in the given package. The package needs to be annotated with QmlImport.
      Parameters:
      pkg - java package and qml import namespace
      Throws:
      QmlNoMajorVersionException - if QmlImport not available
    • registerPackage

      public static void registerPackage(String pkg, String uri)
      Registers all scriptable classes and qml types in the given package. The package needs to be annotated with QmlImport.
      Parameters:
      pkg - java package
      uri - qml import namespace
      Throws:
      QmlNoMajorVersionException - if QmlImport not available
    • registerPackage

      public static void registerPackage(String pkg, int versionMajor)
      Registers all scriptable classes and qml types in the given package.
      Parameters:
      pkg - java package and qml import namespace
      versionMajor - major version for qml import
    • registerPackage

      public static void registerPackage(String pkg, String uri, int versionMajor)
      Registers all scriptable classes and qml types in the given package.
      Parameters:
      pkg - java package
      uri - qml import namespace
      versionMajor - major version for qml import
    • registerType

      public static int registerType(Class<?> type)
      Registers the class as qml scriptable type. The class package needs to be annotated with QmlImport.
      Parameters:
      type - registered class
      Returns:
      the new type id
      Throws:
      QmlNoMajorVersionException - if QmlImport not available in the package
      QmlTypeRegistrationException - when class cannot be registered as qml type
    • registerType

      public static int registerType(Class<?> type, int versionMajor)
      Registers the class as qml scriptable type.
      Parameters:
      type - registered class
      versionMajor - 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<?> type, String uri, int versionMajor)
      Registers the class as qml scriptable type.
      Parameters:
      type - registered class
      uri - qml import namespace
      versionMajor - major version for qml import
      Returns:
      the new type id
      Throws:
      QmlTypeRegistrationException - when class cannot be registered as qml type