VSCODEEXT-353: Document Qt C# extension - #562
Open
leena-miettinen wants to merge 1 commit into
Open
Conversation
- Add a section to the Overview - Add a tutorial that describes the sample project
leena-miettinen
force-pushed
the
VSCODEEXT-353-doc-c-sharp
branch
from
August 27, 2026 08:15
3310870 to
ceb466d
Compare
kaheimri
reviewed
Sep 1, 2026
|
|
||
| namespace MyQtApp; | ||
|
|
||
| [QObject] |
Collaborator
There was a problem hiding this comment.
Please remove, this API is gone in the next release.
kaheimri
reviewed
Sep 1, 2026
| references it from \c {Main.qml}. | ||
|
|
||
| \code [C#] | ||
| using Qt.MetaObject; |
Collaborator
There was a problem hiding this comment.
Please remove, this namespace is gone in the next release.
kaheimri
reviewed
Sep 1, 2026
| \list 1 | ||
| \li Go to \uicontrol {Welcome}, and then select \uicontrol {New project}. | ||
| \li In \uicontrol {Project}, select | ||
| \uicontrol {Qt Quick application (Qt for C#)}. |
Collaborator
There was a problem hiding this comment.
Qt Bridge for C# application
kaheimri
reviewed
Sep 1, 2026
Comment on lines
+299
to
+335
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>WinExe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
| <QtBridgePackagePrefix>QtGroup.Qt.Bridge.CSharp</QtBridgePackagePrefix> | ||
| <QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == ''" | ||
| >$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</QtBridgeTemplateArch> | ||
| <QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == 'X64'">x64</QtBridgeTemplateArch> | ||
| <QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == 'Arm64'">arm64</QtBridgeTemplateArch> | ||
| <QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and '$(RuntimeIdentifier)' != ''" | ||
| >$(RuntimeIdentifier)</QtBridgeTemplateRid> | ||
| <QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and $([MSBuild]::IsOSPlatform('Windows'))" | ||
| >win-x64</QtBridgeTemplateRid> | ||
| <QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and $([MSBuild]::IsOSPlatform('Linux'))" | ||
| >linux-$(QtBridgeTemplateArch)</QtBridgeTemplateRid> | ||
| <QtBridgePackageId>$(QtBridgePackagePrefix).$(QtBridgeTemplateRid)</QtBridgePackageId> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup Condition="'$(QtBridgeTemplateRid)' == 'win-x64' or '$(QtBridgeTemplateRid)' == 'linux-x64'"> | ||
| <PackageReference Include="$(QtBridgePackageId)" Version="0.3.*-*" /> | ||
| </ItemGroup> | ||
|
|
||
| <Target Name="EnsureSupportedQtBridgePlatform" BeforeTargets="Restore;Build" | ||
| Condition="'$(QtBridgeTemplateRid)' != 'win-x64' and '$(QtBridgeTemplateRid)' != 'linux-x64'"> | ||
| <Error Text="Qt Bridge for C# currently supports win-x64 and linux-x64 only. Selected RID: '$(QtBridgeTemplateRid)'." /> | ||
| </Target> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="Main.qml"/> | ||
| <Compile Include="Program.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Collaborator
There was a problem hiding this comment.
Replace with:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<QtBridgePackagePrefix>QtGroup.Qt.Bridge.CSharp</QtBridgePackagePrefix>
<QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == ''"
>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</QtBridgeTemplateArch>
<QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == 'X64'">x64</QtBridgeTemplateArch>
<QtBridgeTemplateArch Condition="'$(QtBridgeTemplateArch)' == 'Arm64'">arm64</QtBridgeTemplateArch>
<QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and '$(RuntimeIdentifier)' != ''"
>$(RuntimeIdentifier)</QtBridgeTemplateRid>
<QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and $([MSBuild]::IsOSPlatform('Windows'))"
>win-x64</QtBridgeTemplateRid>
<QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and $([MSBuild]::IsOSPlatform('Linux'))"
>linux-$(QtBridgeTemplateArch)</QtBridgeTemplateRid>
<QtBridgeTemplateRid Condition="'$(QtBridgeTemplateRid)' == '' and $([MSBuild]::IsOSPlatform('OSX'))"
>osx-$(QtBridgeTemplateArch)</QtBridgeTemplateRid>
<QtBridgePackageId>$(QtBridgePackagePrefix).$(QtBridgeTemplateRid)</QtBridgePackageId>
</PropertyGroup>
<ItemGroup Condition="'$(QtBridgeTemplateRid)' == 'win-x64'
or '$(QtBridgeTemplateRid)' == 'linux-x64'
or '$(QtBridgeTemplateRid)' == 'osx-x64'
or '$(QtBridgeTemplateRid)' == 'osx-arm64'">
<PackageReference Include="$(QtBridgePackageId)" Version="0.4.*-*" />
</ItemGroup>
<Target Name="EnsureSupportedQtBridgePlatform" BeforeTargets="Restore;Build"
Condition="'$(QtBridgeTemplateRid)' != 'win-x64'
and '$(QtBridgeTemplateRid)' != 'linux-x64'
and '$(QtBridgeTemplateRid)' != 'osx-x64'
and '$(QtBridgeTemplateRid)' != 'osx-arm64'">
<Error Text="Qt Bridge for C# currently supports win-x64, linux-x64, osx-x64, and osx-arm64. Selected RID: '$(QtBridgeTemplateRid)'." />
</Target>
<ItemGroup>
<None Include="Main.qml"/>
<Compile Include="Program.cs" />
</ItemGroup>
</Project>
kaheimri
reviewed
Sep 1, 2026
| \li Go to \uicontrol {Welcome}, and then select \uicontrol {New project}. | ||
| \li In \uicontrol {Project}, select | ||
| \uicontrol {Qt Quick application (Qt for C#)}. | ||
| \image {vscodeext-create-new-project-quick-csharp.webp} {A Qt Quick C# application in the New item view} |
Collaborator
There was a problem hiding this comment.
vscodeext-create-new-project-quick-csharp.webp isn't included in the PR
kaheimri
requested changes
Sep 1, 2026
kaheimri
left a comment
Collaborator
There was a problem hiding this comment.
One final note i did not attach to the changes directly:
Framework picker step missing - the wizard's Framework prompt (net8.0/9.0/10.0) isn't mentioned in the walkthrough steps; net8.0 only appears unexplained in the final code sample.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://qt-project.atlassian.net/jira/software/c/projects/VSCODEEXT/boards/672?selectedIssue=VSCODEEXT-353