Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Qt C++ ToolsNew to Visual Studio Code? Get it now.
Qt C++ Tools

Qt C++ Tools

Akhil Pawar

|
8 installs
| (0) | Free
Build, run and manage Qt C++ projects in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Qt C++ Tools for VS Code

A comprehensive VS Code extension that brings Qt Creator's essential features to Visual Studio Code, making it Qt C++ developer-friendly on Windows.

Features

🔨 Build System Integration

  • Auto-detect Qt Projects: Automatically finds .pro (QMake) and CMakeLists.txt (CMake) Qt projects
  • Build Commands: Build, Clean, and Rebuild your Qt projects with a single command
  • Run Projects: Execute built applications directly from VS Code
  • Smart Detection: Automatically detects Qt installation paths and compiler toolchains (MSVC/MinGW)

🎯 Available Commands

Access these commands via Command Palette (Ctrl+Shift+P):

  • Qt: Build Project - Build the current Qt project
  • Qt: Clean Project - Clean build artifacts
  • Qt: Rebuild Project - Clean and rebuild
  • Qt: Run Project - Run the built executable
  • Qt: Configure Qt Installation Path - Manually set Qt path
  • Qt: Select Qt Version - Choose from detected Qt installations
  • Qt: Create New QMake Project - Create a new QMake-based project (coming soon)
  • Qt: Create New CMake Project - Create a new CMake-based project (coming soon)

⚙️ Configuration

Configure the extension via VS Code settings (File > Preferences > Settings or Ctrl+,):

{
  "qt.qmakePath": "",                              // Path to qmake.exe (auto-detected if empty)
  "qt.qtInstallPath": "",                          // Qt installation directory (auto-detected if empty)
  "qt.autoDetect": "on",                           // Auto-detect Qt projects
  "qt.buildDirectory": "${workspaceFolder}/build", // Build output directory
  "qt.defaultBuildType": "debug",                  // debug or release
  "qt.makeCommand": "auto",                        // auto, nmake, mingw32-make, jom, or make
  "qt.additionalQMakeArguments": "",              // Extra qmake arguments
  "qt.additionalCMakeArguments": "",              // Extra CMake arguments
  "qt.showBuildOutput": true,                     // Show build output
  "qt.clearOutputBeforeBuild": true               // Clear terminal before build
}

Requirements

Software Requirements

  • VS Code: Version 1.85.0 or higher
  • Node.js: Version 18.x or higher (for development only)
  • Qt: Qt 5.x or Qt 6.x installation
  • Compiler:
    • MSVC (Visual Studio 2017/2019/2022) or
    • MinGW (typically bundled with Qt)

Qt Installation Detection

The extension automatically searches for Qt in:

  • Configured paths (qt.qmakePath or qt.qtInstallPath)
  • QTDIR environment variable
  • System PATH
  • Common installation directories:
    • C:\Qt
    • C:\Program Files\Qt
    • %USERPROFILE%\Qt

Installation

Method 1: From VSIX (Recommended for Testing)

  1. Build and Install Using Script:

    # Navigate to extension directory
    cd "C:\Users\Akhil\OneDrive\Documents\Github Projects\Qt-VSC-Extension"
    
    # Run installation script
    .\install.ps1
    
  2. Restart VS Code or reload window (Ctrl+Shift+P → "Reload Window")

Method 2: Manual Installation

  1. Install Dependencies:

    npm install
    
  2. Compile TypeScript:

    npm run compile
    
  3. Package Extension:

    npm run package
    
  4. Install VSIX:

    code --install-extension qt-vsc-extension-0.0.1.vsix --force
    

Method 3: Development Mode

For development and testing:

  1. Open this folder in VS Code
  2. Press F5 to launch Extension Development Host
  3. Test the extension in the new window

Quick Start

For Existing Qt Projects

  1. Open Your Qt Project:

    • Open a folder containing .pro or CMakeLists.txt files
  2. Build Your Project:

    • Press Ctrl+Shift+P
    • Type "Qt: Build Project"
    • Or use Ctrl+Shift+B to see all build tasks
  3. Run Your Application:

    • Press Ctrl+Shift+P
    • Type "Qt: Run Project"

Configure Qt Path (if not auto-detected)

  1. Press Ctrl+Shift+P
  2. Type "Qt: Configure Qt Installation Path"
  3. Navigate to your qmake.exe (e.g., C:\Qt\6.5.0\msvc2019_64\bin\qmake.exe)

Supported Project Types

QMake Projects (.pro files)

  • Standard Qt widget applications
  • Qt Quick/QML applications
  • Qt libraries
  • Subdirs projects

CMake Projects (CMakeLists.txt)

  • Projects using find_package(Qt5 ...) or find_package(Qt6 ...)
  • Projects with CMAKE_AUTOMOC, CMAKE_AUTOUIC, CMAKE_AUTORCC

Extension Architecture

Qt-VSC-Extension/
├── src/
│   ├── extension.ts          # Main extension entry point
│   ├── qtConfigManager.ts    # Qt installation detection & config
│   ├── qtProjectDetector.ts  # Project file scanning & parsing
│   └── qtTaskProvider.ts     # Task provider for build/clean/run
├── package.json              # Extension manifest
├── tsconfig.json            # TypeScript configuration
└── .vscode/
    ├── launch.json          # Debug configuration
    └── tasks.json           # Build tasks

Troubleshooting

Extension Not Finding Qt

  1. Manual Configuration:

    {
      "qt.qmakePath": "C:\\Qt\\6.5.0\\msvc2019_64\\bin\\qmake.exe"
    }
    
  2. Check Output Channel:

    • View → Output
    • Select "Qt C++ Tools" from dropdown
    • Look for detection logs

Build Fails

  1. Verify Compiler:

    • Ensure MSVC or MinGW is installed and accessible
    • For MSVC: Open VS Code from "Developer Command Prompt"
  2. Check Build Directory:

    • Default: ${workspaceFolder}/build
    • Ensure write permissions
  3. Problem Matchers:

    • Extension includes $msCompile, $gcc, and qt-qmake problem matchers
    • Build errors should appear in Problems panel (Ctrl+Shift+M)

Multiple Qt Versions

Use Qt: Select Qt Version command to switch between detected installations.

Roadmap

See ROADMAP.md for a detailed, versioned breakdown of completed features and upcoming work.

Quick summary:

  • ✅ v0.0.1 (Current) — Build, Clean, Rebuild, Run; QMake & CMake support; Qt auto-detection; MSVC/MinGW; Status bar & sidebar UI
  • 🚧 v0.1.0 — Project creation wizards (QMake & CMake)
  • 🚧 v0.2.0 — Qt Designer integration, .ui / .qrc support
  • 🚧 v0.3.0 — windeployqt deployment, IntelliSense helper
  • 🔮 Future — macOS/Linux support, enhanced sidebar, build history

Contributing

This extension is in active development. Contributions, issues, and feature requests are welcome!

Development Setup

  1. Clone the repository
  2. Install dependencies: npm install
  3. Open in VS Code
  4. Press F5 to launch Extension Development Host

Building

npm run compile  # Compile TypeScript
npm run watch    # Watch mode for development
npm run package  # Create .vsix package

License

MIT License - See LICENSE file for details

Credits

Created by Akhil Pawar
Inspired by Qt Creator's workflow

Support

  • Issues: Report bugs or request features via GitHub Issues
  • Documentation: See this README and inline code documentation
  • Output Channel: Check "Qt C++ Tools" output for logs and diagnostics

Happy Qt Development in VS Code! 🚀

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft