Module qtjambi
Package io.qt.core

Class QMetaType

All Implemented Interfaces:
QtObjectInterface, Cloneable

public class QMetaType extends QtObject implements Cloneable

Manages named types in the meta-object system

Java wrapper for Qt class QMetaType

  • Constructor Details

  • Method Details

    • flags

      @QtUninvokable public final QMetaType.TypeFlags flags()
    • id

      @QtUninvokable public final int id()
    • isRegistered

      @QtUninvokable public final boolean isRegistered()
    • isValid

      @QtUninvokable public final boolean isValid()
    • name

      @QtUninvokable public final QByteArray name()
    • sizeOf

      @QtUninvokable public final int sizeOf()
    • isRegistered

      public static boolean isRegistered(int type)
    • metaObjectForType

      public static QMetaObject metaObjectForType(int type)
    • sizeOf

      public static int sizeOf(int type)
    • type

      public static int type(QByteArray typeName)
    • type

      public static int type(String typeName)
    • typeFlags

      public static QMetaType.TypeFlags typeFlags(int type)
    • typeName

      public static String typeName(int type)
    • unregisterType

      public static boolean unregisterType(int type)
    • equals

      @QtUninvokable public boolean equals(Object other)
      Description copied from class: QtObject
      Used to check if this object shares native resources with the other object if the other object is a subtype of QtJambiInterface. Otherwise it will return the result of calling the super class implementation.
      Overrides:
      equals in class QtObject
      Parameters:
      other - The object with which to compare
      Returns:
      true if the native resources of the two objects are one and the same.
    • hashCode

      @QtUninvokable public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public final Object create()

      Overloaded function for create(Object) with copy = null.

      Returns:
      new instance
    • create

      public final Object create(Object copy)

      Returns a copy of copy, assuming it is of the type that this QMetaType instance was created for.

      If copy is null, creates a default constructed instance.

      See QMetaType::create(int, const void *)

      Parameters:
      copy -
      Returns:
      new instance
    • toString

      @QtUninvokable public final String toString()
      Returns the type name associated with this QMetaType as String.
      Overrides:
      toString in class Object
      Returns:
      type name
    • fromType

      public static QMetaType fromType(Class<?> clazz, QMetaType... instantiations)

      Returns the QMetaType corresponding to the given class.

      If the class has never been registered as meta type UnknownType is returned.

      If given class is generic (e.g. QList, QPair, QMap) specify the template instantiations to be used in the registered template type.

      See QMetaMethod::fromType<T>()

      Parameters:
      clazz - the class to be registered
      instantiations - optional instantiations for generics (templates)
      Returns:
      meta type ID
    • registerMetaType

      public static int registerMetaType(Class<?> clazz, QMetaType... instantiations)

      Registers the given class as meta type. Returns the internal ID used by QMetaType.

      After a type has been registered, you can create and destroy objects of that type dynamically at run-time.

      If given class is generic (e.g. QList, QPair, QMap) specify the template instantiations to be used in the registered template type.

      See qRegisterMetaType<T>()

      Parameters:
      clazz - the class to be registered
      instantiations - optional instantiations for generics (templates)
      Returns:
      meta type ID
    • registerDataStreamOperators

      public static <T> int registerDataStreamOperators(QMetaType.DataStreamInFn<T> datastreamInFn, QMetaType.DataStreamOutFn<T> datastreamOutFn)
      Registers datastream operators for meta type T.
      Parameters:
      datastreamInFn - (only lambda expressions allowed)
      datastreamOutFn - (only lambda expressions allowed)
      Returns:
      the registered meta type
    • registerDebugStreamOperator

      public static <T> int registerDebugStreamOperator(QMetaType.DebugStreamFn<T> debugstreamFn)
      Registers debug stream operator for meta type T.
      Parameters:
      debugstreamFn - (only lambda expressions allowed)
      Returns:
      the registered meta type
    • metaTypeId

      public static int metaTypeId(Class<?> clazz, QMetaType... instantiations)

      Returns the meta type id of goven class at compile time.

      If the class has never been registered as meta type UnknownType is returned.

      If given class is generic (e.g. QList, QPair, QMap) specify the template instantiations to be used in the registered template type.

      See qMetaTypeId<T>()

      Parameters:
      clazz - the class to be registered
      instantiations - optional instantiations for generics (templates)
      Returns:
      meta type ID
    • javaType

      public final Class<?> javaType()
      Returns the Java class for this meta type.
      Returns:
      java class
    • javaType

      public static Class<?> javaType(int metaTypeId)
      Returns the Java class for the given meta type ID.
      Returns:
      java class
    • clone

      public QMetaType clone()
      Overrides:
      clone in class Object