Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9361

Use bindings directly for ItemLibraryEntry in *.metainfo file.

    XMLWordPrintable

Details

    Description

      It is currently not possible to set bindings in the .metainfo file for the ItemLibraryEntry. The current implementation will define default values for properties and bindings are not possible currently.

      There is a possible workaround. We can use QML source code to include bindings.
      For example, please see [qt-creator]\src\plugins\qmldesigner\qtquickplugin\quick.metainfo file. We will see a statement below.

      QmlSource { source: ":/qtquickplugin/source/text.qml" }
      

      The text.qml as shown, or other QML files, can include your custom bindings. For example, a Text binding as shown below from text.qml file.

      Text {
          text: qsTr("Text")
      }
      

      For example, we want to use qsTr() the text property as a binding. It would be nice to use the below declaration in the *.metainfo file.

      Binding { name: "parent"; expression: "target" }
      

      or

      Binding { name: "text"; expression "qsTr(\"text\")" } 
      

      Attachments

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

        Activity

          People

            thohartm Thomas Hartmann
            leonlee Leonard Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes