Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. textEdited signal for TextArea/TextEdit
Forum Updated to NodeBB v4.3 + New Features

textEdited signal for TextArea/TextEdit

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 4 Posters 719 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.
  • K Offline
    K Offline
    Kenz Dale
    wrote on last edited by
    #1

    The TextInput component has a very useful signal which is emitted only when the user actively types into the keyboard: https://doc.qt.io/qt-6/qml-qtquick-textinput.html#textEdited-signal. This lets the program change the text without triggering signals.

    Is there something similar for TextEdit/TextArea components? https://doc.qt.io/qt-6/qml-qtquick-textedit.html#editingFinished-signal is all I can find, and this will trigger only when the user changes focus. That's not really the same thing at all.

    Thoughts?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      when you have a property (starting with a lowercase) in QML, you should have the corresponding propertyChanged signal available, and you can autoconnect to same Item's onPropertyChanged slot.

      As stated in TextInput's documentation, textEdited is not emitted when text has changed programmatically, hence only when the text has changed by UI action. textChanged is emitted whenever the text has changed no matter where the change comes from.

      K 1 Reply Last reply
      1
      • ? A Former User

        when you have a property (starting with a lowercase) in QML, you should have the corresponding propertyChanged signal available, and you can autoconnect to same Item's onPropertyChanged slot.

        As stated in TextInput's documentation, textEdited is not emitted when text has changed programmatically, hence only when the text has changed by UI action. textChanged is emitted whenever the text has changed no matter where the change comes from.

        K Offline
        K Offline
        Kenz Dale
        wrote on last edited by Kenz Dale
        #3

        @ankou29666 Thanks for your thoughts. I think all that is understood. The problem is that when we programmatically change the text this triggers onTextChanged, and thus causes nasty loops when the text changes cause text changes (which is what is what happens when there are multiple text blocks and they all need to be sync'ed with each other).

        textEdited() breaks the cycle by allowing the signal to fire only when the user types new text, not just when the text is changed.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kai Nickel
          wrote on last edited by
          #4

          Sorry for bumping this old thread, but: this feature is still missing, right? Is anyone aware of a bugtracker issue for this? I could not find one...

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            Bug is here https://bugreports.qt.io/browse/QTBUG-103718
            Fix is also under progress.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            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