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

ListElement cannot use script for property value or nested elements

    Details

    • Commits:
      7edd8ee9a6885e57715c50be1dd402d9bd5118c8

      Description

      ListElement's cannot take scripts as property values. Unfortunately, this means that qsTr() cannot be used.

      ListElement

      { name: qsTr("Apple"); cost: 2.45 }

      AFAICT, ListModel can support i18n only by adding elements through JavaScript.

      It would also be very useful to add script support for the following use case:

      ListElement

      { name: qsTr("Go to root"); cost: 2.45; script: <script> }

      ListElement

      { name: qsTr("Delete"); cost: 2.45; script: <script> }

      ListElement

      { name: qsTr("Search from here"); cost: 2.45; script: <script> }

      I also tried to wrap the ListElement contents in a separate QtObject and assign the new object to this. That didn't work either since ListElement cannot contain nested elements

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                brasser Michael Brasser (closed Nokia identity) (Inactive)
                Reporter:
                girish Girish Ramakrishnan
              • Votes:
                0 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes