Skip to content

Qt sidebar widgets: force Qt.Widget flag to survive transient parent=None - #36

Merged
trissim merged 1 commit into
mainfrom
hotfix/qt-sidebar-widget-flag
Nov 17, 2026
Merged

trissim merged 1 commit into
mainfrom
hotfix/qt-sidebar-widget-flag

Conversation

@trissim

@trissim trissim commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Builds on PR #35. parent= alone isn't enough on Qt-for-Android: toad's _layout_panes does bar.setParent(None) mid-rearrangement, and in that window Qt gives the widget a top-level QWindow + EGL surface → SIGABRT when the second EGL surface races accessibility.

setWindowFlags(Qt.WindowType.Widget) tells Qt explicitly: child widget, never a window, even when parent is transiently None. Applied to all three Qt sidebar widgets.

Test plan

  • Parse
  • APK rebuild → ApplicationActive persists past the second EGL allocation

🤖 Generated with Claude Code

https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn

Passing parent= alone wasn't enough on Qt-for-Android: src/toad/qt/window.py's
_layout_panes calls bar.setParent(None) during rearrangement, and in the window
between that call and the next setParent(dock) Qt treats the widget as a top-level
QWindow and gives it its own EGL surface — same crash as a true orphan. Second
SidebarToggleClassWindow still races QtAndroidAccessibility::runInObjectContext()
one second after ApplicationActive.

setWindowFlags(Qt.WindowType.Widget) tells Qt explicitly: this is a child widget,
never a window, even when parent is None. Qt then refuses to allocate a top-level
window for the transient parent-less state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn
@trissim
trissim merged commit 9aa9340 into main Nov 17, 2026
1 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant