Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31646

QQuickTextEdit: hoveredLink broken when not connected to onLinkHovered

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.0
    • 5.2.0
    • None
    • qt5/dev
    • qtdeclarative/dev: f702dfa75ff8817e97f466d18b7c616c38f0d866

    Description

      There's a bug in the coordinate mapping. TextEdit::hoveredLink returns incorrect values when TextEdit is not in position (0,0) in relation to its parent. Run the following example, hover the link and inspect the periodical debug output.

      import QtQuick 2.2
      
      Rectangle {
          width: 360
          height: 360
      
          TextEdit {
              id: edit
      
              anchors.centerIn: parent
      
              textFormat: Qt.RichText
              text: "A <a href='link://textedit'>link</a> in a TextEdit..."
      
              //onLinkHovered: console.log(link) // <-- works after uncommenting this
      
              Rectangle {
                  anchors.fill: parent
                  border.width: 1
                  z: -1
              }
          }
      
          Timer {
              repeat: true
              running: true
              interval: 2000
              onTriggered: console.log("TextEdit::hoveredLink:", edit.hoveredLink)
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes