Class Application
- Namespace
- Qt
- Assembly
- Qt.Bridge.CSharp.Api.dll
Sets app-wide metadata such as the app name, version, publisher details, and default window icon.
public static class Application
- Inheritance
-
Application
- Inherited Members
Remarks
Qt Bridge for C# forwards these values to the native application object as soon
as you assign them. In practice, set them near the start of Main, before
LoadFromRootModule(string), so the UI sees them from the beginning:
static void Main(string[] args)
{
Qt.Application.Name = "MyApp";
Qt.Application.Version = "1.0";
Qt.Application.OrganizationName = "Acme Corp";
Qt.Application.OrganizationDomain = "acme.com";
Qt.Application.DisplayName = "My Application";
Qt.Application.SetWindowIcon("qrc:/assemblies/MyApp/icons/app.svg");
Qml.LoadFromRootModule("Main");
Qml.WaitForExit();
}
Properties
DisplayName
Sets the user-facing application name.
public static string DisplayName { set; }
Property Value
Remarks
Use this when the name shown to users should differ from Name. If not set, the Name value will be used.
Name
Sets the internal application name.
public static string Name { set; }
Property Value
Remarks
Use this as the stable programmatic name of your app. If not set, the executable name will be used as the default.
OrganizationDomain
Sets the publisher domain for the application.
public static string OrganizationDomain { set; }
Property Value
Remarks
This is mainly useful on platforms like macOS, where the domain is part of the app
identity. Example: acme.com. Some platforms may ignore this value.
OrganizationName
Sets the publisher or company name for the application.
public static string OrganizationName { set; }
Property Value
Remarks
This helps Qt Bridge for C# provide publisher information to Qt, which uses it when choosing where app settings are stored on the current platform. A company or product owner name is usually the right value here.
Version
Sets the application version.
public static string Version { set; }
Property Value
Remarks
Use the same version string you would show in an About dialog or diagnostic output. Qt Bridge for C# passes it through to Qt, which can surface it in places such as version reporting and settings metadata.
Methods
SetWindowIcon(string)
Sets the default window icon from a packaged app resource.
public static void SetWindowIcon(string qrcUrl)
Parameters
qrcUrlstringThe resource URL. Use the Qt resource form, for example:
qrc:/assemblies/MyApp/icons/app.svg.
Remarks
Sets the default icon for all windows that do not specify their own. Provide the icon
as a resource (e.g., qrc:/assemblies/MyApp/icons/app.png). PNG is recommended
for broad compatibility; SVG is supported if the environment allows it.
Exceptions
- ArgumentException
qrcUrldoes not start withqrc:/.