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. Anyway to setText on QLineEdit without emitting signals?
Forum Updated to NodeBB v4.3 + New Features

Anyway to setText on QLineEdit without emitting signals?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.0k Views 2 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    Is there a way to call setText on instances of QLineEdit that will not trigger emission of signals?

    Kind Regards,
    Sy

    SPlattenS 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Hi,

      QSignalBlocker

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • SPlattenS SPlatten

        Is there a way to call setText on instances of QLineEdit that will not trigger emission of signals?

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #2

        @SPlatten , replaced with call to QLineEdit::textEdited, no difference.

        Kind Regards,
        Sy

        JonBJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #3

          Hi,

          QSignalBlocker

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • SPlattenS SPlatten

            @SPlatten , replaced with call to QLineEdit::textEdited, no difference.

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

            @SPlatten said in Anyway to setText on QLineEdit without emitting signals?:

            @SPlatten , replaced with call to QLineEdit::textEdited, no difference

            I'm not sure what that means, but setText() should not cause textEdited() signal, only textChanged(). That's supposed to suffice for most scenarios. If you really want more than that then @SGaist 's QSignalBlocker.

            SPlattenS 1 Reply Last reply
            0
            • JonBJ JonB

              @SPlatten said in Anyway to setText on QLineEdit without emitting signals?:

              @SPlatten , replaced with call to QLineEdit::textEdited, no difference

              I'm not sure what that means, but setText() should not cause textEdited() signal, only textChanged(). That's supposed to suffice for most scenarios. If you really want more than that then @SGaist 's QSignalBlocker.

              SPlattenS Offline
              SPlattenS Offline
              SPlatten
              wrote on last edited by
              #5

              @JonB , I found another post during a quick google search suggestion to use textEdited, as I said it didn't help, however @SGaist suggestion has solved the problem.

              Kind Regards,
              Sy

              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