ok guys, thanks, I've got it. It's a different solution to a different problem though.
This is what I'm doing....
//put the string into the mainView
mainView->setPlainText(allTheText);
//move the cursor to the end of the text
//I have to do this too. - I was forgetting this!!!!
mainView->setTextCursor(cursor);
//put the string into the mainView
mainView->setPlainText(allTheText);
//move the cursor to the end of the text
QTextCursor cursor(mainView->textCursor());
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
//I have to do this too. - I was forgetting this!!!!
mainView->setTextCursor(cursor);
To copy to clipboard, switch view to plain text mode
as you guys say ... this should work. And it does ... usually.
However, I had another problem too. I was making my QTextEdit in my mainWindow constructor - and I was loading my file and displaying it from the constructor too. That wasn't moving my cursor.
now I have a
QTimer::singleShot(0,
this,
SLOT(init
()));
QTimer::singleShot(0, this, SLOT(init()));
To copy to clipboard, switch view to plain text mode
and I load my file from init()
That works fine.
thanks for your help
Kevin
Bookmarks