Why doesn’t Qt for C++ support hot reloading like other modern UI frameworks?
-
In many modern GUI frameworks (like Flutter or React), hot reloading allows developers to see code changes reflected immediately in the running application — without recompiling the entire program.
This saves time during development and preserves the current app state in memory.In contrast, when developing C++ applications with Qt, even small UI or logic changes require a full recompilation and restart of the app.
Why hasn’t hot reloading been implemented for Qt C++ development?
What technical challenges prevent this feature?
Is it due to the compiled nature of C++?
Would it ever be possible to add true hot reloading support to C++ Qt projects, similar to what interpreted or JIT-based frameworks can do?
Can Cling help in that ?
https://github.com/root-project/cling -
In many modern GUI frameworks (like Flutter or React), hot reloading allows developers to see code changes reflected immediately in the running application — without recompiling the entire program.
This saves time during development and preserves the current app state in memory.In contrast, when developing C++ applications with Qt, even small UI or logic changes require a full recompilation and restart of the app.
Why hasn’t hot reloading been implemented for Qt C++ development?
What technical challenges prevent this feature?
Is it due to the compiled nature of C++?
Would it ever be possible to add true hot reloading support to C++ Qt projects, similar to what interpreted or JIT-based frameworks can do?
Can Cling help in that ?
https://github.com/root-project/clingAre you looking for reloading of C++? That doesn't seem to be in the scope of Qt. The compiler would need to be involved. At a glance, an interpreter such as Cling would be unlikely to help unless everything reloadable was always run through it. C++ has no ABI, leaving each compiler to decide on interface semantics. Newly compiled/interpreted code would have to be adapted to the compiler, possibly including the specific version and compilation flags.
-
For QML, there's a history of hot reload projects. For example, from a few seconds on pick-your-search-engine, https://qml.guide/live-reloading-hot-reloading-qml/. I used an early version of QML Live, and found it useful for tweaking simple UIs. When the structure is complicated, time savings becomes questionable, and the risk of traversing invalid states is high.
-
For widgets from a .ui file, I haven't seen it, and guess that the typical level of C++ integration would make it highly unreliable. The same goes for QML reloading with anything beyond a trivial custom C++ integration.
-
-
You are correct that this is because C++ is compiled. It is not too easy to replace functions inside a running executable. What happens if the new function is larger than the old one? It needs to go into a new place. This also means that all calls to the function need to be updated (or we need to replace the original function with a call to the new function). It gets even more complicated if functions are also inlined.
There is a single project that allows you to do hot reloading with C++ (and thus certainly also with Qt): https://liveplusplus.tech/
-
You are correct that this is because C++ is compiled. It is not too easy to replace functions inside a running executable. What happens if the new function is larger than the old one? It needs to go into a new place. This also means that all calls to the function need to be updated (or we need to replace the original function with a call to the new function). It gets even more complicated if functions are also inlined.
There is a single project that allows you to do hot reloading with C++ (and thus certainly also with Qt): https://liveplusplus.tech/
There is a single project that allows you to do hot reloading with C++ (and thus certainly also with Qt): https://liveplusplus.tech/
Only problem is that it's closed source