PDA

View Full Version : QTextEdit + paste rich text as plain text only



Yong
6th February 2008, 16:06
hello,

when using QTextEdit the paste() inserts every format supported by the rich-text.

How to make that when pasting it is inserted only plain text if available in clipboard ? or if there is rich-text in clipboard to convert it plain text and after that to paste it.

thanks

Yong
6th February 2008, 16:46
the answer was quite easy, sorry for that.


void QTextEdit::insertFromMimeData ( const QMimeData * source )
{
void QTextEdit::insertPlainText ( source->text() );
}

jpn
6th February 2008, 17:45
I guess you could have adjusted QTextEdit::acceptRichText as well.