Skip to content

PythonQt.QtCore.QThreadPool · declarations 001

Back to PythonQt.QtCore.QThreadPool

activeThreadCount instance-attribute

activeThreadCount: int

Qt 5 reference:

activeThreadCount : const int

This property represents the number of active threads in the thread pool.

Note: It is possible for this function to return a value that is greater than maxThreadCount(). See reserveThread() for more details.

Access functions:

int activeThreadCount() const

See also reserveThread() and releaseThread().

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#activeThreadCount

cancel

cancel(runnable: Any) -> None

X.cancel(runnable)

Upstream PySide2 reference signatures (binding differences may apply):

cancel(self, runnable: PySide2.QtCore.QRunnable) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#cancel

clear

clear() -> None

X.clear()

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#clear

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtCore.QThreadPool.destroyed; argument details are not documented.

expiryTimeout instance-attribute

expiryTimeout: int

Qt 5 reference:

expiryTimeout : int

Threads that are unused for expiryTimeout milliseconds are considered to have expired and will exit. Such threads will be restarted as needed. The default expiryTimeout is 30000 milliseconds (30 seconds). If expiryTimeout is negative, newly created threads will not expire, e.g., they will not exit until the thread pool is destroyed.

Note that setting expiryTimeout has no effect on already running threads. Only newly created threads will use the new expiryTimeout. We recommend setting the expiryTimeout immediately after creating the thread pool, but before calling start().

Access functions:

int expiryTimeout() const
void setExpiryTimeout(int expiryTimeout)

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#expiryTimeout

globalInstance

globalInstance() -> Any

X.globalInstance() -> PythonQt.QtCore.QThreadPool

Supplemental documentation: Qt 5 reference:

[static] QThreadPool *QThreadPool::globalInstance()

Returns the global QThreadPool instance.

Upstream PySide2 reference signatures (binding differences may apply):

globalInstance() -> PySide2.QtCore.QThreadPool

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#globalInstance

maxThreadCount instance-attribute

maxThreadCount: int

Qt 5 reference:

maxThreadCount : int

This property represents the maximum number of threads used by the thread pool.

Note: The thread pool will always use at least 1 thread, even if maxThreadCount limit is zero or negative.

The default maxThreadCount is QThread::idealThreadCount().

Access functions:

int maxThreadCount() const
void setMaxThreadCount(int maxThreadCount)

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#maxThreadCount

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtCore.QThreadPool.objectNameChanged; argument details are not documented.

releaseThread

releaseThread() -> None

X.releaseThread()

Upstream PySide2 reference signatures (binding differences may apply):

releaseThread(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#releaseThread

reserveThread

reserveThread() -> None

X.reserveThread()

Upstream PySide2 reference signatures (binding differences may apply):

reserveThread(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#reserveThread

setExpiryTimeout

setExpiryTimeout(expiryTimeout: int) -> None

X.setExpiryTimeout(expiryTimeout)

Upstream PySide2 reference signatures (binding differences may apply):

setExpiryTimeout(self, expiryTimeout: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#setExpiryTimeout

setMaxThreadCount

setMaxThreadCount(maxThreadCount: int) -> None

X.setMaxThreadCount(maxThreadCount)

Upstream PySide2 reference signatures (binding differences may apply):

setMaxThreadCount(self, maxThreadCount: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#setMaxThreadCount

stackSize instance-attribute

stackSize: int

Qt 5 reference:

stackSize : uint

This property contains the stack size for the thread pool worker threads.

The value of the property is only used when the thread pool creates new threads. Changing it has no effect for already created or running threads.

The default value is 0, which makes QThread use the operating system default stack size.

This property was introduced in Qt 5.10.

Access functions:

uint stackSize() const
void setStackSize(uint stackSize)

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#stackSize

start

start(runnable: Any, priority: int) -> None

X.start(runnable, priority)

Supplemental documentation: Qt 5 reference:

void QThreadPool::start(QRunnable *runnable, int priority \= 0)

Reserves a thread and uses it to run runnable, unless this thread will make the current thread count exceed maxThreadCount(). In that case, runnable is added to a run queue instead. The priority argument can be used to control the run queue's order of execution.

Note that the thread pool takes ownership of the runnable if runnable->autoDelete() returns true, and the runnable will be deleted automatically by the thread pool after the runnable->run() returns. If runnable->autoDelete() returns false, ownership of runnable remains with the caller. Note that changing the auto-deletion on runnable after calling this functions results in undefined behavior.

Upstream PySide2 reference signatures (binding differences may apply):

start(self, runnable: PySide2.QtCore.QRunnable, priority: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#start

tryStart

tryStart(runnable: Any) -> bool

X.tryStart(runnable) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

tryStart(self, runnable: PySide2.QtCore.QRunnable) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#tryStart

waitForDone

waitForDone(msecs: int) -> bool

X.waitForDone(msecs) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

waitForDone(self, msecs: int=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qthreadpool.html#waitForDone