Porting a Qt Project to WebAssembly: Challenges and Solutions

In this post, I describe porting a small application, a calculator called SpeedCrunch, to WebAssembly and some common issues that need to be addressed. I hope you may find some solutions helpful and save time should you want to target the WebAssembly platform with your code.

For those eager to see the result, the application is available here: SpeedCrunch (WebAssembly)

I have also compiled and bundled a new Windows version (with all my changes included): /files/speedcrunch/speedcrunch-0.12.1.zip

Introduction

Porting a Qt application to WebAssembly (WASM) presented some unique challenges. Qt, known for its cross-platform capabilities, initially posed difficulties when targeting WebAssembly, but improved support in later versions smoothed the process. Announced in 2015 and first released in March 2017, WebAssembly was added as an officially supported target to Qt with Qt 5.13.

The application I wanted to port is a small but highly practical calculator called SpeedCrunch. The desktop version was my trusted companion for more than a decade, particularly for work involving binary number manipulation, thanks to its efficient binary digits editor. This feature was invaluable for working with binary representations, a common task in my professional workflow as a CPU architect. Beyond work, I also used the application for various personal calculations.

Click to enlarge the image.

Continue reading

Software

Windows PC

GitForce is a visual front-end to git: https://sites.google.com/site/gitforcetool/home

Z80 Explorer is a Zilog Z80 netlist-level simulator: https://baltazarstudios.com/z80explorer

Android

PlayZX is a Sinclair retro games converter/player: https://baltazarstudios.com/playzx

Flight Sim Remote Player is an X-Plane’s GA instrument panel: https://baltazarstudios.com/flight-sim-remote-panel

Linux

LinICE is a source-level kernel debugger: https://sites.google.com/site/linicetool (obsolete)

Flight Sim Remote Panel / 2

Flight Sim Remote Panel (or its alias name, “XPlaneRemote”) is an application that shows the basic general aviation instrument set on your Android phone or tablet. It is not a flight simulator – a copy of X-Plane 11 should be running on your desktop or a laptop – this application connects to it from an Android device and displays the flight instruments, hence the “remote panel” in its name.

Continue reading

PlayZX

PlayZX is an Android application that lets you select from thousands of Sinclair ZX Spectrum games and play them through the headphone jack to load them onto your Speccy. You can also select your local (on the device) files, convert them to sound files, and then play them. This way, you can load games for the ZX Spectrum micro and a few other retro computers with a compatible audio jack. 

Continue reading