[PyQt] QSpinBox and setLineEdit

Mads Ipsen mpi at comxnet.dk
Fri Jan 30 18:53:14 GMT 2009


--------- Original Besked --------
Fra: Matt Smith <melkor at orangepalantir.org>
Til: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Cc: Mads Ipsen <mpi at comxnet.dk>
Emne: Re: [PyQt] QSpinBox and setLineEdit
Dato: 30/01/09 19:10

> &gt; Yes, this will do the trick provided that the function you connect to
does
> &gt; not take to long to update. In that case the spin box jams or locks
and does
> &gt; several increments of its value. This is exactly why I want to
connect to
> &gt; the lineedit since this is first updated once the function you
connect to
> &gt; returns. I post a small cone snippet in a separate post that
illustrates
> &gt; this.
> &gt; 
> &gt; Mads
> 
> I am going to suggest that if your function is taking too long to update
> it is not because of who/what you connected it too, but because your
> function is taking too long.  I made the spin box update quickly by
> starting a QThread and having the long process execute in that.  
> 
> This involved subclassing the spin box so that I would only make a new
> thread if the old thread had finished.  
> 
> Probably there are more elegant/better solutions.
> 
> mbs
> 

Funny thing is: The problem is not present on Mac and in Qt3 you could do
trick of using the lineEdit() method (called editor() in Qt3) to handle when
the spin box was done.

Could you provide me with a few snippets/starters for doing this in a
threaded way?

Best regards,

Mads


More information about the PyQt mailing list