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

Cannot refer to item id nor properties in TextItem.cursorDelegate

    XMLWordPrintable

    Details

      Description

      It is not possible to refer to item id nor a property from inside TextItem.cursorDelegate:

          property color cursorColor: "blue"
      ...
              TextInput {
                  id: textInput
                  anchors.fill: parent
                  cursorDelegate: Cursor { editor: textInput; color: cursorColor }
              }
      

      When trying to do so you'll get errors like:

      ReferenceError: Can't find variable: textInput
      ReferenceError: Can't find variable: cursorColor

      Similar code works for TextEdit, however.

      Full example attached.

        Attachments

        1. Cursor.qml
          0.7 kB
          Sami Kananoja
        2. cursorDelegateFailure.qml
          0.9 kB
          Sami Kananoja
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            Reporter:
            skananoj Sami Kananoja
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes