Skip to main content

A Cross-Platform C# UI Framework via Qt’s Bridging Technology

Comments

Every C# UI framework comes with a familiar pattern: Windows-first, Linux absent, roadmap uncertain. WPF stalled, MAUI skipped Linux, WinUI 3 stays Windows-native. At the same time, demand for embedded Linux grows and C# teams feel the lack of good UI alternatives for C# on Linux. Qt Bridges, a bridging technology in public beta for C#, provides access to a UI framework that allows preserving your existing C# codebase while utilizing Qt Quick’s feature-rich UI libraries and APIs, hardware acceleration, and cross-platform capability.

What is Qt Bridge for C#?

Qt Bridges is a future bridging technology that will enable a single frontend implementation to be used with a variety of backend languages. For C#, it practically offers a new, cross-platform alternative for existing C# UI frameworks. Currently, the C# bridge is available as public beta.

The C# bridge connects your C# application logic layer directly to Qt Quick, Qt's proven UI framework (the same one used in automotive dashboards and medical devices worldwide) without needing to abandon your codebase, your .NET integrations, or what your team is familiar with. Hardware acceleration, genuine support for C# on Linux, and a gradual WPF migration path via HWND embedding are all part of the package. Your workflow stays intact; what changes is what you can ship.

Try Qt Bridges for C#

See how to get started

How Does the Qt Bridge Work as a C# UI Framework?

When you write an application using C# and QML, this bridge will provide native, Qt-based wrappers for C# types. These wrappers will handle all interoperability tasks such as object instantiation, method invocation, event notification, etc. With these in place, it will then be possible to reference C# types in QML, as in the following example:

C#
public class CSharpBackend
{
    public string Data
    {
        get => "Hello from C#!";
    }
}

 

QML
ApplicationWindow {

    CSharpBackend { id: backend }

    Text { text: backend.data }
}

 

 

A "hello world" example of using Qt as a C# UI framework

 

In the currently available Qt Bridges version for the C# UI framework, the native wrappers are generated as C++ code and will require a C++ compiler/toolchain (for Visual Studio, the Desktop development with C++ workload must be installed). We’re currently working on a runtime-configured interoperability model that will remove the requirement of a C++ toolchain at build time.

Getting Started with the C# Bridge in Visual Studio

The easiest way to start working with the Qt Bridge as a C# UI framework  is to follow these instructions to install its templates package and create a C# + QML app based on the project template included in that package.

Install the templates package:

  1. Open the Visual Studio Terminal Window:

    • View > Terminal

  2. Run the following command to install the Qt Bridge for C# templates package:

    • dotnet new install QtGroup.Qt.Bridge.CSharp.Templates

Create a C# + QML app project

  1. Select the option to create a new project:

    • File > New > Project/Solution

  2. In the Search for templates box, type QML and wait for the search results to appear.

  3. Select the QML Application project template.

  4. Press Next.

  5. In the Configure your new project window, set the Project name to Names and press Next.

  6. Optionally, in the Additional information window, check the Add sample code to project checkbox to create a project with some sample C# and QML code.

  7. Press Create.

After Visual Studio generates the project, you can open its source files to examine the code that was added to the project, then press F5 to build and run the application.

What’s Next

Try it out, learn more in the Qt Bridges C# documentation, and please provide your feedback.

Try Qt Bridges for C#

See how to get started

We’re now working towards the C# bridge to reach a Technology Preview (TP) state with a refined version.

Also, do let us know how you experience the lack of support for C# on Linux in the existing frontend options, because our feeling is if you’re developing anything outside the Windows ecosystem, there really isn’t a C# UI framework that would have what you need. With the demand for embedded Linux growing, we’re keen on hearing if you find patching it together with workarounds exactly as painful as we think?

Your feedback is very valuable for growing this into the best UI option for C#, so we hope to hear from you. Use the Qt Bridges Forum for any discussion and sign up to stay up-to-date on the project news.

Comments

Subscribe to our blog

Try Qt 6.11 Now!

Download the latest release here: www.qt.io/download

Qt 6.11 is now available, with new features and improvements for application developers and device creators.

We're Hiring

Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.