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

[qmltc] name clashes with generated class names

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.6.0, 6.6
    • 6.4.1
    • QML: Compiler
    • 3df8eba0f (dev)

      `qt_add_qml_module` does not set the a namespace by default. however this easily leads to clashes with application code (e.g. an innocent looking `Display.qml` fill fail to compile due to `typedef struct _XDisplay Display`).

      this makes me wonder if it would be more robust to provide a reasonable default for TYPE_COMPILER_NAMESPACE (e.g. "qmltc"), as it provides an initial safety net to protect against such name clashes (principle of least surprise).
      not sure if there are any downsides of this approach (maybe debug info get a little larger due to larger symbol names). thoughts?

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

            sami.shalayel Sami Shalayel
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes