java.lang.Object
io.qt.internal.QtJambiInternal
public final class QtJambiInternal extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
QtJambiInternal.Cleanable
static class
QtJambiInternal.LambdaInfo
static class
QtJambiInternal.Monitor
static class
QtJambiInternal.Ownership
static class
QtJambiInternal.RCList
static class
QtJambiInternal.RCMap
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<QtSignalEmitterInterface>
currentSender
static char
SignalPrefix
static char
SlotPrefix
-
Method Summary
Modifier and Type Method Description static void
addAllReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Collection<?> values)
static void
addReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object value)
static Boolean
areObjectsEquals(QtJambiObject object, Object other)
static QFlags<?>
asFlags(QtFlagEnumerator flag, Function<Integer,QFlags<?>> constructor)
static Supplier<Class<?>>
callerClassProvider()
static long
checkedNativeId(QtJambiObject object)
static long
checkedNativeId(QtObjectInterface object)
static void
clearReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic)
static void
connectSlotsByName(QObject object)
static void
constructorThreadCheck(QCoreApplication obj)
static void
constructorThreadCheck(QObject obj)
static void
constructorThreadCheck(QObject obj, QObject parent)
static void
constructorThreadCheck(QWindow obj)
static void
constructorThreadCheck(QWindow obj, QObject parent)
static void
constructorThreadCheck(QWidget obj)
static void
constructorThreadCheck(QWidget obj, QObject parent)
static void
constructorUIThreadCheck(QObject obj)
static void
constructorUIThreadCheck(QPixmap obj)
static int
countEventLoops(long thread)
static int
countEventLoops(QThread thread)
static void
countExpense(Class<?> cl, int cost, int limit)
static String
cppNormalizedSignature(String signalName)
static QByteArray
cppSignalSignature(QByteArray signal)
static String
cppSignalSignature(QMetaObject.AbstractSignal signal)
static String
cppSignalSignature(QtSignalEmitterInterface signalEmitter, String signalName)
static String
cppSlotSignature(Object receiver, String slot)
static String
cppSlotSignature(String slot)
static boolean
disconnect(QMetaObject.Connection connection)
static boolean
disconnectAll(QtSignalEmitterInterface sender, Object receiver)
Disconnect all connections made from the given object to a specific object.static void
disposedCheck(QtObject obj)
static void
disposedCheck(QtObjectInterface obj)
static void
disposeObject(QtJambiObject object)
static void
disposeObject(QtObjectInterface object)
static <V> V
fetchField(Object owner, Class<?> declaringClass, String fieldName, Class<V> fieldType)
static Object
fetchFieldNative(Object owner, Field field)
static Class<?>
findGeneratedSuperclass(Class<?> clazz)
Returns the closest superclass ofobj's
class which is a generated class, or null if no such class is found.static void
findPlugins()
static void
findPlugins(String location)
static QMetaObject.AbstractSignal
findSignal(QtSignalEmitterInterface sender, String name, Class<?>... types)
static <T extends QtFlagEnumerator>
T[]flagConstants(QFlags<T> flags)
static MethodHandle
getConstructorHandle(Constructor<?> constructor)
static <T> Class<T>
getFactoryClass(QMetaObject.Method1<T,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method2<T,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method3<T,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method4<T,?,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method5<T,?,?,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method6<T,?,?,?,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method7<T,?,?,?,?,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method8<T,?,?,?,?,?,?,?,?> method)
static <T> Class<T>
getFactoryClass(QMetaObject.Method9<T,?,?,?,?,?,?,?,?,?> method)
static String
getInterfaceIID(Class<?> cls)
static MethodHandle
getMethodHandle(Method method)
static <R> Class<R>
getReturnType(QMetaObject.Method1<?,R> method)
static QMetaObject.DisposedSignal
getSignalOnDispose(QtObjectInterface object, boolean forceCreation)
Emitted either as the native resources that belong to the object are being cleaned up or directly before the object is finalized.static boolean
hasOwnerFunction(QtObjectInterface object)
static void
initializeInterface(QtObjectInterface iface)
static void
initializeNativeObject(QtObjectInterface object, Map<Class<?>,List<?>> arguments)
static boolean
initializePackage(Class<?> cls)
static boolean
initializePackage(Package pkg)
static boolean
initializePackage(String packagePath)
static String
internalNameOfArgumentType(Class<? extends Object> cls)
static void
invalidateObject(QtObject object)
static void
invalidateObject(QtObjectInterface object)
static Object
invokeMethod(Method method, Object object, Object... args)
static boolean
isAvailableLibrary(String qtprefix, String library, String libInfix, String version)
static boolean
isAvailableQtLibrary(String library)
static boolean
isObjectDisposed(QtJambiObject object)
static boolean
isObjectDisposed(QtObjectInterface object)
static boolean
isQtPatched()
static boolean
isSharedPointer(QtObjectInterface object)
static boolean
isSignalType(Class<?> cl)
Returns true if the class cl represents a Signal.static boolean
isSmallEnum(QtFlagEnumerator enm)
static File
jambiTempDir()
static QObject
lambdaContext(Serializable slotObject)
static QtJambiInternal.LambdaInfo
lamdaInfo(Serializable slotObject)
static void
loadJambiLibrary(Class<?> callerClass, String prefix, String library)
static void
loadLibrary(String lib)
static void
loadQtJambiLibrary(Class<?> callerClass, String library)
static void
loadQtLibrary(String library)
static void
loadUtilityLibrary(String library, String version)
static int
metaTypeId(Class<?> clazz)
static long
nativeId(QtJambiObject object)
Internal function which fetches the native id of the current object.static long
nativeId(QtObjectInterface object)
Internal function which fetches the native id of the current object.static int
objectMetaTypeId(Object o)
static QObject
owner(QtObjectInterface object)
static QtJambiInternal.Ownership
ownership(QtObject object)
static QtJambiInternal.Ownership
ownership(QtObjectInterface object)
static byte
primitiveToByte(Class<?> primitiveType)
static void
putReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object key, Object value)
static Class<? extends QtObjectInterface>
qRegisteredPluginInterface(long iid)
static Class<? extends QtObjectInterface>
qRegisteredPluginInterface(QByteArray iid)
static void
qRegisterPluginInterface(Class<? extends QtObjectInterface> iface)
static void
qRegisterStaticPluginFunction(QObject instance, QJsonObject metaData)
static void
qRegisterStaticPluginFunction(Class<? extends QObject> pluginClass, QJsonObject metaData)
static QtObjectInterface
reassignNativeResources(QtObjectInterface object, Class<? extends QtObjectInterface> clazz)
In certain, uncommon cases, the native resources of a QtJambiObject object may be out of sync with its class.static QtJambiInternal.Cleanable
registerCleaner(Object obj, Runnable action)
static void
registerDependentObject(QtObjectInterface dependentObject, QtObject owner)
static void
registerDependentObject(QtObjectInterface dependentObject, QtObjectInterface owner)
static void
registerDependentObject(QtObject dependentObject, QtObject owner)
static void
registerDependentObject(QtObject dependentObject, QtObjectInterface owner)
static int
registerMetaType(Class<?> clazz)
static void
removeFromCollectionReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic, Object value)
static void
removeFromMapReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic, Object value)
static int[]
resolveConversionSchema(Class<?>[] inputParameterTypes, Class<?>[] outputParameterTypes)
static <E extends Enum<E> & QtByteEnumerator>
EresolveEnum(Class<E> cl, byte value)
static <E extends Enum<E> & QtByteEnumerator>
EresolveEnum(Class<E> cl, byte value, String name)
static <E extends Enum<E> & QtEnumerator>
EresolveEnum(Class<E> cl, int value)
static <E extends Enum<E> & QtEnumerator>
EresolveEnum(Class<E> cl, int value, String name)
static <E extends Enum<E> & QtLongEnumerator>
EresolveEnum(Class<E> cl, long value)
static <E extends Enum<E> & QtLongEnumerator>
EresolveEnum(Class<E> cl, long value, String name)
static <E extends Enum<E> & QtShortEnumerator>
EresolveEnum(Class<E> cl, short value)
static <E extends Enum<E> & QtShortEnumerator>
EresolveEnum(Class<E> cl, short value, String name)
static SerializedLambda
serializeLambdaExpression(Serializable slotObject)
static void
setCppOwnership(QtObject object)
This is an internal function.static void
setCppOwnership(QtObjectInterface object)
This is an internal function.static void
setDefaultOwnership(QtObject object)
This is an internal function.static void
setDefaultOwnership(QtObjectInterface object)
This is an internal function.static void
setField(Object owner, Class<?> declaringClass, String fieldName, Object newValue)
static boolean
setFieldNative(Object owner, Field field, Object newValue)
static void
setJavaOwnership(QtObject object)
This is an internal function.static void
setJavaOwnership(QtObjectInterface object)
This is an internal function.static void
setReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean threadSafe, boolean isStatic, Object newValue)
static void
setReferenceCount(Thread owner, Class<? extends QThread> declaringClass, String fieldName, boolean threadSafe, boolean isStatic, Object newValue)
Deprecated.static void
shutdown()
static Class<?>
signalDeclaringClass(QMetaObject.AbstractSignal signal)
static QtJambiInternal.Monitor
synchronizedNativeId(QtObjectInterface object)
static void
threadCheck(QObject obj)
static void
threadCheck(QObject obj, String message)
static long
threadCheckedNativeId(QObject obj)
static boolean
tryIsObjectDisposed(QtObjectInterface object)
static byte
typeConversionCode(Class<?> cls)
static void
uiThreadCheck(Object obj)
static void
unregisterDependentObject(QtObjectInterface dependentObject, QtObject owner)
static void
unregisterDependentObject(QtObjectInterface dependentObject, QtObjectInterface owner)
static void
unregisterDependentObject(QtObject dependentObject, QtObject owner)
static void
unregisterDependentObject(QtObject dependentObject, QtObjectInterface owner)
-
Field Details
-
SlotPrefix
public static final char SlotPrefix- See Also:
- Constant Field Values
-
SignalPrefix
public static final char SignalPrefix- See Also:
- Constant Field Values
-
currentSender
-
-
Method Details
-
shutdown
public static void shutdown() -
registerCleaner
-
resolveConversionSchema
-
typeConversionCode
-
primitiveToByte
-
serializeLambdaExpression
-
getConstructorHandle
public static MethodHandle getConstructorHandle(Constructor<?> constructor) throws IllegalAccessException- Throws:
IllegalAccessException
-
getMethodHandle
- Throws:
IllegalAccessException
-
invokeMethod
- Throws:
Throwable
-
isSignalType
Returns true if the class cl represents a Signal.- Parameters:
cl
- The class to check- Returns:
- True if the class is a signal
-
resolveEnum
public static <E extends Enum<E> & QtEnumerator> E resolveEnum(Class<E> cl, int value) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtEnumerator> E resolveEnum(Class<E> cl, int value, String name) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtByteEnumerator> E resolveEnum(Class<E> cl, byte value) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtByteEnumerator> E resolveEnum(Class<E> cl, byte value, String name) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtShortEnumerator> E resolveEnum(Class<E> cl, short value) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtShortEnumerator> E resolveEnum(Class<E> cl, short value, String name) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtLongEnumerator> E resolveEnum(Class<E> cl, long value) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
resolveEnum
public static <E extends Enum<E> & QtLongEnumerator> E resolveEnum(Class<E> cl, long value, String name) throws QNoSuchEnumValueException- Throws:
QNoSuchEnumValueException
-
countExpense
-
setReferenceCount
@Deprecated public static void setReferenceCount(Thread owner, Class<? extends QThread> declaringClass, String fieldName, boolean threadSafe, boolean isStatic, Object newValue)Deprecated. -
setReferenceCount
public static void setReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean threadSafe, boolean isStatic, Object newValue) -
setField
-
setFieldNative
-
fetchField
-
clearReferenceCount
public static void clearReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic) -
addReferenceCount
public static void addReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object value) -
removeFromMapReferenceCount
public static void removeFromMapReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic, Object value) -
removeFromCollectionReferenceCount
public static void removeFromCollectionReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isStatic, Object value) -
addAllReferenceCount
public static void addAllReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Collection<?> values) -
putReferenceCount
public static void putReferenceCount(QtObjectInterface owner, Class<? extends QtObjectInterface> declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object key, Object value) -
fetchFieldNative
-
connectSlotsByName
-
findGeneratedSuperclass
Returns the closest superclass ofobj's
class which is a generated class, or null if no such class is found. -
synchronizedNativeId
-
reassignNativeResources
public static QtObjectInterface reassignNativeResources(QtObjectInterface object, Class<? extends QtObjectInterface> clazz) throws InstantiationExceptionIn certain, uncommon cases, the native resources of a QtJambiObject object may be out of sync with its class. In such cases this method can be used to reassign the native resources to an object of another class. Take special care when using this method, as it has limited type safety and may cause crashes when used in the wrong way. Note also that as the returned object "steals" the native resources held by the original object, the original object will not be usable after a call to this function. Invoking a method on the original object may result in an exception being raised. If an exception is raised, it is safe to assume that the original object is still valid. If the object is already of the type specified by clazz, then a reference to the object itself is returned.- Parameters:
object
- The original object which holds the native resources. This object will be considered unusable after the call.clazz
- The class of the new object. The class must be a subclass of QtJambiObject and you must not rely on any constructors being invoked upon construction of the object.- Returns:
- An object of the specified type which owns the resources previously held by object.
- Throws:
ClassCastException
- If the class of object is unrelated to clazz, or if clazz is an unsupported class type.InstantiationException
- If clazz cannot be instantiated
-
nativeId
Internal function which fetches the native id of the current object.- Returns:
- A long value which uniquely define the native resources held by this object during their life time.
-
checkedNativeId
-
checkedNativeId
-
nativeId
Internal function which fetches the native id of the current object.- Returns:
- A long value which uniquely define the native resources held by this object during their life time.
-
setCppOwnership
This is an internal function. Calling it can have unexpected results. Disables garbage collection for this object. This should be used when objects created in java are passed to C++ functions that take ownership of the objects. Both the Java and C++ part of the object will then be cleaned up by C++. -
setJavaOwnership
This is an internal function. Calling it can have unexpected results. Forces Java ownership of both the Java object and its C++ resources. The C++ resources will be cleaned up when the Java object is finalized. -
setDefaultOwnership
This is an internal function. Calling it can have unexpected results. Reenables garbage collection for this object. Should be used on objects for which disableGarbageCollection() has previously been called. After calling this function, the object ownership will be reset to default. -
setCppOwnership
This is an internal function. Calling it can have unexpected results. Disables garbage collection for this object. This should be used when objects created in java are passed to C++ functions that take ownership of the objects. Both the Java and C++ part of the object will then be cleaned up by C++. -
setJavaOwnership
This is an internal function. Calling it can have unexpected results. Forces Java ownership of both the Java object and its C++ resources. The C++ resources will be cleaned up when the Java object is finalized. -
setDefaultOwnership
This is an internal function. Calling it can have unexpected results. Reenables garbage collection for this object. Should be used on objects for which disableGarbageCollection() has previously been called. After calling this function, the object ownership will be reset to default. -
invalidateObject
-
invalidateObject
-
ownership
-
ownership
-
owner
-
hasOwnerFunction
-
getSignalOnDispose
public static QMetaObject.DisposedSignal getSignalOnDispose(QtObjectInterface object, boolean forceCreation)Emitted either as the native resources that belong to the object are being cleaned up or directly before the object is finalized. Connect to this signal to do clean up when the object is destroyed. The signal will never be emitted more than once per object, and the object is guaranteed to be unusable after this signal has returned. -
findSignal
public static QMetaObject.AbstractSignal findSignal(QtSignalEmitterInterface sender, String name, Class<?>... types) -
disconnectAll
Disconnect all connections made from the given object to a specific object.- Parameters:
sender
- The sender to disconnect from receiverreceiver
- The receiver to disconnect, or null to disconnect all receivers
-
disconnect
-
initializePackage
-
initializePackage
-
initializePackage
-
lamdaInfo
-
lambdaContext
-
constructorThreadCheck
-
constructorUIThreadCheck
-
constructorUIThreadCheck
-
uiThreadCheck
-
constructorThreadCheck
-
constructorThreadCheck
-
constructorThreadCheck
-
constructorThreadCheck
-
constructorThreadCheck
-
constructorThreadCheck
-
threadCheckedNativeId
-
threadCheck
-
threadCheck
-
disposedCheck
-
disposedCheck
-
signalDeclaringClass
-
initializeInterface
-
disposeObject
-
isObjectDisposed
-
tryIsObjectDisposed
-
disposeObject
-
isObjectDisposed
-
areObjectsEquals
-
registerMetaType
-
metaTypeId
-
objectMetaTypeId
-
initializeNativeObject
public static void initializeNativeObject(QtObjectInterface object, Map<Class<?>,List<?>> arguments) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
isQtPatched
public static boolean isQtPatched() -
registerDependentObject
public static void registerDependentObject(QtObjectInterface dependentObject, QtObjectInterface owner) -
registerDependentObject
-
registerDependentObject
-
registerDependentObject
-
unregisterDependentObject
public static void unregisterDependentObject(QtObjectInterface dependentObject, QtObjectInterface owner) -
unregisterDependentObject
-
unregisterDependentObject
-
unregisterDependentObject
-
isSharedPointer
-
qRegisterPluginInterface
-
qRegisteredPluginInterface
-
qRegisteredPluginInterface
-
qRegisterStaticPluginFunction
-
qRegisterStaticPluginFunction
public static void qRegisterStaticPluginFunction(Class<? extends QObject> pluginClass, QJsonObject metaData) -
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
-
getFactoryClass
public static <T> Class<T> getFactoryClass(QMetaObject.Method9<T,?,?,?,?,?,?,?,?,?> method) -
getReturnType
-
findPlugins
-
findPlugins
public static void findPlugins() -
countEventLoops
-
countEventLoops
public static int countEventLoops(long thread) -
asFlags
-
isSmallEnum
-
flagConstants
-
callerClassProvider
-
getInterfaceIID
-
cppSlotSignature
-
cppSlotSignature
-
cppSignalSignature
-
cppSignalSignature
-
cppNormalizedSignature
-
internalNameOfArgumentType
-
cppSignalSignature
-
isAvailableQtLibrary
-
isAvailableLibrary
-
loadQtLibrary
-
loadUtilityLibrary
-
loadLibrary
-
jambiTempDir
-
loadQtJambiLibrary
-
loadJambiLibrary
-