On Saturday 09 October 2010, 14:43:19 Nick Gaens wrote: > 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?
Hard to say with some code to experiment with. You might try: - try: widget.readOnly(True) except AttributeError: pass before widget.setEnabled(False) - use a two pass approach, where the loop with the widget.setEnabled(False) body is called from a QTimer.SingleShot(0, ) - a mixture of these Pete _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt