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

QQuickTextEdit: hoveredLink broken when not connected to onLinkHovered

XMLWordPrintable

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

      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)
          }
      }
      

        For Gerrit Dashboard: QTBUG-31646
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes