Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QRunnable Class Referenceabstract

The QRunnable class is the base class for all runnable objects. More...

Inheritance diagram for QtCore.QRunnable:
Collaboration diagram for QtCore.QRunnable:

Public Member Functions

 QRunnable ()
 
 
 QRunnable (QRunnable copy)
 
 
virtual void CreateProxy ()
 
abstract void Run ()
 
 
new void Dispose ()
 

Protected Member Functions

 QRunnable (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new bool AutoDelete [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QRunnable class is the base class for all runnable objects.

The QRunnable class is an interface for representing a task or piece of code that needs to be executed, represented by your reimplementation of the run() function.

You can use QThreadPool to execute your code in a separate thread. QThreadPool deletes the QRunnable automatically if autoDelete() returns true (the default). Use setAutoDelete() to change the auto-deletion flag.

QThreadPool supports executing the same QRunnable more than once by calling QThreadPool::tryStart(this) from within the run() function. If autoDelete is enabled the QRunnable will be deleted when the last thread exits the run function. Calling QThreadPool::start() multiple times with the same QRunnable when autoDelete is enabled creates a race condition and is not recommended.

See also QThreadPool.

Constructor & Destructor Documentation

QtCore.QRunnable.QRunnable ( System.Type  dummy)
protected
QtCore.QRunnable.QRunnable ( )

Constructs a QRunnable. Auto-deletion is enabled by default.

See also autoDelete() and setAutoDelete().

QtCore.QRunnable.QRunnable ( QRunnable  copy)

Constructs a QRunnable. Auto-deletion is enabled by default.

See also autoDelete() and setAutoDelete().

Member Function Documentation

virtual void QtCore.QRunnable.CreateProxy ( )
virtual
new void QtCore.QRunnable.Dispose ( )
abstract void QtCore.QRunnable.Run ( )
pure virtual

Implement this pure virtual function in your subclass.

Member Data Documentation

SmokeInvocation QtCore.QRunnable.interceptor
protected

Property Documentation

new bool QtCore.QRunnable.AutoDelete
getset

Returns true is auto-deletion is enabled; false otherwise.

If auto-deletion is enabled, QThreadPool will automatically delete this runnable after calling run(); otherwise, ownership remains with the application programmer.

Enables auto-deletion if autoDelete is true; otherwise auto-deletion is disabled.

If auto-deletion is enabled, QThreadPool will automatically delete this runnable after calling run(); otherwise, ownership remains with the application programmer.

Note that this flag must be set before calling QThreadPool::start(). Calling this function after QThreadPool::start() results in undefined behavior.

virtual System.IntPtr QtCore.QRunnable.SmokeObject
getset