<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Le 25/09/10 18:55, Massimo Di Stefano a écrit :
<blockquote cite="mid:726562D8-051E-488F-99E8-BC5E004E1007@gmail.com"
type="cite"><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;">
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;">Hello
All</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;">i'm
tring to learn how to use Qthreads inside my app, so i wrote this
example :</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;">(it
print out the text from the lineEdit widget, at any "text-changes")</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentkn" style="color: rgb(0, 128, 0); font-weight: bold;"><br>
</span></span></div>
<div><br>
</div>
import</span><span class="pygment"> </span><span class="pygmentnn"
style="color: rgb(0, 0, 255); font-weight: bold;">sys</span><span
class="pygment"></span><br>
<span class="pygmentkn"
style="color: rgb(0, 128, 0); font-weight: bold;">from</span><span
class="pygment"> </span><span class="pygmentnn"
style="color: rgb(0, 0, 255); font-weight: bold;">PyQt4</span><span
class="pygment"> </span><span class="pygmentkn"
style="color: rgb(0, 128, 0); font-weight: bold;">import</span><span
class="pygment"> </span><span class="pygmentn">QtCore</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygment"></span><br>
<span class="pygmentkn"
style="color: rgb(0, 128, 0); font-weight: bold;">import</span><span
class="pygment"> </span><span class="pygmentnn"
style="color: rgb(0, 0, 255); font-weight: bold;">time</span><span
class="pygment"></span><br>
<br>
<span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">class</span><span
class="pygment"> </span><span class="pygmentnc"
style="color: rgb(0, 0, 255); font-weight: bold;">Gui</span><span
class="pygmentp">(</span><span class="pygmentn">QtGui</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">QWidget</span><span class="pygmentp">):</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">__init__</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">parent</span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">None</span><span class="pygmentp">):</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">QtGui</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">QGroupBox</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">__init__</span><span
class="pygmentp">(</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmentp">,</span><span
class="pygment"> </span><span class="pygmentn">parent</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">gcenter</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">QPushButton</span><span
class="pygmentp">(</span><span class="pygments"
style="color: rgb(186, 33, 33);">"X"</span><span class="pygmentp">,</span><span
class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">textout</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">QLineEdit</span><span
class="pygmentp">(</span><span class="pygments"
style="color: rgb(186, 33, 33);">"default"</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">textout2</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">QLineEdit</span><span
class="pygmentp">(</span><span class="pygments"
style="color: rgb(186, 33, 33);">""</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">guiLayout</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">QGridLayout</span><span
class="pygmentp">()</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">guiLayout</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">addWidget</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">gcenter</span><span class="pygmentp">,</span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">1</span><span
class="pygmentp">,</span><span class="pygmentmi"
style="color: rgb(102, 102, 102);">0</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">guiLayout</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">addWidget</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">textout</span><span class="pygmentp">,</span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">1</span><span
class="pygmentp">,</span><span class="pygmentmi"
style="color: rgb(102, 102, 102);">1</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">setLayout</span><span
class="pygmentp">(</span><span class="pygmentn">guiLayout</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">thread</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">logJ</span><span class="pygmentp">()</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">thread</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">start</span><span class="pygmentp">()</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">connect</span><span
class="pygmentp">(</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">gcenter</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">QtCore</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">SIGNAL</span><span
class="pygmentp">(</span><span class="pygments"
style="color: rgb(186, 33, 33);">"clicked()"</span><span
class="pygmentp">),</span><span class="pygment"> </span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">thread</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">toggle</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">connect</span><span
class="pygmentp">(</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">textout</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">QtCore</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">SIGNAL</span><span
class="pygmentp">(</span><span class="pygments"
style="color: rgb(186, 33, 33);">"textChanged(QString)"</span><span
class="pygmentp">),</span><span class="pygment"> </span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">thread</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">setValue</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">class</span><span
class="pygment"> </span><span class="pygmentnc"
style="color: rgb(0, 0, 255); font-weight: bold;">logJ</span><span
class="pygmentp">(</span><span class="pygmentn">QtCore</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">QThread</span><span class="pygmentp">):</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">__init__</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">parent</span><span class="pygment"> </span><span
class="pygmento" style="color: rgb(102, 102, 102);">=</span><span
class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">None</span><span class="pygmentp">):</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">QtCore</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">QThread</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">__init__</span><span
class="pygmentp">(</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmentp">,</span><span
class="pygment"> </span><span class="pygmentn">parent</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">value</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">alive</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">1</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span><span
class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">run</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">):</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">while</span><span
class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">alive</span><span
class="pygmentp">:</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">while</span><span
class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygmentp">:</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">try</span><span
class="pygment"> </span><span class="pygmentp">:</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">a</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">aggiorna</span><span class="pygmentp">()</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentc"
style="color: rgb(64, 128, 128); font-style: italic;">#startj(0,0)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">print</span><span
class="pygment"> </span><span class="pygmentn">a</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">time</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">sleep</span><span class="pygmentp">(</span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">1</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">except</span><span
class="pygment"> </span><span class="pygmentp">:</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">print</span><span
class="pygment"> </span><span class="pygments"
style="color: rgb(186, 33, 33);">'exit from Joy mode'</span><span
class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">toggle</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">):</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">if</span><span
class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygmentp">:</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">else</span><span
class="pygment"> </span><span class="pygmentp">:</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">1</span><span
class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">stop</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">):</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">alive</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">running</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">wait</span><span
class="pygmentp">()</span><span class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">setValue</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">,</span><span class="pygment"> </span><span
class="pygmentn">value</span><span class="pygmentp">):</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">value</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">value</span><span class="pygment"></span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">def</span><span
class="pygment"> </span><span class="pygmentnf"
style="color: rgb(0, 0, 255);">aggiorna</span><span class="pygmentp">(</span><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span><span
class="pygmentp">):</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">newvalue</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentnb" style="color: rgb(0, 128, 0);">str</span><span
class="pygmentp">(</span><span class="pygmentbp"
style="color: rgb(0, 128, 0);">self</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">value</span><span
class="pygmentp">)</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">return</span><span
class="pygment"> </span><span class="pygmentn">newvalue</span></span>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentn"></span><br>
<br>
<span class="pygmentk"
style="color: rgb(0, 128, 0); font-weight: bold;">if</span><span
class="pygment"> </span><span class="pygmentn">__name__</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">==</span><span class="pygment"> </span><span
class="pygments" style="color: rgb(186, 33, 33);">"__main__"</span><span
class="pygmentp">:</span><span class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">app</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">QtGui</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">QApplication</span><span
class="pygmentp">(</span><span class="pygmentn">sys</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">argv</span><span class="pygmentp">)</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">gui</span><span
class="pygment"> </span><span class="pygmento"
style="color: rgb(102, 102, 102);">=</span><span class="pygment"> </span><span
class="pygmentn">Gui</span><span class="pygmentp">()</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">gui</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">show</span><span class="pygmentp">()</span><span
class="pygment"></span><br>
<span class="pygment"> </span><span class="pygmentn">sys</span><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span><span
class="pygmentn">exit</span><span class="pygmentp">(</span><span
class="pygmentn">app</span><span class="pygmento"
style="color: rgb(102, 102, 102);">.</span><span class="pygmentn">exec_</span><span
class="pygmentp">())</span></span>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp">####################</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp">as you can see, it start the thread using the value :
0</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp">"</span></span><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentn">value</span></span><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygment"> </span></span><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmento" style="color: rgb(102, 102, 102);">=</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygment"> </span></span><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentmi" style="color: rgb(102, 102, 102);">0</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">"</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp">what i need instead, is to start the thread using the
"text" from "</span></span><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentbp" style="color: rgb(0, 128, 0);">self</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmento" style="color: rgb(102, 102, 102);">.</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentn">textout.text()</span></span><span
class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">"</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">have
you any hints ?</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">thanks
a lot for your preciouse help!</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><br>
</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">regards,</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;">Massimo.</span></div>
<div><span class="Apple-style-span"
style="font-family: monospace; font-size: 11px; line-height: 13px; white-space: pre;"><span
class="pygmentp"><br>
</span></span></div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
PyQt mailing list <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
</blockquote>
Hi,<br>
<br>
like this :<br>
<br>
self.thread = logJ() <br>
self.thread.value = self.textout.text()<br>
self.thread.start()<br>
<br>
maybe, I don't understand the question ...<br>
<br>
Cheers.<br>
<br>
<br>
<div class="moz-signature">-- <br>
Vincent V.V.<br>
<a href="https://launchpad.net/oqapy">Oqapy</a></div>
</body>
</html>