PDA

View Full Version : QTextEdit setText override?



ksierens
24th November 2006, 17:49
I have found a few things that allow me to get around Qt's html parser problems and would like to apply them when the QTextEdit::setText member if called. Unfortunetly, this is not a virtual member. Currently I am using the source changed signal, getting the current text, appling the fixes, and setting it again, but that means that the text needs to be parsed twice.

Does anyone know a way around this?

jpn
24th November 2006, 17:54
I can't think of any other way than declaring your own custom method which applies the fix first and then passes the fixed text to the QTextEdit::setText(). This would require chaning all occurrences of QTextEdit::setText() in your project to the "fixed" method instead.

ksierens
24th November 2006, 17:59
Thanks, actually, I just realize that the QTextBrowser::setSource function is virtual, so I think I could handle it there.