I'm using PySide(PyQt is fine as well) and I want to deselect everything inside a QTextEdit. Selecting everything is very easy and it's done by self.textedit.selectAll(), but I can't find a simple way to deselect everything. Is there a straightforward way to do it that I'm not aware of or is it more complicated than that?
Thanks.
It same too, isn't it?
QLineEdit.deselect (self)
Text all in your object.Example;
Reference : http://pyqt.sourceforge.net/Docs/PyQt4/qlineedit.html#deselect
Or, did your want to deselect all
QLineEdit
, your just find Children is aQLineEdit
and deselect it all;Regards,
You want to first get the
QTextCursor
for theQTextEdit
Then clear the selection of the
QTextCursor
Then update the
QLineEdit
with the newQTextCursor
(see documentation forQTextEdit.textCursor()
which indicates updating the returnedQTextCursor
does not actually affect theQTextEdit
unless you also call the following)