This is the related code part:

Qt Code:
  1. while(..){
  2. ...
  3. ui.dataTextEdit->insertPlainText(currentTime);
  4. ...
  5. }
To copy to clipboard, switch view to plain text mode 

dataTextEdit is an instance of QPlainTextEdit
and I put the line
Qt Code:
  1. ui.dataTextEdit->setReadOnly(TRUE);
To copy to clipboard, switch view to plain text mode 

and while program executes if I highlight some part of lines in plainTextEdit, these lines are vanishing.

if

I put the line

Qt Code:
  1. ui.dataTextEdit->setTextInteractionFlags(Qt::NoTextInteraction);
To copy to clipboard, switch view to plain text mode 

then there is no problem, but I can't copy paste this time.

What is problem with read-only, I want to be enable of copy-paste but not to change text.

Thanks.