# GUI (Qt6)

## Install QT Creator

{% embed url="<https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4>" %}

Create a Qt account if you don't have one. We are using the Community (Open Source) version of QT. It is free for non-commercial use.

{% hint style="info" %}
If you are upgrading from QT5, you can just open the **MaintenanceTool**, in the Qt Folder, or Start Menu. Add the new checked items below.
{% endhint %}

When you will get to Select Components choose the following options. You can come back and add / remove items later using their maintenance tool if you missed one or added too many.

Under **Select Categories** check **Latest supported releases** and click **Filter**

<figure><img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2F0y9M1MjQwUKg519lqWzD%2Fimage.png?alt=media&#x26;token=45f39d51-d039-4f04-9fd3-abbe2d30926f" alt=""><figcaption></figcaption></figure>

Under **Qt 6.4.1** choose **MinGW 11.2.0 64Bit** and **Qt Serial Port**

<figure><img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2Ffwnbtt9eTyMg1SfDlBDS%2Fimage.png?alt=media&#x26;token=3e2013ca-bd89-4e69-932c-f9b2be1ad0d7" alt=""><figcaption></figcaption></figure>

Under Developer and Designer Tools, add **MinGW 11.2.0 64-bit**

<figure><img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2F2lB1g5ySsUP0wHsezV2S%2Fimage.png?alt=media&#x26;token=59c1e27f-3a88-4dbd-b221-fb87325eb7c7" alt=""><figcaption></figcaption></figure>

Complete the installation wizard.

## Open Qt Creator and Load the Project File

Choose **File -> Open File or Project**&#x20;

{% hint style="info" %}
After cloning the Git repository using these instruction: [Firmware Setup](https://headtracker.gitbook.io/head-tracker-v2.2/support/development/depreciated/firmware).&#x20;

Choose

/src/gui/HeadTracker.pro
{% endhint %}

When you will open it for the first time, it will ask how do you want to configure it. If you have multiple choices be sure to check the **Desktop Qt 6.4.1 MinGW 64-bit option** and click **Configure Project**

<figure><img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2Fz1War6Q5OV9FsU4AfGQU%2Fimage.png?alt=media&#x26;token=c9a88dec-cb32-421f-8ed6-9374e9888f62" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you already had the project compiling on Qt5, just add the new kit from Projects\
\ <img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2FPJ2m6jHBmgKQsd6hAZIc%2Fimage.png?alt=media&#x26;token=58deb01a-1bf2-47a5-a1e5-434942fe05a5" alt="" data-size="original">
{% endhint %}

In Qt set the Release or Debug mode. You will probably want Debug.

<figure><img src="https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2FqK6UT1RvFA5UOfm9eGD0%2Fimage.png?alt=media&#x26;token=aea56178-cd64-4205-8659-9e4add1e1428" alt=""><figcaption></figcaption></figure>

Click the Play Button ![](https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2FkhofRwT9cIGJuilc1eBA%2Fimage.png?alt=media\&token=27414e98-b3ec-4ccc-8030-9121021c366f). It should compile and run the project. Use the Debug Play Button ![](https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FifYnTDP7IFJCZallDj96%2Fuploads%2FgPdXtBAz1MpRZmrky8uO%2Fimage.png?alt=media\&token=4ddc5c5c-8518-4cef-a2f8-edf3a8261517) if you want to connect it to the debugger, set breakpoints and monitor expressions.

![](https://1791219135-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Md5nSb70RWQSfl1nJPs%2F-Md8f2knx7jlnWL5eUlD%2F-Md8fgEdTDlJ8U05qOCW%2Fimage.png?alt=media\&token=3e696cda-8519-414d-9969-b3d0ad31a456)

## Other Notes

Qt uses a Shadow build by default. Which means it builds everything in a separate folder. You need to add an item into that folder for the firmware list to work. I added it before a release.

{% hint style="info" %}
Default shadow build folder

**gui/build-HeadTracker-Desktop\_Qt\_6\_4\_1\_MinGW\_64\_bit-Debug**
{% endhint %}

There is no background since it's run from the shadow build folder. Copy **stylesheet.css** and **Background.svg** from **gui/src/css** into the output folder. Which when building in debug mode will be in **gui/build-HeadTracker-Desktop\_Qt\_6\_4\_1\_MinGW\_64\_bit-Debug/debug**.

You need to create a sources.ini (The firmware sources). The below file will allow you to see all the current online firmware in the GUI list. You can also add a localfirmware.ini if you want.

{% hint style="info" %}
sources.ini
{% endhint %}

```
[General]
Online v2.0x=https://raw.githubusercontent.com/dlktdr/HeadTracker/master/firmware/bin/firmware20.ini
Online v0.9x=https://raw.githubusercontent.com/dlktdr/HeadTracker/master/firmware/bin/firmware09.ini
Online v0.8x=https://raw.githubusercontent.com/dlktdr/HeadTracker/master/firmware/bin/firmware08.ini
Online v0.7x=https://raw.githubusercontent.com/dlktdr/HeadTracker/master/firmware/bin/firmware04.ini
Shipped=file://localfirmware.ini
```

{% hint style="info" %}
localfirmware.ini
{% endhint %}

```
[Arduino%20Nano%20BLE%2033%20-%20Version%200.9]
Filename=file://BLE v0.9.bin
Version=0.9
Notes=Visit https://github.com/dlktdr/headtracker

[Arduino%20Nano%20BLE%2033%20-%20Version%201.0%20ONLINE]
Filename=https://raw.githubusercontent.com/dlktdr/HeadTracker/master/firmware/bin/BLE v0.9.bin
Version=0.9
Notes=Visit https://github.com/dlktdr/headtracker

[Debugger 1.0 RC1]
Filename=file://Y:/Programming/HeadTracker/HeadTracker - CombineFW/firmware/src/Nano33BLE/.pio/build/HeadTracker_Nano33BLE/firmware.bin
Version=1.0
Notes=Combine FW

[Debugger 0.9]
Filename=file://Y:/Programming/HeadTracker/HeadTracker - Master/firmware/src/Nano33BLE/.pio/build/HeadTracker_Nano33BLE/firmware.bin
Version=0.93
Notes=Master FW

[Para Master v1.4]
Filename=file://Y:/Programming/HeadTracker/Para_Master/para_master/.pio/build/Para_Master/firmware.bin
Version=1.4
Notes=Master FW

[Zephyr 2.0 BIN]
Filename=file://Y:/Programming/HeadTracker/HeadTracker_Zypher/.pio/build/Head_Tracker_Zypher/firmware.bin
Version=2.0
Notes=Zephyr Master

```

You can customize this file so it will directly grab from you firmware build folder, so you can just click upload firmware to use the one just compiled. See the last section on how to do this.
