On this page

Using project and item templates

What is included

  • Project template - Qt.Bridge.DotNet Project

    Creates a minimal C# app wired to Qt Quick / QML. The template includes an entry QML (Main.qml) file and a bootstrap Program.cs file.

  • Item template - Qt.Bridge.DotNet QML File (.qml)

    Adds a new .qml file and lets the build integrate it automatically.

How to use

Install the templates

You can install the templates from local or online NuGet feed:

  • From NuGet feed:
    dotnet new install __PACKAGE_ID__
  • From a local .nupkg:
    dotnet new install ./PATH/TO/__PACKAGE_ID__.__PACKAGE_VERSION__.nupkg

To verify installation, run:

dotnet new list

The new templates should appear in the list.

To update the templates to the latest version, run:

dotnet new update
# or force a specific package/version
dotnet new install __PACKAGE_ID__ --force

Create a project

To create a new Qt Quick C# project, run:

dotnet new qtbridgedotnetproj -n MyQtApp
cd MyQtApp
dotnet build
dotnet run

This generates:

MyQtApp/
  Project.csproj
  Program.cs
  Main.qml

Add a QML item to an existing project

To add a new QML file to an existing project, in command line, change directory to the project folder and run:

dotnet new qtbridgedotnetqml --FileName=MainPage

This creates MainPage.qml. The build integrates QML files automatically (they'll be registered and copied alongside your app).

Uninstall the templates

To uninstall the templates, run:

dotnet new uninstall __PACKAGE_ID__

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.