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

[qmltc] name clashes with generated class names

    XMLWordPrintable

Details

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

    Description

      `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?

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes