Hi,
Is there anyway to ensure the cursor continues to be shown in a QTextEdit when a menu, (or right click popup menu), is shown ?
Cheers in advance.
Chris.
Printable View
Hi,
Is there anyway to ensure the cursor continues to be shown in a QTextEdit when a menu, (or right click popup menu), is shown ?
Cheers in advance.
Chris.
when menu popup focus from text edit shifts to menu.
Use
widget->setfocus;
Thanks, I'll give it a go.
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,
Code:
{ Qt::FocusReason r = event->reason(); if ((r == Qt::PopupFocusReason) || (r == Qt::MenuBarFocusReason)) { } else { } }
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.
the cursor is still blinking, but the textedit do not receive any keyboard event