MediumSetting Up Qt 5/6 with VulkanSceneGraph (VSG) on Windows Using vsgQt | by John Nirmal | Medium
Sitemap
John Nirmal

John Nirmal

Setting Up Qt 5/6 with VulkanSceneGraph (VSG) on Windows Using vsgQt

20 min readAug 3, 2026

--

From Visual Studio, PowerShell and the Vulkan SDK to a Working vsgQt Application

Press enter or click to view image in full size
Example Qt MainWindow with VSG rendering an interactive 3D asset using vsgQt

Qt is excellent for building desktop interfaces: windows, menus, toolbars, dock panels, property editors and complete application workflows.

VulkanSceneGraph, usually shortened to VSG, solves a different problem. It is a modern C++17 scene graph designed around Vulkan for high-performance 3D rendering.

Instead of asking Qt to manage the complete rendering architecture, we can use:

  • Qt for the desktop application and user interface
  • VulkanSceneGraph for the 3D scene and renderer
  • vsgQt to integrate a VSG rendering window into a Qt application

This guide walks through the complete Windows setup:

  1. Install Visual Studio with C++ support
  2. Install the Vulkan SDK
  3. Verify the Vulkan system environment variables
  4. Import the Visual Studio x64 developer environment into PowerShell
  5. Save the PowerShell utility in $PROFILE, or use it temporarily
  6. Download and install Qt
  7. Download and compile VulkanSceneGraph
  8. Download and compile vsgQt
  9. Download a sample VSG asset
  10. Run the official vsgqtviewer example

The setup described here uses:

  • Windows 10 or Windows 11
  • Visual Studio Community 2026 or Visual Studio 2022
  • MSVC x64
  • CMake
  • Git
  • PowerShell 7
  • Qt 6 or Qt 5.10+
  • Vulkan SDK
  • VulkanSceneGraph
  • vsgQt

Version numbers change over time, so replace version-specific paths with the versions installed on your computer.

Why Use VSG Instead of Qt for Everything?

Qt already supports Vulkan.

For example, QVulkanWindow manages a Vulkan device, graphics queue, command pool, command buffers, depth-stencil image and swapchain. It can also be embedded in a QWidget interface with QWidget::createWindowContainer(). Qt therefore does not need VSG merely to display Vulkan graphics.

However, Qt and VSG operate at different levels.

Qt handles the application

Qt is well suited for:

  • Native desktop windows
  • Widgets
  • Menus and toolbars
  • Dock panels
  • Dialogs
  • Forms and property editors
  • Input handling
  • Model/view interfaces
  • Accessibility
  • Application lifecycle
  • Cross-platform desktop deployment

VSG handles the scene and renderer

VSG provides:

  • A Vulkan-first scene graph
  • Scene graph traversal
  • Vulkan resource management
  • Graphics pipelines
  • Cameras and views
  • Command graph construction
  • Multithreaded rendering
  • Scene serialization
  • Large-coordinate rendering
  • GPU resource sharing
  • Database paging and scene loading

vsgQt uses VulkanSceneGraph’s own window and VkSurface support. Its design also allows multiple VSG windows to share a vsg::Device and the underlying VkDevice, which is useful when an application contains several 3D views.

The architecture is therefore not:

Qt versus VulkanSceneGraph

It is:

Qt for the application, VulkanSceneGraph for the renderer, and vsgQt between them.

1. Install Visual Studio

Download Visual Studio from the official Microsoft website:

Download Visual Studio

Visual Studio Community is suitable for individual developers, students and open-source development.

This guide supports:

Visual Studio Community 2026
Visual Studio Community 2022
Visual Studio Build Tools
Professional and Enterprise editions

Visual Studio 2026 is version 18, while Visual Studio 2022 is version 17.

Select the C++ workload

Open the Visual Studio Installer and select:

Desktop development with C++

The workload installs the tools needed to build native C++ applications on Windows.

Check that the following components are included:

MSVC C++ x64/x86 build tools
Windows 10 SDK or Windows 11 SDK
C++ CMake tools for Windows
Git for Windows

The exact names may vary slightly depending on the Visual Studio version.

Visual Studio 2026 and Qt compatibility

Visual Studio 2026 uses the v145 platform toolset by default. Qt 6.11’s officially listed Windows configuration currently uses MSVC 2022, whose platform toolset is v143.

Microsoft documents binary compatibility across the Visual Studio 2015–2026 C++ toolsets, so libraries compiled using MSVC 2022 can generally be consumed by a newer compatible linker. However, using Visual Studio 2026 with its default v145 toolset is not currently listed in Qt 6.11’s official support table.

There are two reasonable configurations.

Configuration A: Visual Studio 2026 with v145

This uses:

Visual Studio 2026
Visual Studio 18 2026 CMake generator
v145 platform toolset
Qt msvc2022_64 binaries

This relies on Microsoft’s cross-version binary compatibility.

Configuration B: Visual Studio 2026 with v143

This uses:

Visual Studio 2026 IDE
Visual Studio 18 2026 CMake generator
v143 platform toolset
Qt msvc2022_64 binaries

This is the more conservative option because the compiler toolset matches Qt’s officially listed MSVC 2022 configuration.

To use it, open:

Visual Studio Installer
→ Modify
→ Individual components

Install:

MSVC v143 - VS 2022 C++ x64/x86 build tools

Later, set:

$CMakeToolset = "v143"

To use the default toolset, leave it as:

$CMakeToolset = $null

2. Install PowerShell 7

Windows includes Windows PowerShell 5.1, but this guide uses PowerShell 7.

You can install it from:

PowerShell releases

Verify the installation:

pwsh --version

Then open PowerShell 7:

pwsh

The commands in this guide should also work in Windows PowerShell 5.1, but the profile path for Windows PowerShell and PowerShell 7 is different.

Always use:

$PROFILE

instead of hardcoding a profile location.

3. Install the Vulkan SDK

Download the Windows x64 Vulkan SDK from LunarG:

Download the Vulkan SDK

The Vulkan SDK includes:

  • Vulkan headers
  • Vulkan import libraries
  • Validation layers
  • Shader compilation tools
  • vulkaninfo
  • vkcube
  • CMake package information

The default installation directory is:

C:\VulkanSDK\<version>

For example:

C:\VulkanSDK\1.4.350.0

The exact version may be newer when you follow this guide.

The Vulkan SDK installer normally creates the VULKAN_SDK system environment variable, adds %VULKAN_SDK%\Bin to the system Path, and sets VK_SDK_PATH for compatibility with older tools. Existing terminals must be restarted before they can see the updated environment.

Verify the Vulkan installation

Open a new PWSH(PowerShell) window and check:

$env:VULKAN_SDK
$env:VK_SDK_PATH

Expected output should resemble:

C:\VulkanSDK\1.4.350.0

Verify that the Vulkan headers exist:

Test-Path "$env:VULKAN_SDK\Include\vulkan\vulkan.h"

Expected result:

True

Run Vulkan information:

& "$env:VULKAN_SDK\Bin\vulkaninfo.exe" --summary

Run the Vulkan cube:

& "$env:VULKAN_SDK\Bin\vkcube.exe"

A window containing a rotating cube confirms that:

  • The Vulkan runtime is installed
  • A Vulkan-capable GPU was detected
  • The graphics driver supports Vulkan
  • The SDK tools can communicate with the Vulkan runtime

If vkcube cannot create a Vulkan device, update the GPU driver directly from NVIDIA, AMD or Intel.

4. Add the Vulkan Variables Manually When Required

The installer should configure these variables automatically. VulkanSceneGraph’s Windows installation documentation also expects VULKAN_SDK and VK_SDK_PATH to be available.

Only configure them manually if they are missing or incorrect.

Press:

Win + R

Enter:

sysdm.cpl

Open:

Advanced
→ Environment Variables

Under System variables, add:

Variable name: VULKAN_SDK
Variable value: C:\VulkanSDK\<version>

Add:

Variable name: VK_SDK_PATH
Variable value: C:\VulkanSDK\<version>

Edit the system Path variable and add:

%VULKAN_SDK%\Bin

Close all existing command prompts and PowerShell windows, then open a new PowerShell session.

Verify again:

$env:VULKAN_SDK
$env:VK_SDK_PATH
& "$env:VULKAN_SDK\Bin\vulkaninfo.exe" --summary

5. Are PowerShell $env: Changes Permanent?

No.

A command such as:

$env:VSG_FILE_PATH = "C:\Dev\vsg-stack\src\vsgExamples\data"

changes the environment variable only for the current PowerShell process.

The value is available to:

  • The current PowerShell session
  • Applications started from that session
  • Child processes started from that session

It disappears when that PowerShell process closes.

This is called Process scope.

The following changes are also temporary:

$env:CMAKE_PREFIX_PATH = "C:\Qt\6.11.0\msvc2022_64;C:\Dev\vsg-stack\install"
$env:PATH = "C:\Dev\vsg-stack\install\bin;$env:PATH"

Ordinary PowerShell variables are temporary as well:

$QtRoot = "C:\Qt\6.11.0\msvc2022_64"
$BuildRoot = "C:\Dev\vsg-stack\build"

They exist only in the current PowerShell session.

Persistent user environment variable

To store a variable for the current Windows user:

[Environment]::SetEnvironmentVariable(
"VARIABLE_NAME",
"VARIABLE_VALUE",
"User"
)

Persistent system environment variable

To store a variable for all users, run PowerShell as administrator:

[Environment]::SetEnvironmentVariable(
"VARIABLE_NAME",
"VARIABLE_VALUE",
"Machine"
)

User- and Machine-scoped environment variables persist outside the current process. Windows also stores variables configured through the Environment Variables control panel persistently.

Persistent changes affect newly launched applications. They do not automatically update terminals that are already open.

What should be permanent?

For this setup:

VULKAN_SDK    Persistent, normally created by the installer
VK_SDK_PATH Persistent, normally created by the installer

The following are better kept temporary:

CMAKE_PREFIX_PATH
VSG_FILE_PATH
QT_PLUGIN_PATH
Temporary additions to PATH
Qt installation paths
VSG build and installation paths

Keeping these values session-local prevents another project from accidentally loading the wrong Qt or VSG DLLs.

6. Import the Visual Studio x64 Environment into PowerShell

MSVC depends on environment variables such as:

PATH
INCLUDE
LIB
LIBPATH
VCToolsInstallDir
WindowsSdkDir

These should not be assembled manually.

Visual Studio provides scripts such as:

vcvarsall.bat
VsDevCmd.bat
Launch-VsDevShell.ps1

They configure the compiler, linker, Windows SDK and associated build tools.

Simple option: start PowerShell from the Native Tools prompt

Search the Start menu for:

x64 Native Tools Command Prompt for VS 2026

For Visual Studio 2022:

x64 Native Tools Command Prompt for VS 2022

Open it and run:

pwsh

PowerShell is launched as a child process and inherits the configured Visual Studio environment.

Verify it:

cl
where.exe cl
$env:VSCMD_VER
$env:VCToolsInstallDir

This works, but I prefer opening a normal PowerShell window and importing the Visual Studio environment only when I need it.

7. My PowerShell Utility for Importing the Visual Studio Environment

I use a small PowerShell function that:

  1. Finds Visual Studio using Microsoft’s vswhere.exe
  2. Locates vcvarsall.bat
  3. Runs the requested developer environment
  4. Captures the environment created by the batch script
  5. Imports it into the current PowerShell process

Using vswhere.exe avoids hardcoding paths such as:

C:\Program Files\Microsoft Visual Studio\18\Community

It also supports Community, Professional, Enterprise, Build Tools and custom installation locations.

The utility supports:

x64
x86
ARM64

It can also select a particular Visual Studio version.

The version ranges are:

Visual Studio 2026: [18.0,19.0)
Visual Studio 2022: [17.0,18.0)

Microsoft’s vswhere documentation maps Visual Studio 2026 to version 18 and Visual Studio 2022 to version 17.

The utility function

function Import-VSDevEnvironment {
[CmdletBinding()]
param(
[ValidateSet("x64", "x86", "arm64")]
[string]$Architecture = "x64",
# Examples:
# Visual Studio 2026: "[18.0,19.0)"
# Visual Studio 2022: "[17.0,18.0)"
[string]$VersionRange,
# Include preview or prerelease Visual Studio installations.
[switch]$Prerelease
)
$vswhere = Join-Path `
${env:ProgramFiles(x86)} `
"Microsoft Visual Studio\Installer\vswhere.exe"
if (!(Test-Path $vswhere)) {
throw "vswhere.exe was not found at: $vswhere"
}
$vswhereArguments = @(
"-latest",
"-products", "*",
"-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"-property", "installationPath"
)
if (![string]::IsNullOrWhiteSpace($VersionRange)) {
$vswhereArguments += @(
"-version",
$VersionRange
)
}
if ($Prerelease) {
$vswhereArguments += "-prerelease"
}
$installationPath = (
& $vswhere @vswhereArguments |
Select-Object -First 1
)
if ([string]::IsNullOrWhiteSpace($installationPath)) {
throw "No matching Visual Studio installation with C++ tools was found."
}
$installationPath = $installationPath.Trim()
$vcvarsall = Join-Path `
$installationPath `
"VC\Auxiliary\Build\vcvarsall.bat"
if (!(Test-Path $vcvarsall)) {
throw "vcvarsall.bat was not found at: $vcvarsall"
}
# vcvarsall uses these architecture names.
$vcvarsArchitecture = switch ($Architecture) {
"x64" {
"amd64"
}
"x86" {
"x86"
}
"arm64" {
"amd64_arm64"
}
}
$command = "`"$vcvarsall`" $vcvarsArchitecture >nul && set"
$environmentDump = & $env:ComSpec /d /s /c $command
if ($LASTEXITCODE -ne 0) {
throw "vcvarsall.bat failed with exit code $LASTEXITCODE."
}
foreach ($line in $environmentDump) {
$separatorIndex = $line.IndexOf("=")
# Ignore malformed lines and cmd.exe pseudo-variables such as =C:.
if ($separatorIndex -le 0) {
continue
}
$name = $line.Substring(0, $separatorIndex)
$value = $line.Substring($separatorIndex + 1)
Set-Item `
-Path "Env:$name" `
-Value $value
}
$compilerLine = (
& cl 2>&1 |
Select-Object -First 1
)
Write-Host `
"Visual Studio developer environment loaded." `
-ForegroundColor Green
Write-Host "Architecture: $Architecture"
Write-Host "Installation: $installationPath"
Write-Host "VS version: $env:VisualStudioVersion"
Write-Host "Compiler: $compilerLine"
}

The function imports variables only into the current PowerShell process.

It does not modify the permanent system environment.

8. Option A: Use the Utility Temporarily

Readers who do not want to modify their PowerShell profile can use the function temporarily.

Paste the entire function into the current PowerShell window.

Then run:

Import-VSDevEnvironment -Architecture x64

To specifically use Visual Studio 2026:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[18.0,19.0)"

To specifically use Visual Studio 2022:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[17.0,18.0)"

Verify it:

cl
where.exe cl
$env:VSCMD_VER
$env:VisualStudioVersion
$env:VSINSTALLDIR
$env:VCToolsInstallDir

The function definition and imported compiler environment disappear when the PowerShell window closes.

This is useful when:

  • You are only testing the setup
  • You do not regularly compile with MSVC
  • You do not want to edit $PROFILE
  • You are running the commands on another computer

9. Option B: Save the Utility in $PROFILE

I keep the function in my PowerShell profile so that it is available whenever I open PowerShell.

A PowerShell profile is a script that runs when PowerShell starts. It can contain functions, variables, aliases and other shell customizations. $PROFILE refers to the current user and current PowerShell host profile.

Check the profile path

$PROFILE

Create the profile if it does not exist

if (!(Test-Path $PROFILE)) {
New-Item `
-ItemType File `
-Path $PROFILE `
-Force
}

Open it in Notepad

notepad $PROFILE

Or open it in Visual Studio Code:

code $PROFILE

Paste the complete Import-VSDevEnvironment function into the file and save it.

Reload the profile without restarting PowerShell:

. $PROFILE

The first dot is the PowerShell dot-source operator.

Now call the function:

Import-VSDevEnvironment -Architecture x64

For Visual Studio 2026 specifically:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[18.0,19.0)"

Important distinction

Saving the function in $PROFILE makes the function definition available in future PowerShell sessions.

It does not make the imported Visual Studio environment permanent.

Each time you open a new terminal and need MSVC, run:

Import-VSDevEnvironment -Architecture x64

The compiler environment remains active only until that PowerShell session closes.

I prefer this behaviour because not every terminal needs the large Visual Studio environment added to it.

Optional automatic activation

You could add this after the function in $PROFILE:

Import-VSDevEnvironment -Architecture x64

That would activate MSVC every time PowerShell starts.

I do not recommend doing this unless nearly every terminal session is used for C++ development. Calling the function manually keeps normal shell startup cleaner.

PowerShell 7 and Windows PowerShell use different profiles

PowerShell 7 and Windows PowerShell 5.1 do not necessarily load the same profile.

Run:

$PROFILE

inside the exact shell where you want the function to be available.

Also remember that:

pwsh -NoProfile

starts PowerShell without loading the profile.

10. Verify the Active Visual Studio Version

After importing the environment, check:

$env:VisualStudioVersion

Expected values include:

18.0

for Visual Studio 2026, or:

17.0

for Visual Studio 2022.

Check the compiler:

cl

Check its location:

where.exe cl

Check CMake:

cmake --version

Check Git:

git --version

Visual Studio 2026 CMake requirement

The Visual Studio 2026 CMake generator is:

Visual Studio 18 2026

It was added in CMake 4.2. Visual Studio 2026 uses the v145 toolset by default, although another installed toolset can be selected with CMake’s -T argument.

Check whether your CMake installation supports it:

cmake --help |
Select-String "Visual Studio 18 2026"

If nothing is returned, update CMake.

11. Select the Correct CMake Generator Automatically

Instead of hardcoding Visual Studio 2022 or Visual Studio 2026 throughout the article, detect the active version:

$CMakeGenerator = switch -Regex ($env:VisualStudioVersion) {
"^18\." {
"Visual Studio 18 2026"
break
}
    "^17\." {
"Visual Studio 17 2022"
break
}
default {
throw "Unsupported or uninitialized Visual Studio version: $env:VisualStudioVersion"
}
}

Display the selected generator:

$CMakeGenerator

Verify that CMake knows it:

if (
-not (
cmake --help |
Select-String `
-SimpleMatch `
$CMakeGenerator
)
) {
throw "CMake does not support the generator: $CMakeGenerator"
}

Select the platform toolset

Use the default toolset:

$CMakeToolset = $null

On Visual Studio 2026, this normally selects v145.

To use the MSVC 2022 toolset installed inside Visual Studio 2026:

$CMakeToolset = "v143"

Prepare the generator arguments:

$GeneratorArguments = @(
"-G", $CMakeGenerator,
"-A", "x64"
)
if (![string]::IsNullOrWhiteSpace($CMakeToolset)) {
$GeneratorArguments += @(
"-T",
$CMakeToolset
)
}

Display them:

$GeneratorArguments

For Visual Studio 2026 with the default toolset, the arguments represent:

-G "Visual Studio 18 2026" -A x64

For Visual Studio 2026 with v143, they represent:

-G "Visual Studio 18 2026" -A x64 -T v143

For Visual Studio 2022:

-G "Visual Studio 17 2022" -A x64

12. Create a Clean Directory Structure

Keeping source code, build output and installed libraries separate makes the setup easier to understand, update and remove later.

Create the root directories:

$VsgRoot = "C:\Dev\vsg-stack"
$SourceRoot = "$VsgRoot\src"
$BuildRoot = "$VsgRoot\build"
$InstallRoot = "$VsgRoot\install"
New-Item `
-ItemType Directory `
-Force `
$SourceRoot, `
$BuildRoot, `
$InstallRoot

The resulting structure is:

C:\Dev\vsg-stack
├── src
├── build
└── install

We will install both VulkanSceneGraph and vsgQt into:

C:\Dev\vsg-stack\install

Using a custom installation prefix:

  • Avoids administrator permissions
  • Keeps dependencies together
  • Makes the setup easy to remove
  • Prevents files from being scattered through Program Files

13. Download and Install Qt

Download the Qt Online Installer:

Download Qt

Run the installer and select:

Custom Installation

Qt 6

Select a Qt 6 version and an MSVC x64 package.

Get John Nirmal’s stories in your inbox

Join Medium for free to get updates from this writer.

For example:

Qt
└── Qt 6.11.x
└── MSVC 2022 64-bit

The installation directory will resemble:

C:\Qt\6.11.0\msvc2022_64

Qt 6.11’s current Windows support table lists MSVC 2022 and MinGW-w64 13.1 for x86–64 Windows.

Qt 5

vsgQt supports Qt 5, and its current CMake configuration specifically notes Qt 5.10 or later for Qt 5 builds.

Depending on the Qt 5 version, the installed directory may resemble:

C:\Qt\5.15.x\msvc2019_64

Qt 5 package availability and compiler names depend on the version available through the installer or archive.

Do not mix MSVC and MinGW

Do not select a MinGW Qt package when compiling VSG and vsgQt with MSVC.

For example, do not combine:

MSVC-built VulkanSceneGraph
MSVC-built vsgQt
MinGW-built Qt

All C++ components should use a compatible compiler family, architecture and runtime.

Required Qt module

vsgQt requires:

Qt Widgets

Qt Creator is optional because this guide builds everything from PowerShell.

14. Define the Qt Path

For Qt 6:

$QtRoot = "C:\Qt\6.11.0\msvc2022_64"
$QtPackage = "Qt6"

For Qt 5:

$QtRoot = "C:\Qt\5.15.x\msvc2019_64"
$QtPackage = "Qt5"

Replace the paths with your actual installation.

Check the directory:

Test-Path $QtRoot

Check the Qt CMake package:

Test-Path "$QtRoot\lib\cmake\$QtPackage"

Expected result:

True

Add Qt to the current PowerShell session:

$env:PATH = "$QtRoot\bin;$env:PATH"

Set the plugin path for the current session:

$env:QT_PLUGIN_PATH = "$QtRoot\plugins"

These changes are temporary.

Avoid permanently adding several Qt installations to the Windows system Path. Otherwise, an application can load DLLs or plugins from the wrong Qt version.

15. Download VulkanSceneGraph

Clone the official repository:

VulkanSceneGraph on GitHub

Set-Location $SourceRoot
git clone `
https://github.com/vsg-dev/VulkanSceneGraph.git

The source directory is:

C:\Dev\vsg-stack\src\VulkanSceneGraph

VulkanSceneGraph requires a C++17-capable compiler and uses the Vulkan SDK on Windows. Its official Windows installation guide also recommends installing VSG to a known prefix and adding that prefix to CMAKE_PREFIX_PATH for downstream projects.

16. Configure VulkanSceneGraph

Configure the project using the generator selected from the active Visual Studio environment:

cmake `
@GeneratorArguments `
-S "$SourceRoot\VulkanSceneGraph" `
-B "$BuildRoot\VulkanSceneGraph" `
-DBUILD_SHARED_LIBS=ON `
"-DCMAKE_INSTALL_PREFIX=$InstallRoot"

The important options are:

-S

Specifies the source directory.

-B

Specifies the build directory.

-G

Selects the Visual Studio generator.

-A x64

Targets 64-bit Windows.

-T v143

Optionally selects the v143 toolset.

-DBUILD_SHARED_LIBS=ON

Builds shared libraries and DLLs.

-DCMAKE_INSTALL_PREFIX

Controls where the compiled libraries, headers and CMake package files are installed.

17. Build and Install VulkanSceneGraph

Build the Release configuration:

cmake `
--build "$BuildRoot\VulkanSceneGraph" `
--config Release `
--parallel

Install it:

cmake `
--install "$BuildRoot\VulkanSceneGraph" `
--config Release

The installation directory should now contain folders such as:

C:\Dev\vsg-stack\install
├── bin
├── include
├── lib
└── share

Check for the VSG CMake configuration:

Get-ChildItem `
$InstallRoot `
-Recurse `
-Filter "vsgConfig.cmake"

If a result is returned, downstream CMake projects can discover the VSG installation.

Check the installed DLLs:

Get-ChildItem `
"$InstallRoot\bin" `
-Filter "*.dll"

18. Prepare CMAKE_PREFIX_PATH

vsgQt needs to find:

  • Qt
  • VulkanSceneGraph

Create a prefix path containing both installation directories:

$CMakePrefixPath = "$QtRoot;$InstallRoot"

Set it for the current PowerShell process:

$env:CMAKE_PREFIX_PATH = $CMakePrefixPath

Inspect it:

$env:CMAKE_PREFIX_PATH

Expected output resembles:

C:\Qt\6.11.0\msvc2022_64;C:\Dev\vsg-stack\install

This environment variable is temporary.

The commands below also pass the prefix directly to CMake, which makes the build configuration easier to reproduce.

19. Download vsgQt

Clone the official repository:

vsgQt on GitHub

Set-Location $SourceRoot
git clone `
https://github.com/vsg-dev/vsgQt.git

vsgQt provides Qt integration for VulkanSceneGraph on Windows, Linux and macOS. Its examples include a single Qt main window, an MDI interface and multiple VSG windows.

The examples are:

vsgqtviewer
QApplication and QMainWindow with one vsgQt::Window
vsgqtmdi
QMdiArea with multiple vsgQt::Window instances
vsgqtwindows
Multiple independent vsgQt::Window instances

The single-window vsgqtviewer example is the best starting point.

20. Configure vsgQt for Qt 6 or Qt 5

The current vsgQt build configuration uses:

QT_PACKAGE_NAME

Accepted values are:

Qt5
Qt6

The default is currently Qt5, so explicitly select Qt6 when building with Qt 6. The current source also builds examples by default through VSGQT_BUILD_EXAMPLES.

Configure vsgQt:

cmake `
@GeneratorArguments `
-S "$SourceRoot\vsgQt" `
-B "$BuildRoot\vsgQt" `
-DBUILD_SHARED_LIBS=ON `
-DVSGQT_BUILD_EXAMPLES=ON `
"-DQT_PACKAGE_NAME=$QtPackage" `
"-DCMAKE_PREFIX_PATH=$CMakePrefixPath" `
"-DCMAKE_INSTALL_PREFIX=$InstallRoot"

For Qt 6, this passes:

-DQT_PACKAGE_NAME=Qt6

For Qt 5:

-DQT_PACKAGE_NAME=Qt5

During configuration, check that CMake finds:

Vulkan
vsg
Qt5 or Qt6
Qt Widgets

The current vsgQt source requires VulkanSceneGraph 1.1.13 or later, so building the current VSG source before vsgQt keeps the versions aligned.

21. Build and Install vsgQt

Build the Release configuration:

cmake `
--build "$BuildRoot\vsgQt" `
--config Release `
--parallel

Install it:

cmake `
--install "$BuildRoot\vsgQt" `
--config Release

Find the viewer executable:

$Viewer = Get-ChildItem `
-Path "$BuildRoot\vsgQt", $InstallRoot `
-Recurse `
-Filter "vsgqtviewer.exe" `
-ErrorAction SilentlyContinue |
Select-Object -First 1

Verify that it was found:

if (!$Viewer) {
throw "vsgqtviewer.exe was not found."
}
$Viewer.FullName

22. Download Assets for Testing

The vsgqtviewer application requires the path to a 3D model or image on the command line. If no asset is supplied, it prints an error and exits.

Clone the official examples repository:

vsgExamples on GitHub

Set-Location $SourceRoot
git clone `
--depth 1 `
https://github.com/vsg-dev/vsgExamples.git

You do not need to compile the examples just to use their assets.

The data directory is:

C:\Dev\vsg-stack\src\vsgExamples\data

Available native VSG models include:

models\lz.vsgt
models\openstreetmap.vsgt
models\skybox.vsgt
models\teapot.vsgt

These files are present in the official vsgExamples/data/models directory.

Set VSG_FILE_PATH for the current session:

$env:VSG_FILE_PATH = "$SourceRoot\vsgExamples\data"

VSG uses this path when resolving referenced scene resources.

23. Configure Runtime DLL Paths

Before running the viewer, add the required runtime directories to the current process:

$env:PATH = @(
"$QtRoot\bin"
"$InstallRoot\bin"
"$env:VULKAN_SDK\Bin"
$env:PATH
) -join ";"

Set the Qt plugin path:

$env:QT_PLUGIN_PATH = "$QtRoot\plugins"

Set the VSG data path:

$env:VSG_FILE_PATH = "$SourceRoot\vsgExamples\data"

These changes exist only in the current PowerShell session.

That is intentional. It prevents permanent mixing of:

  • Different Qt versions
  • Different VSG builds
  • Debug and Release libraries
  • MSVC and MinGW libraries
  • Different Visual Studio toolsets

24. Run the vsgQt Viewer

Run the landing-zone model:

& $Viewer.FullName `
"$SourceRoot\vsgExamples\data\models\lz.vsgt"

Run the teapot model:

& $Viewer.FullName `
"$SourceRoot\vsgExamples\data\models\teapot.vsgt"

The application should open a Qt QMainWindow containing a VulkanSceneGraph rendering surface.

The official example creates:

  1. A QApplication
  2. A QMainWindow
  3. A vsgQt::Viewer
  4. A vsgQt::Window
  5. A widget container using QWidget::createWindowContainer()

The container is then assigned as the main window’s central widget.

The example also adds a VSG trackball handler, allowing the scene to be inspected interactively.

At this point:

  • Qt owns the desktop window
  • Qt owns the application event loop
  • VSG owns the Vulkan rendering architecture
  • vsgQt connects the two systems

25. Enable Vulkan Validation

Run the viewer with:

& $Viewer.FullName `
--debug `
"$SourceRoot\vsgExamples\data\models\lz.vsgt"

The short option is:

& $Viewer.FullName `
-d `
"$SourceRoot\vsgExamples\data\models\lz.vsgt"

The current vsgqtviewer source maps --debug and -d to the Vulkan debug-layer option.

Validation layers can detect:

  • Invalid Vulkan object usage
  • Incorrect resource lifetimes
  • Invalid command-buffer operations
  • Descriptor errors
  • Synchronization problems
  • Incorrect API usage

Validation adds overhead, so it should normally be disabled in production builds.

26. Common Problems

Import-VSDevEnvironment is not recognized

The function is not loaded in the current PowerShell session.

If it is stored in $PROFILE, reload the profile:

. $PROFILE

Then run:

Import-VSDevEnvironment -Architecture x64

If the function is not saved, paste the complete function into the current terminal first.

$PROFILE exists, but the function does not load

Check the current profile path:

$PROFILE

You may have saved the function in the Windows PowerShell profile but opened PowerShell 7, or the reverse.

Open the active profile:

notepad $PROFILE

Also confirm that PowerShell was not started with:

-NoProfile

PowerShell blocks the profile script

Check the current execution policies:

Get-ExecutionPolicy -List

When appropriate for your machine, allow locally created scripts for the current user:

Set-ExecutionPolicy `
-Scope CurrentUser `
-ExecutionPolicy RemoteSigned

Review your organization’s security policy before changing execution-policy settings.

vswhere.exe is missing

Verify:

Test-Path `
"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"

If it is missing, repair or update the Visual Studio Installer.

The wrong Visual Studio version is selected

Select Visual Studio 2026 explicitly:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[18.0,19.0)"

Select Visual Studio 2022 explicitly:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[17.0,18.0)"

Check:

$env:VisualStudioVersion
$env:VSINSTALLDIR
where.exe cl

cl is not recognized

The developer environment was not imported.

Run:

Import-VSDevEnvironment -Architecture x64

Then verify:

cl
where.exe cl

CMake does not recognize Visual Studio 18 2026

Check:

cmake --version

The Visual Studio 18 2026 generator requires CMake 4.2 or later.

Verify the generator:

cmake --help |
Select-String "Visual Studio 18 2026"

Update CMake if it is absent.

CMake selects the wrong Visual Studio generator

Recreate the generator variable after importing the environment:

$CMakeGenerator = switch -Regex ($env:VisualStudioVersion) {
"^18\." {
"Visual Studio 18 2026"
break
}
    "^17\." {
"Visual Studio 17 2022"
break
}
default {
throw "Unsupported Visual Studio version."
}
}

Delete the old build directories before changing generators:

Remove-Item `
"$BuildRoot\VulkanSceneGraph" `
-Recurse `
-Force `
-ErrorAction SilentlyContinue
Remove-Item `
"$BuildRoot\vsgQt" `
-Recurse `
-Force `
-ErrorAction SilentlyContinue

CMake does not allow an existing build directory to be reused with a different generator.

The v143 toolset cannot be found

If you set:

$CMakeToolset = "v143"

make sure the v143 component is installed through Visual Studio Installer.

Otherwise, use the default Visual Studio toolset:

$CMakeToolset = $null

Recreate $GeneratorArguments after changing the value.

CMake cannot find Vulkan

Check:

$env:VULKAN_SDK
$env:VK_SDK_PATH
Test-Path `
"$env:VULKAN_SDK\Include\vulkan\vulkan.h"

Restart PowerShell after installing or changing the Vulkan SDK.

Delete the old VSG build directory:

Remove-Item `
"$BuildRoot\VulkanSceneGraph" `
-Recurse `
-Force

Then configure again.

CMake cannot find Qt 6

Check:

$QtRoot
Test-Path `
"$QtRoot\lib\cmake\Qt6"

Make sure the selected package is an MSVC x64 Qt package and not a MinGW package.

Check the prefix:

$CMakePrefixPath

It should contain both:

Qt installation path
VSG installation path

vsgQt finds Qt 5 instead of Qt 6

Explicitly set:

$QtPackage = "Qt6"

The configure command must contain:

-DQT_PACKAGE_NAME=Qt6

Delete the previous vsgQt build directory:

Remove-Item `
"$BuildRoot\vsgQt" `
-Recurse `
-Force

Then configure it again.

vsgQt currently defaults QT_PACKAGE_NAME to Qt5.

CMake cannot find VulkanSceneGraph

Verify that VSG was installed:

Get-ChildItem `
$InstallRoot `
-Recurse `
-Filter "vsgConfig.cmake"

Check:

$env:CMAKE_PREFIX_PATH

It should include:

C:\Dev\vsg-stack\install

The application reports a missing Qt DLL

Add Qt’s binary directory to the current process:

$env:PATH = "$QtRoot\bin;$env:PATH"

Check:

where.exe Qt6Core.dll
where.exe Qt6Widgets.dll

For Qt 5:

where.exe Qt5Core.dll
where.exe Qt5Widgets.dll

The application cannot find the Qt platform plugin

Set:

$env:QT_PLUGIN_PATH = "$QtRoot\plugins"

Check that the Windows platform plugin exists:

Test-Path `
"$QtRoot\plugins\platforms\qwindows.dll"

For deployment, use Qt’s windeployqt utility rather than depending on development-machine environment variables.

The application reports a missing VSG DLL

Add the installation directory:

$env:PATH = "$InstallRoot\bin;$env:PATH"

Inspect it:

Get-ChildItem `
"$InstallRoot\bin" `
-Filter "*.dll"

Make sure the executable and libraries use the same configuration:

Release executable → Release libraries
Debug executable → Debug libraries

Do not mix Debug and Release DLLs.

The viewer opens and immediately closes

Run it from PowerShell instead of double-clicking it.

The viewer requires an asset argument:

& $Viewer.FullName `
"$SourceRoot\vsgExamples\data\models\lz.vsgt"

Without an asset, the example intentionally prints a message and exits.

The viewer cannot load the model

Check:

Test-Path `
"$SourceRoot\vsgExamples\data\models\lz.vsgt"

Set:

$env:VSG_FILE_PATH = "$SourceRoot\vsgExamples\data"

Then run the viewer again.

The application loads the wrong Qt DLL

Check all matching DLLs currently visible through Path:

where.exe Qt6Core.dll
where.exe Qt5Core.dll

Inspect the current path:

$env:PATH -split ";"

Remove unrelated Qt installations from the current session or open a clean PowerShell window.

This problem commonly occurs when several Qt, MinGW or development-tool installations have been added permanently to the system Path.

Switching between Visual Studio versions

Do not repeatedly import Visual Studio 2022, Visual Studio 2026, x86 and x64 environments into the same PowerShell process.

Open a fresh PowerShell window, then import the required environment:

Import-VSDevEnvironment `
-Architecture x64 `
-VersionRange "[18.0,19.0)"

A clean process prevents duplicated or mixed compiler paths.

27. Final Directory Layout

After completing the guide, the directory structure should resemble:

C:\Dev\vsg-stack
├── src
│ ├── VulkanSceneGraph
│ ├── vsgQt
│ └── vsgExamples
│ └── data
│ └── models
│ ├── lz.vsgt
│ ├── skybox.vsgt
│ └── teapot.vsgt
│
├── build
│ ├── VulkanSceneGraph
│ └── vsgQt
│
└── install
├── bin
├── include
├── lib
└── share

The dependency flow is:

Visual Studio C++ toolchain
↓
Vulkan SDK
↓
VulkanSceneGraph
↓
vsgQt
↓
Qt desktop application

At runtime:

Qt
├── Application event loop
├── Main window
├── Menus
├── Toolbars
├── Dock panels
└── Window container
VulkanSceneGraph
├── Vulkan device
├── Rendering
├── Scene graph
├── Cameras
├── GPU resources
└── Scene interaction

Conclusion

Setting up Qt and VulkanSceneGraph on Windows involves more than downloading two libraries.

The compiler, architecture, Qt package, CMake generator, toolset, build configuration and runtime libraries must agree.

A typical Visual Studio 2026 configuration is:

Architecture:   x64
Visual Studio: Visual Studio 2026
Generator: Visual Studio 18 2026
Toolset: v145 or installed v143
Qt package: msvc2022_64
Configuration: Release

A Visual Studio 2022 configuration is:

Architecture:   x64
Visual Studio: Visual Studio 2022
Generator: Visual Studio 17 2022
Toolset: v143
Qt package: msvc2022_64
Configuration: Release

The PowerShell utility keeps the workflow convenient without permanently modifying the compiler environment.

I keep Import-VSDevEnvironment in $PROFILE, then activate the x64 compiler environment only when needed:

Import-VSDevEnvironment -Architecture x64

The function is permanently available through the profile, but the compiler environment remains local to the current terminal session.

Once the toolchain is aligned, vsgQt provides a clean boundary between a conventional Qt desktop application and a Vulkan-native rendering system.

Qt remains responsible for:

  • Application structure
  • Native desktop UI
  • Tools and panels
  • User interaction
  • Window management
  • Cross-platform application behaviour

VulkanSceneGraph remains responsible for:

  • Vulkan rendering
  • Scene graph management
  • GPU resources
  • Cameras and views
  • Rendering performance
  • Complex 3D scenes

The result is not a replacement for Qt.

It is a way to give a Qt desktop application a dedicated Vulkan scene graph without rebuilding an entire desktop framework around the renderer.

  • vsgQt to embed a VSG rendering window inside a Qt application

--

--