On this page

Preview and profile Qt Bridge for C# applications

You can preview and profile the QML code of Qt Bridge for C# applications in the same way as other Qt Quick applications. Qt Extension for Visual Studio Code starts your C# application for you.

Build first

QML Preview and QML Profiler need the metadata that building the project generates. Build the project once before you start them. For more information, see Build and run Qt Bridge for C# applications.

If you start them before the first build, Qt Extension for Visual Studio Code asks you to build the project first.

Preview QML files

To preview the QML file that is open in the editor:

  • Select Preview current QML file live on the editor toolbar.
  • Go to Command Palette, and select Qt: Preview current QML file live.

The changes you make to the QML code become visible in the preview when you save the file. This applies to all QML files of the project, and the preview always starts with the saved QML code, so you do not need to build the project after changing QML code. Changes to the C# code and new QML files take effect after you build the project again.

Profile the application

To profile the application, go to Command Palette, and select Qt: Profile QML application.

Work with several projects

If a workspace folder contains several Qt Bridge for C# projects, Qt Extension for Visual Studio Code uses the project that contains the file in the editor. If that does not identify a project, it asks you to select one.

Select the build configuration

If you build a project in several configurations, such as Debug and Release, or for several target frameworks, the project has QML metadata for each of them. Qt Extension for Visual Studio Code asks you which one to use.

To select a different build later:

  1. Go to Command Palette, and select Qt Bridge C#: Select QML Build Metadata.
  2. Select the configuration and target framework.

The QML language server, QML Preview, and QML Profiler use the selected build. Qt Extension for Visual Studio Code remembers the selection for the workspace.

See also Select Qt for Qt Bridge for C# projects.

© 2026 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.