Skip to content

add especially crappy magic to deal with transient parents in actions

Harald Sitter requested to merge work/sitter/magic into master

the issue is fairly involved and I am not sure I fully grasp it...

systemsettings has a fairly exotic line up of window entities that form the final window. transient to that window it should create the KNS windows. unfortunately that doesn't work right now because the transience is not explicitly set.

this has in part to do with the also very exotic setup of NewStuff.Action which internaly has a private QObject and inside that a property of the type NewStuff.Dialog (the window in question).

now ordinarily there is actual magic code inside qquickwindow to figure transience out automatically, except it fails here because the parent of the Dialog is neither an Item nor a Window (it is a QObject of course), so the magic has no way to deal with it without making a lot of assumptions about the parent tree.

to fix this situation we introduce a magician assistant. it will first and foremost warn that this situation is garbage and the developer ought to provide an explicit transient. it will then proceed to identify the first QQuickItem in the parent chain with a window and adopt that window as transient parent. i.e. the first window we find becomes parent.

the end result is that our Dialog always has a transient parent (when used as part of Action)

BUG: 491083

Merge request reports