java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.qt.QThreadAffinityException
- All Implemented Interfaces:
Serializable
public class QThreadAffinityException extends RuntimeException
The QThreadAffinityException class is thrown when a QObject is used outside
its own thread.
Each QObject has thread affinity, a thread that it belongs to, which is
accessible through its thread() method. Accessing an object from outside
this thread is forbidden to avoid concurrency problems.
Qt Jambi checks if threading affinity is violated in each member of each QObject subclass. It is
possible to disable this check by setting the VM runtime parameter
io.qt.thread-check
to false
.- See Also:
QObject.thread()
, Serialized Form
-
Constructor Summary
Constructors Constructor Description QThreadAffinityException(String message, QObject object, QThread expectedThread, QThread currentThread)
Creates a new QThreadAffinityException with the given message, object and thread. -
Method Summary
Modifier and Type Method Description QThread
currentThread()
QThread
expectedThread()
QObject
object()
String
toString()
Returns a string representation of this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
QThreadAffinityException
public QThreadAffinityException(String message, QObject object, QThread expectedThread, QThread currentThread)Creates a new QThreadAffinityException with the given message, object and thread.- Parameters:
message
- Describes the affinity exception.object
- The object that was accessed.expectedThread
- The expected thread.currentThread
- The thread from which the access was made.
-
-
Method Details
-
toString
Returns a string representation of this exception. -
object
-
currentThread
-
expectedThread
-