QML Android Layout Artifacts on Orientation Change - Intermittent Issues
-
Hello Qt Community,
I'm experiencing frustrating layout artifacts in my Qt/QML Android application that occur intermittently during orientation changes. The layout works correctly about 9 out of 10 times, but occasionally displays distorted or incorrectly sized elements.
Environment:
- Qt 6.8.3
- Android NDK 27.0.12077973
- Simple ApplicationWindow with ColumnLayout structure
Problem:
- Layout renders perfectly in portrait mode
- Most orientation changes work fine
- ~10% of orientation changes result in visual artifacts (incorrect sizing, element positioning)
- No console errors or warnings
Current QML Structure:
ApplicationWindow {
visible: true
title: qsTr("Business Assistant")ColumnLayout { anchors.fill: parent anchors.margins: 20 spacing: 10 Text { /* title */ } RowLayout { Layout.fillWidth: true TextField { Layout.fillWidth: true } Button { /* fixed width */ } } ScrollView { Layout.fillWidth: true Layout.fillHeight: true TextArea { /* content */ } } }
}
What I've Tried:
- Pure Layout-based approach (no mixed anchors)
- ApplicationWindow instead of Window
- Layout.fillWidth/fillHeight instead of explicit sizing
- Adding orientation change timers (workaround)
- Wrapping in Item containers
Questions:
- Is this a known Qt Android orientation handling bug?
- Are there differences between debug vs release mode for orientation handling?
- What's the recommended approach for reliable orientation layouts in Qt 6.8.3?
- Should I consider switching to Flutter for mobile development?
The intermittent nature makes this particularly frustrating - users randomly experience broken layouts. Any insights or proven solutions would be greatly appreciated.
Qt Version: 6.8.3
Android NDK: 27.0.12077973Thanks in advance for any guidance!