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. QLineEdit lostFocus problem
Forum Updated to NodeBB v4.3 + New Features

QLineEdit lostFocus problem

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 5 Posters 3.6k Views 4 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #21

    Hi
    Can you explain the original issue ?
    If you click on lineEdit , then click on keyboard, then
    lineedit loose its focus ?

    TheCipo76T 1 Reply Last reply
    0
    • mrjjM mrjj

      Hi
      Can you explain the original issue ?
      If you click on lineEdit , then click on keyboard, then
      lineedit loose its focus ?

      TheCipo76T Offline
      TheCipo76T Offline
      TheCipo76
      wrote on last edited by
      #22

      @mrjj No, if i click on "1" pushbutton i have to read Target in order to know in wich mylineedit i have to insert "1".

      Target is the mylineedit who lost focus

      i don't know if it's clear

      mrjjM 1 Reply Last reply
      0
      • TheCipo76T TheCipo76

        @mrjj No, if i click on "1" pushbutton i have to read Target in order to know in wich mylineedit i have to insert "1".

        Target is the mylineedit who lost focus

        i don't know if it's clear

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #23

        @thecipo76
        well first of all the buttons should have NoFocus set so clicking them do not steal focus.
        There is no reason for it to lose focus unless you pop something else up first that takes focus.
        But in your case, its not keyboard that steal it but something else
        that takes focus while in the window ??

        TheCipo76T 1 Reply Last reply
        5
        • mrjjM mrjj

          @thecipo76
          well first of all the buttons should have NoFocus set so clicking them do not steal focus.
          There is no reason for it to lose focus unless you pop something else up first that takes focus.
          But in your case, its not keyboard that steal it but something else
          that takes focus while in the window ??

          TheCipo76T Offline
          TheCipo76T Offline
          TheCipo76
          wrote on last edited by TheCipo76
          #24

          @mrjj Ah.. with NoFocus setted i don't need to subclass QLineEdit
          and it's all more easy

          Thank you very much

          mrjjM 1 Reply Last reply
          1
          • TheCipo76T TheCipo76

            @mrjj Ah.. with NoFocus setted i don't need to subclass QLineEdit
            and it's all more easy

            Thank you very much

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #25

            @thecipo76
            Yep it helps a lot. :)
            I used qApp->focusWidget(); and sendEvent (key down / key up ) to post the keys to any widget that has keyboard focus and it works pretty well.

            1 Reply Last reply
            1

            • Login

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