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. How to debounce QLineEdit::textEdited signal
QtWS25 Last Chance

How to debounce QLineEdit::textEdited signal

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 947 Views
  • 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.
  • S Offline
    S Offline
    Shines
    wrote on last edited by
    #1

    QObject::connect(xyz, &QLineEdit::textEdited, [this](const QString& text)
    {
    std::vector<int> intList = Parse(text);

        {
          
        }
    });
    
    JonBJ 1 Reply Last reply
    0
    • S Shines

      QObject::connect(xyz, &QLineEdit::textEdited, [this](const QString& text)
      {
      std::vector<int> intList = Parse(text);

          {
            
          }
      });
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Shines
      Please ask a question. No idea what your problem is, or how the code might relate to "debounce QLineEdit::textEdited signal".

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Shines
        wrote on last edited by
        #3

        textedited signal is emitted for every character typed. But i want the signal to be emitted after editing is complete and then I want to parse the text.

        JonBJ 1 Reply Last reply
        0
        • S Shines

          textedited signal is emitted for every character typed. But i want the signal to be emitted after editing is complete and then I want to parse the text.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Shines
          Then use editingFinished signal like the docs state.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Shines
            wrote on last edited by
            #5

            @JonB
            I dont want to use editingFinished as the slot may differ. Also textEdited(const QString &) accepts args against editingFinished(). I guess with textEdited(const QString &) parsing would be easier

            jsulmJ JonBJ 2 Replies Last reply
            0
            • S Shines

              @JonB
              I dont want to use editingFinished as the slot may differ. Also textEdited(const QString &) accepts args against editingFinished(). I guess with textEdited(const QString &) parsing would be easier

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Shines said in How to debounce QLineEdit::textEdited signal:

              I dont want to use editingFinished as the slot may differ

              What do you mean? Why exactly can't you use this signal?
              What is your definition of "editing finished"?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Shines

                @JonB
                I dont want to use editingFinished as the slot may differ. Also textEdited(const QString &) accepts args against editingFinished(). I guess with textEdited(const QString &) parsing would be easier

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @Shines said in How to debounce QLineEdit::textEdited signal:

                I dont want to use editingFinished as the slot may differ.

                Don't know what this means. You do want to use editingFinished, even if you think you don't! As you said

                But i want the signal to be emitted after editing is complete

                which is exactly what it does and what it's there for. And no you do not need the const QString & argument as you know where the text is to access it.

                Haven't we had just this conversation in another thread recently?

                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