Solved [Solved] QPlainTextEdit: text cursor disappears after change in focus
-
When changing the focus away from a window containing a QPlainTextEdit, the text cursor rightly disappears. However, returning the focus to the window does not make it reappear, neither does a click inside the QPlainTextEdit object. What makes it reappear is typing any character or using a positional key such as an arrow.
I notice that when losing the focus, the QPlainTextEdit object loses the blue color in its frame, and regains it when the focus returns, but the text cursor is not visible.
Is there anything I can do in focusInEvent() to make the text cursor visible?
Version 5.5 on Windows.
-
sorry for the stupid question: have you reimplemented the focusIn() event handler and forgot to call the base class implementation?
-
Hi,
Do you have a minimal running example that you could share in order to play with it? I never experienced cursor disappearance on losing focus.
-
@raven-worx :
Yes, I do call QWidget::focusInEvent().
I also do other stuff, which might be causing this problem : setting the QMainWindow menu and title. -
@ValentinMichelet :
No, the product in question is too big and complex to be easily reduced.
I hoped that somebody would have an idea, before I start the long and painful work to reduce the number of variables in the equation. -
Very stupid of me, how come nobody noticed it here ?
I should have been calling QPlainTextEdit::focusInEvent(), not QWidget::focusInEvent() !
-
@Harry123 said:
Very stupid of me, how come nobody noticed it here ?
and what was i asking in my first post?!?!
-
@raven-worx And what did I answer?