Simply calling setFocus on my QTextEdit after showing the popup menu didnt work, and also prevented switching focus to other controls as the QTextEdit always took it back again.
Answering my own original question, the solution I found was to effectively filter focusOutEvents, eg,
{
Qt::FocusReason r = event->reason();
if ((r == Qt::PopupFocusReason) ||
(r == Qt::MenuBarFocusReason)) {
} else {
}
}
void MyTextEdit::focusOutEvent(QFocusEvent *event)
{
Qt::FocusReason r = event->reason();
if ((r == Qt::PopupFocusReason) ||
(r == Qt::MenuBarFocusReason)) {
} else {
QTextEdit::focusOutEvent(event);
}
}
To copy to clipboard, switch view to plain text mode
Can anyone see any fault in doing this ?
Also, it leaves the cursor blinking. Is there any way to turn it hard on - ie, not blinking ?
Cheers,
Chris.
Bookmarks