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

ListElement cannot use script for property value or nested elements

XMLWordPrintable

    • 7edd8ee9a6885e57715c50be1dd402d9bd5118c8

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes