File: qrunnable.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (28 lines) | stat: -rw-r--r-- 5,504 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QRunnable Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QRunnable Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QRunnable class is the base class for all runnable objects. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qrunnable.html#QRunnable">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrunnable.html#QRunnable-2">__init__</a></b> (<i>self</i>, QRunnable)</li><li><div class="fn" />bool <b><a href="qrunnable.html#autoDelete">autoDelete</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrunnable.html#run">run</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrunnable.html#setAutoDelete">setAutoDelete</a></b> (<i>self</i>, bool)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QRunnable class is the base class for all runnable objects.</p>
<p>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 <a href="qrunnable.html#run">run</a>() function.</p>
<p>You can use <a href="qthreadpool.html">QThreadPool</a> to execute your code in a separate thread. <a href="qthreadpool.html">QThreadPool</a> deletes the QRunnable automatically if <a href="qrunnable.html#autoDelete">autoDelete</a>() returns true (the default). Use <a href="qrunnable.html#setAutoDelete">setAutoDelete</a>() to change the auto-deletion flag.</p>
<p><a href="qthreadpool.html">QThreadPool</a> supports executing the same QRunnable more than once by calling QThreadPool.tryStart(this) from within the <a href="qrunnable.html#run">run</a>() function. If autoDelete is enabled the QRunnable will be deleted when the last thread exits the run function. Calling <a href="qthreadpool.html#start">QThreadPool.start</a>() multiple times with the same QRunnable when autoDelete is enabled creates a race condition and is not recommended.</p>
<p>See also <a href="qthreadpool.html">QThreadPool</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QRunnable" />QRunnable.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qrunnable.html">QRunnable</a>. Auto-deletion is enabled by default.</p>
<p>See also <a href="qrunnable.html#autoDelete">autoDelete</a>() and <a href="qrunnable.html#setAutoDelete">setAutoDelete</a>().</p>
<a name="//apple_ref/cpp/instm/QRunnable/~QRunnable" />
<h3 class="fn"><a name="QRunnable-2" />QRunnable.__init__ (<i>self</i>, <a href="qrunnable.html">QRunnable</a>)</h3><h3 class="fn"><a name="autoDelete" />bool QRunnable.autoDelete (<i>self</i>)</h3><p>Returns true is auto-deletion is enabled; false otherwise.</p>
<p>If auto-deletion is enabled, <a href="qthreadpool.html">QThreadPool</a> will automatically delete this runnable after calling <a href="qrunnable.html#run">run</a>(); otherwise, ownership remains with the application programmer.</p>
<p>See also <a href="qrunnable.html#setAutoDelete">setAutoDelete</a>() and <a href="qthreadpool.html">QThreadPool</a>.</p>
<a name="//apple_ref/cpp/instm/QRunnable/run" />
<h3 class="fn"><a name="run" />QRunnable.run (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Implement this pure virtual function in your subclass.</p>
<a name="//apple_ref/cpp/instm/QRunnable/setAutoDelete" />
<h3 class="fn"><a name="setAutoDelete" />QRunnable.setAutoDelete (<i>self</i>, bool)</h3><p>Enables auto-deletion if <i>autoDelete</i> is true; otherwise auto-deletion is disabled.</p>
<p>If auto-deletion is enabled, <a href="qthreadpool.html">QThreadPool</a> will automatically delete this runnable after calling <a href="qrunnable.html#run">run</a>(); otherwise, ownership remains with the application programmer.</p>
<p>Note that this flag must be set before calling <a href="qthreadpool.html#start">QThreadPool.start</a>(). Calling this function after <a href="qthreadpool.html#start">QThreadPool.start</a>() results in undefined behavior.</p>
<p>See also <a href="qrunnable.html#autoDelete">autoDelete</a>() and <a href="qthreadpool.html">QThreadPool</a>.</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>