Should I use StackView or a custom Loader-based navigation system for a multi-screen Qt Quick HMI?
-
Hi everyone,
I’m building an HMI in Qt Quick (Qt 6.x) which has around 25 screens.
Currently, I’m handling navigation with a custom C++ ScreenManager + QML Loader approach:ScreenManager emits signals (screenChanged, appStateChanged)
QML listens and updates currentScreen
I load screens dynamically using a Loader { source: currentScreen }Inside each screen I also use QML states for internal animations/modes
This setup works well and feels simple to manage.However, many examples and discussions recommend using StackView for navigation—especially for larger HMIs with animations, transitions, or back navigation.
So my questions are:
For an HMI with ~25 screens, is StackView the recommended / ideal approach?
Is there any long-term disadvantage in sticking to a Loader + custom manager approach?
Do automotive or production HMIs typically rely on StackView, or do they build custom navigation managers?
If I switch to StackView, will screen transitions and animations become easier to manage?From a performance and architecture perspective, which approach scales better as the HMI grows?
-
I would recommend StackView for any HMI with back and forth navigation.
The Loader disadvantage is having one more Item in your hierarchy, less feature for your navigation and no transition animation out of the box.Note that you can use your custom manager in tandem with a StackView.
Something like this should work:
onCurrentScreenChanged: myStackView.replace(null, currentScreen).Having a StackView lets you keep some screens UI only, without making your ScreenManager aware. For example you could push a UI settings page (theme, font size) irrelevant to your business side.