Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QPlainTextEdit: text cursor disappears after change in focus
Forum Updated to NodeBB v4.3 + New Features

[Solved] QPlainTextEdit: text cursor disappears after change in focus

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 3.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harry123
    wrote on last edited by Harry123
    #1

    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.

    H 1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      sorry for the stupid question: have you reimplemented the focusIn() event handler and forgot to call the base class implementation?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      H 1 Reply Last reply
      0
      • ValentinMicheletV Offline
        ValentinMicheletV Offline
        ValentinMichelet
        wrote on last edited by
        #3

        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.

        H 1 Reply Last reply
        0
        • raven-worxR raven-worx

          sorry for the stupid question: have you reimplemented the focusIn() event handler and forgot to call the base class implementation?

          H Offline
          H Offline
          Harry123
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • ValentinMicheletV ValentinMichelet

            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.

            H Offline
            H Offline
            Harry123
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • H Harry123

              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.

              H Offline
              H Offline
              Harry123
              wrote on last edited by
              #6

              Very stupid of me, how come nobody noticed it here ?

              I should have been calling QPlainTextEdit::focusInEvent(), not QWidget::focusInEvent() !

              raven-worxR 1 Reply Last reply
              0
              • H Harry123

                Very stupid of me, how come nobody noticed it here ?

                I should have been calling QPlainTextEdit::focusInEvent(), not QWidget::focusInEvent() !

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @Harry123 said:

                Very stupid of me, how come nobody noticed it here ?

                and what was i asking in my first post?!?!

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                H 1 Reply Last reply
                2
                • raven-worxR raven-worx

                  @Harry123 said:

                  Very stupid of me, how come nobody noticed it here ?

                  and what was i asking in my first post?!?!

                  H Offline
                  H Offline
                  Harry123
                  wrote on last edited by Harry123
                  #8

                  @raven-worx And what did I answer?

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved