Table of Contents

Class ExportAttribute

Namespace
Qt
Assembly
Qt.Bridge.CSharp.Api.dll

Configures how Qt Bridge exposes a managed type to QML

[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface|AttributeTargets.Delegate, AllowMultiple = false)]
public class ExportAttribute : Attribute
Inheritance
ExportAttribute
Inherited Members

Remarks

Qt Bridge can expose a managed type either through wrapper-based export or through metadata-based export used during runtime registration.

This attribute can be applied at assembly scope to define the default export mode for types in that assembly, or at type scope to override that behavior for an individual type.

When defined at the scope of the root assembly, with Global equal to true, the attribute will apply to all types in all assemblies brought in as static / load-time dependencies.

For each type, Qt Bridge uses the first applicable export mode in this order:

  1. An attribute on the type.
  2. An attribute on the type's declaring assembly.
  3. An attribute with Global set to true on the root application assembly.
  4. The project's configured export default.
  5. The built-in source-export default.

An explicit Default at any attribute scope stops this lookup and selects the built-in source-export default.

Properties

Global

Apply export options globally

public bool Global { get; set; }

Property Value

bool
  • true if the options apply to all assemblies;
  • false (default) if the options apply only locally.

Remarks

Only relevant if attribute is defined for the root assembly. Ignored otherwise.

Options

Custom export options

public Options Options { get; set; }

Property Value

Options

Bitmask of Options flags