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

Qt Quick for .NET: Interop attributes

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • None
    • None
    • Qt Bridges
    • None
    • 1edcf3ea9 (dev)

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes