Published using Google Docs
Felgo Hot Reload Guide
Updated automatically every 5 minutes

Company Confidential

Felgo Hot Reload Guide

Table of Contents:

1. Overview        1

1.1. Felgo Hot Reload GUI Application        2

1.2. Felgo Hot Reload Library        2

2. Installation        3

3. Preparation and Setup        4

3.1. License Key        4

3.2. Initial Project Configuration        6

3.2.1. Build System        6

3.2.2. Load Hot Reload instead of your main QML file        7

3.2.3. Felgo Hot Reload Configuration File        7

4. Usage        10

4.1. Start and connect Felgo Hot Reload        10

4.2. Auto-start Felgo Hot Reload        12

4.3. Load from Cache        13

4.4. Development Instructions        14

Restarts        14

Development        14

4.5. GUI application options        14

5. Demo Project        15

6. Changelog        15

Version 1.4.1 (2024-10-02)        15

Improvements        15

Fixes        16

Previous versions        16

7. Known issues        16

7.1. The developed application window is not set on top on Linux systems        16

7.2. Adding Felgo Hot Reload to a Qt6, gcc_64 project on Linux machines can make the CMake configuration fail        16

7.3. Removing layer.effects with Qt 6.4.1 makes the parent item invisible        17

7.4. Using a main_qml_file outside project directory may throw errors when using QML  imports with relative paths        17

7.5. Can’t get rid of the error screen when fixing an error        17

7.6. Issues when typing Connection ID on some Android device models when using Qt 6.7        18

8. Contact        18

1. Overview

Felgo Hot Reload empowers you to make instant QML and JS code changes and resource updates without recompilation or redeployment; it applies these changes without losing the state of your running application. If you are currently working on a sub-screen, you will not have to navigate to it again after every change, and you will stay exactly where you are in your application.

Felgo Hot Reload consists of two components:

1.1. Felgo Hot Reload GUI Application

The Felgo Hot Reload GUI application (FelgoHotReload.exe on Windows or FelgoHotReload on other platforms) listens for project file changes and sends those changes to the running application. It is located in the root folder of the installation directory.

1.2. Felgo Hot Reload Library

The Felgo Hot Reload library. It gets linked into your application binary during the development workflow (not linked to the release version). You can integrate the library via qmake or CMake build system helpers. You can find the library in the client subfolder of the installation directory.

2. Installation

You can install Felgo Hot Reload using the specific installer for your development platform:

After downloading and starting the installer, you are asked to select:

After the installation, you can start configuring your project to use Felgo Hot Reload.

3. Preparation and Setup

3.1. License Key

Before starting work, you need to provide a license key that you have retrieved from Felgo as a part of an order.

Open the Felgo Hot Reload GUI application. First, it will ask you to enter the license key. Enter the received license key and press “CONTINUE”.

If the given license key is valid, it will ask you to select a project directory. This step is necessary only once.

You have the option to skip this step by pressing “SKIP”. After selecting this option, the application will ask you to select a project directory. After choosing the directory, you will see a message that the license key is not set. Open the settings window from the banner or via the “Settings” button in the bottom left corner.

Locate the text field “License Key” at the very top of the screen.

Paste the received license key, and press “Save”.

When you successfully add a license, the License Banner will disappear. You will see information about your current license in the Felgo Hot Reload settings.

Note: If you have any questions or queries regarding obtaining or using a license key, please contact support@felgo.com.

3.2. Initial Project Configuration

In this section we give step by step instructions about how to integrate Felgo Hot Reload in a project. You can check the FelgoHotReloadDemo project to see all changes required for Felgo Hot Reload integration.

3.2.1. Build System

Here, we cover the two most common build systems: CMake and qmake (Qt 5.15).

CMake

Apply the following changes to configure your CMake-based project with Felgo Hot Reload:

# Felgo Hot Reload for host builds
set(FELGO_HOT_RELOAD_PATH "../client/${QT_VERSION}/macos")

set(CMAKE_PREFIX_PATH "${FELGO_HOT_RELOAD_PATH};${CMAKE_PREFIX_PATH}")

# Felgo Hot Reload for cross-compiling

# list(APPEND CMAKE_FIND_ROOT_PATH "../client/${QT_VERSION}/gcc_64")

find_package(FelgoHotReload CONFIG REQUIRED)

# Link Felgo Hot Reload

felgohotreload_configure_executable(${CURRENT_PROJECT_NAME})

There are some special requirements when adding Felgo Hot Reload to an Android project using CMake:

qmake

Note: qmake support is only available for Qt 5.15.

Apply the following changes to configure your qmake-based project with Felgo Hot Reload:

# Add Felgo Hot Reload

FELGO_HOT_RELOAD_PATH = "../client/$${QT_VERSION}/macos"

include("$${FELGO_HOT_RELOAD_PATH}/qmake/FelgoHotReload.pri")

3.2.2. Load Hot Reload instead of your main QML file

It makes sense to bundle Felgo Hot Reload only for the application's debug build. This way, you’ll have a debug build with Felgo Hot Reload for lightning-fast development and testing and your typical release build for publishing.

It is good practice at Felgo to have a mechanism for easily enabling or disabling Felgo Hot Reload. That’s why when Felgo Hot Reloaded is added to a project, it defines the USE_FELGO_HOT_RELOAD symbol. You can use it inside your C++ code to add Felgo Hot Reload specific code. The Demo Project shows how this is done.

If you are tweaking your project manually, you need to load the Felgo Hot Reload component instead of the main QML file in your application logic. To do it, you need to:

3.2.3. Felgo Hot Reload Configuration File

Apply the following changes to your project:

Here is an example of a valid hot_reload_config.json file:

{

  "main_qml_file": "qml/main.qml",

  "qml_module_paths": ["qml"],

  "qml_plugin_paths": ["."],

  "use_local_plugins": true

}

And a more complex example, assuming in qml/module you have defined a module with import URI my.application.module:

{

  "main_qml_file": "qml/main.qml",

  "qml_module_paths": [

    "qml",

    {

      "path": "qml/module",

      "target_path": "my/application/module"

    }

  ],

  "qml_plugin_paths": [

    {

      "path": "build/x64_debug/my/application/module",

      "target_path": "my/application/module",

      "platform": "linux",

      "compiler": "gcc_64",

      "qt_version": "6.5.3"

    }

  ],

  "use_local_plugins": true

}

Note: For your convenience, a sample JSON configuration file is in the Demo Project repository (hot_reload_config.json). You may copy it and adapt it to your project.

4. Usage

4.1. Start and connect Felgo Hot Reload

Note: When the Felgo Hot Reload GUI application first starts on Windows, it may ask for firewall permission. Make sure to allow access.

4.2. Auto-start Felgo Hot Reload

You can automatically start up a connection or start the application from cached files with the following methods:

The value set for either the environment variable or the command line argument can be the following:

If the application is not started automatically with the given parameters, the default starting screen will appear, with an error message describing why the auto start was unsuccessful.

4.3. Load from Cache

You can start your application without access to the Felgo Hot Reload GUI application. This option is available only if the project has been loaded at least once without QML errors. To do this, select the “Load from Cache” option.

This will start your application with the latest error-free configuration and without Felgo Hot Reload functionality.

4.4. Development Instructions

Restarts

You can restart your project application anytime. The Hot Reload GUI application does not need to be restarted and can remain open in the background.

Exception: If you change the JSON configuration, you need to restart the Felgo Hot Reload GUI application.

Development

Make changes in your code and save the file. The changes are applied in the running application. If errors in your code occur or Hot Reload cannot be applied, you see an error overlay with a description.

Exception: You make changes to files bundled within executable and used via absolute paths. Example: import qrc:/MyModule as MyModule will use the files from the QRC system and not the development files.

4.5. GUI application options

There are several actions and configuration options available for the Felgo Hot Reload GUI application.

5. Demo Project

You can also access the demo project via GitHub: https://github.com/FelgoSDK/FelgoHotReloadDemo.

The project demonstrates how to add Felgo Hot Reload to an existing project. To run the project, follow the instructions in the README file.

6. Changelog

Version 1.4.1 (2024-10-02)

Improvements

Fixes

Previous versions

You can access the complete changelog here

7. Known issues

7.1. The developed application window is not set on top on Linux systems

Description

On Linux systems, the developed application window is not always set on top compared to Windows and macOS systems. This causes the application window to end up behind other windows, in particular use cases.

Workaround

Use the “Always on top” feature of Linux:

7.2. Adding Felgo Hot Reload to a Qt6, gcc_64 project on Linux machines can make the CMake configuration fail

Description

A CMake error stating that the XKB::XKB target has not been found

Workaround

Install libxkbcommon-dev package: sudo apt-get install libxkbcommon-dev

7.3. Removing layer.effects with Qt 6.4.1 makes the parent item invisible

Description

Because of a bug in Qt (https://bugreports.qt.io/browse/QTBUG-109506) for Qt 6.4.1, removing the layer.effect from a QML item makes that item invisible.

Workaround

A workaround to prevent an invisible item is to set the layer.enabled to false as well. This bug was fixed with Qt 6.4.3.

7.4. Using a main_qml_file outside project directory may throw errors when using QML  imports with relative paths

Description

Because of how we handle the main_qml_file outside the project directory, relative paths for QML imports may become invalid.

Workaround

Update the import QML relative paths:

7.5. Can’t get rid of the error screen when fixing an error

Description

In some cases. If you fix an QML issue that triggered the Felgo Hot Reload error screen in a different way than reverting  the change that caused it, the error is still reported and error screen shown. For example, consider the following component definition:

If you remove the componentColor property, Felgo Hot Reload will show the error screen. You can fix the issue in 2 ways:

If you choose the second option, the error screen will not disappear.

Workaround

7.6. Issues when typing Connection ID on some Android device models when using Qt 6.7

Description

More characters than typed are added when typing the Connection ID on some Android device models. It’s caused by this known Qt issue: https://doc.qt.io/qt-6/android-platform-notes.html#predictive-text in combination with QTBUG-125410

Workaround

8. Contact

If you have any questions, please check the Felgo Hot Reload FAQ page.

If you haven’t found an answer to your question or want to reach us, please do it via the FELGO support inbox:
support@felgo.com

© FELGO GmbH