Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1773

Alternative syntax for id in Depends items

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 2.2.0
    • None
    • All

      It is not possible to use dots and dashes as identifiers in Qbs files, so when depending on a module that contains such symbols, we use the "id" property to give module a new name that can be used as identifier:

      Depends { id: gobject; name: "gobject-2.0" }
      Group { condition: gobject.present; files: ... }
      

      The problem here is that in QML id is a way to reference an item within this file, while here "id" is not an alias to Depends item but an alias to the imported module item. This is quite confusing.

      Proposed solution is to add a new property for the depends item that replaces the id
      property in this context:

      Depends { TBD: "gobject"; name: "gobject-2.0" }
      

      The possible names for the property could be "alias", "aliasName", "importName", "moduleName", "identifier".

      Note to myself: the id prop might have special treatment in QML parser.

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

            kandeler Christian Kandeler
            arch Ivan Komissarov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes