Skip to content

Example of a Qt6 component compiled with WebAssembly embeded into a NextJS app

Notifications You must be signed in to change notification settings

waltoss/qt-wasm-nextjs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qt WASM and Next.js integration example

Application Demo

This repository contains an example Qt/WASM project embedded in a Next.js application.

Requirements

Contents

packages/qt-wasm-component

A simple Qt Application

Build the application for Web Assembly

Begin by installing the Qt WebAssembly kit if you don't have it already. This can be done through your Qt installation's maintenance tool. Select macos and wasm (Single thread)

Next, install emscripten version 3.1.25 (required for Qt 6.5.1). It can be installed anywhere on your machine. We recommend installing in your Code folder:

$ cd ~/Code
$ git clone https://github.com/emscripten-core/emsdk.git
$ cd emsdk
$ ./emsdk install 3.1.25
$ ./emsdk activate 3.1.25
$ source emsdk.sh

Set environment variables

$ export QTDIR=/path/to/Qt/6.5.1/wasm_singlethread

Check that $QTDIR and $EMSDK are correctly set before opening VSCode


packages/app

The "Next.js" application with the QtApp component loading the WASM code.

Run it:

$ cd packages/app
$ yarn install
$ yarn run dev

And open a browser at the specified URL. It works!

About

Example of a Qt6 component compiled with WebAssembly embeded into a NextJS app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages