PDA

View Full Version : How to block the textedit'd text to be copied



santosh.kumar
1st November 2007, 12:50
Hi

I m using Qt4.2.2
I m using one textedit that display some text ..I want to block the text to be copied...

I have used setReadOnly(true) for non modified text; But Copy is available for selected text...
Qt 4.2.2 provides on signal copyAvailable(bool)

bu how i will use this signal
connect(textEdit,SIGNAL(copyAvailable(bool)),this, );
what will be used in the slot...

or any other method to block textedit's selected data to be copied...

if anybody know help me....

jpn
1st November 2007, 13:23
Try:

textEdit->setTextInteractionFlags(Qt::NoTextInteraction);
..or use QLabel ;)

fullmetalcoder
2nd November 2007, 11:54
alternatively you can subclass QTextEdit and reimplement the createMimeDataFromSelection() method to return an empty content whatherver the selection is...