[PyQt] Clearing and disabling a QLineEdit causes a cursor to be shown?

Nick Gaens mail at nickgaens.com
Sat Oct 9 13:43:19 BST 2010


Hello everybody,

When trying to "reset" a form, consisting out of some QLineEdits and
QSpinBoxes, I use this small piece of code:


for field in [self.customerDataLayout.itemAtPosition(row, 1) for row in
xrange(0, self.customerDataLayout.rowCount())]:
            widget = field.widget()
            widget.clear()
            widget.setEnabled(False)


The result is that all those QLineEdits and QSpinBoxes are in fact 'cleared'
and disabled, but the side effect is that some sort of vertical line
(cursor?) is drawn in each QLineEdit (see the attachment for a screenshot of
this problem).

Is this normal behavior? How do I disable this vertical line to be shown?


-- 
Nick Gaens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101009/10b00538/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QLineEdits_gone_wrong.png
Type: image/png
Size: 14744 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101009/10b00538/attachment.png>


More information about the PyQt mailing list