[Qt-interest] How can I set to position in QPlainTextEdit?

Daniel Vérité daniel.verite at gmail.com
Wed Dec 31 14:10:45 CET 2008


	 Iurii Gordiienko writes

> Attached file  - is a simple example. After second click all text 
will be with green background...    

I've tried your example. My understanding is that the problem happens 
when the CharFormat is applied to a piece of text that happens to 
coincide with the current selection.

Try to clear the current selection, in addition to textedit ->clear()

  QTextCursor c = textedit->textCursor();
  c.clearSelection();
  textedit->setTextCursor(c);

Best regards,
-- 
 Daniel
 PostgreSQL-powered mail user agent and storage: 
http://www.manitou-mail.org 



More information about the Qt-interest-old mailing list