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

Qt Quick for .NET: Interop attributes

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • QML: Bridges
    • None

    Description

      In the context of C# programming, the standard way to associate metadata to code definitions is by using attributes.

      Attributes have the following properties:

      • Attributes add metadata to your program. Metadata is information about the types defined in a program. All .NET assemblies contain a specified set of metadata that describes the types and type members defined in the assembly. You can add custom attributes to specify any other required information.
      • Attributes can be applied to entire assemblies, modules, or smaller program elements, such as classes and properties.
      • Attributes can accept arguments in the same way as methods and properties.
      • Attributes enable a program to examine its own metadata or metadata in other programs by using reflection.

      Several .NET Framework interfaces rely on attributes to allow customization of basic functionality. For example, in the JSON serialization interfaces of System.Text.Json, attributes can be used to annotate class members with custom serialization options.

      To support interoperability with .NET types, Qt Quick for .NET will provide a set of attributes that can be used by C# devs to annotate their code. The metadata in these attributes will provide the necessary context to generate the managed/native bridge code.

      When this task is finished I will be able to:

      1. Add a reference in my C# project to an assembly containing the interop attributes;
      2. Associate interop attributes to my C# code.

      Attachments

        Issue Links

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

          Activity

            People

              mecfc Miguel Costa
              mecfc Miguel Costa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change