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

Qt6: QML_ELEMENT does not work with classes within namespaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.1.0 Alpha, 6.2
    • 6.0.0 Alpha
    • QML: Tooling
    • Linux/X11
    • b6a164891537d6d3a515d78a44b0de6595a170c2 (qt/qtdeclarative/dev)

    Description

      namespace Foo {
      
      class Bar
      {
          Q_OBJECT
          QML_ELEMENT
      }

      Yields in: Invalid QML element name "Foo::Bar"

      QML_NAMED_ELEMENT(Bar) works.

       

      I think it would be really useful if the namespace could be stripped automatically (especially since it fails with namespace anyway) instead of needing to repeat the name in each registration.

      Attachments

        For Gerrit Dashboard: QTBUG-87266
        # Subject Branch Project Status CR V

        Activity

          People

            max.goldstein Maximilian Goldstein
            ablu Erik Schilling
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes