Fw: Re: [PyQt] QSpinBox and setLineEdit

Mpi mpi at comxnet.dk
Fri Jan 30 09:54:24 GMT 2009


--------- Original Besked --------
Fra: Mpi <mpi at comxnet.dk>
Til: Phil Thompson <phil at riverbankcomputing.com>
Emne: Re: [PyQt] QSpinBox and setLineEdit
Dato: 30/01/09 10:49

> 
> --------- Original Besked --------
> Fra: Phil Thompson &lt;phil at riverbankcomputing.com&gt;
> Til: Mpi &lt;mpi at comxnet.dk&gt;
> Cc: pyqt at riverbankcomputing.com
> Emne: Re: [PyQt] QSpinBox and setLineEdit
> Dato: 30/01/09 10:42
> 
> &gt; On Fri, 30 Jan 2009 10:22:57 +0100, Mpi
&amp;lt;mpi at comxnet.dk&amp;gt; wrote:
> &gt; &amp;gt; Hi,
> &gt; &amp;gt; 
> &gt; &amp;gt; You can set a custom line edit on a spinbox using the method
> &gt; setLineEdit().
> &gt; &amp;gt; Suppose I implement a class that inherits from QLineEdit and
> overwirite
> &gt; the
> &gt; &amp;gt; 'setText' method, you'd expect that pressing the arrow
button on the
> &gt; &amp;gt; spinbox
> &gt; &amp;gt; would trigger a call to your custom setText method.
> &gt; 
> &gt; No you wouldn't because setLine() isn't virtual.
> &gt; 
> &gt; Phil
> &gt; 
> 

Well, OK. My problem is that I would like to connect up to the
textChanged(const QString &amp;) signal emitted by the spinbox's lineedit.
This
signal, however, is only emitted when the edit is modified directly, not
when it changes indirectly eg. by pressing the up/down arrows on the
spinbox. Any suggestions for a solution?

Mads


More information about the PyQt mailing list