- 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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QMetaType.GenericByteEnumerator
This class represents a QMetaType-registered but Java-unknown 8 Bit enumerator.static class
QMetaType.GenericEnumerator
This class represents a QMetaType-registered but Java-unknown 32 Bit enumerator.static class
QMetaType.GenericFlag
This class represents a QMetaType-registered but Java-unknown enumerator type which can be used in QFlags.static class
QMetaType.GenericFlags
This class represents a QMetaType-registered but Java-unknown QFlags type.static class
QMetaType.GenericGadget
This class represents a QMetaType-registered but Java-unknown gadget type.static class
QMetaType.GenericLongEnumerator
This class represents a QMetaType-registered but Java-unknown 64 Bit enumerator.static class
QMetaType.GenericObject
This class represents a QMetaType-registered but Java-unknown object type.static class
QMetaType.GenericShortEnumerator
This class represents a QMetaType-registered but Java-unknown 16 Bit enumerator.static interface
QMetaType.GenericTypeInterface
Interface super type for all generic classes representing a QMetaType-registered but Java-unknown value type.static class
QMetaType.GenericValue
This class represents a QMetaType-registered but Java-unknown value type.static class
QMetaType.Type
Java wrapper for Qt enum QMetaType::Typestatic class
QMetaType.TypeFlag
Java wrapper for Qt enum QMetaType::TypeFlagstatic class
QMetaType.TypeFlags
QFlags type for enumQMetaType.TypeFlag
-
Constructor Summary
Constructors Modifier Constructor Description QMetaType()
QMetaType(int type)
QMetaType(QMetaType.Type type)
Overloaded constructor forQMetaType(int)
.protected
QMetaType(QtObject.QPrivateConstructor p)
Constructor for internal use only. -
Method Summary
Modifier and Type Method Description long
alignOf()
static boolean
canConvert(QMetaType fromType, QMetaType toType)
static boolean
canView(QMetaType fromType, QMetaType toType)
QMetaType
clone()
Object
create()
Overloaded function forcreate(Object)
withcopy = null
.Object
create(Object copy)
Returns a copy of copy, assuming it is of the type that thisQMetaType
instance was created for.boolean
equals(Object other)
Used to check if this object shares native resources with the other object if the other object is a subtype of QtJambiInterface.QMetaType.TypeFlags
flags()
static QMetaType
fromName(byte[] name)
static QMetaType
fromName(QByteArray name)
static QMetaType
fromName(QByteArrayView name)
static QMetaType
fromName(String name)
static QMetaType
fromType(Class<?> clazz, QMetaType... instantiations)
Returns theQMetaType
corresponding to the given class.int
hashCode()
int
id()
boolean
isEqualityComparable()
boolean
isOrdered()
boolean
isRegistered()
static boolean
isRegistered(int type)
boolean
isValid()
Class<?>
javaType()
Returns the Java class for this meta type.static Class<?>
javaType(int metaTypeId)
Returns the Java class for the given meta type ID.QMetaObject
metaObject()
static QMetaObject
metaObjectForType(int type)
Deprecated.static int
metaTypeId(Class<?> clazz, QMetaType... instantiations)
Returns the meta type id of goven class at compile time.String
name()
static int
registerMetaType(Class<?> clazz, QMetaType... instantiations)
Registers the given class as meta type.long
sizeOf()
static int
sizeOf(int type)
Deprecated.String
toString()
Returns the type name associated with thisQMetaType
asString
.static int
type(QByteArray typeName)
Deprecated.static int
type(String typeName)
Deprecated.static QMetaType.TypeFlags
typeFlags(int type)
Deprecated.static String
typeName(int type)
Deprecated.static void
unregisterMetaType(QMetaType type)
-
Constructor Details
-
QMetaType
public QMetaType() -
QMetaType
public QMetaType(int type) -
QMetaType
Constructor for internal use only.- Parameters:
p
- expected to benull
.
-
QMetaType
Overloaded constructor forQMetaType(int)
.- Parameters:
type
-
-
-
Method Details
-
alignOf
-
flags
-
id
-
isEqualityComparable
-
isOrdered
-
isRegistered
-
isValid
-
metaObject
-
name
-
sizeOf
-
canConvert
-
canView
-
fromName
-
isRegistered
public static boolean isRegistered(int type) -
metaObjectForType
Deprecated. -
sizeOf
Deprecated. -
type
Deprecated. -
type
Deprecated. -
typeFlags
Deprecated. -
typeName
Deprecated. -
unregisterMetaType
-
equals
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. -
hashCode
-
create
Overloaded function for
create(Object)
withcopy = null
.- Returns:
- new instance
-
create
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.- Parameters:
copy
-- Returns:
- new instance
-
toString
Returns the type name associated with thisQMetaType
asString
. -
fromType
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.- Parameters:
clazz
- the class to be registeredinstantiations
- optional instantiations for generics (templates)- Returns:
- meta type ID
-
registerMetaType
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.- Parameters:
clazz
- the class to be registeredinstantiations
- optional instantiations for generics (templates)- Returns:
- meta type ID
-
metaTypeId
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 registeredinstantiations
- optional instantiations for generics (templates)- Returns:
- meta type ID
-
javaType
Returns the Java class for this meta type.- Returns:
- java class
-
javaType
Returns the Java class for the given meta type ID.- Returns:
- java class
-
fromName
-
fromName
-
fromName
-
clone
-