Commit 0f4266fb authored by Shawn Rutledge's avatar Shawn Rutledge
Browse files

Dialogs: detect and handle dynamic creation with Window parent


When instantiating via Qt.createQmlObject('Dialog { }', window, "path")
the dialog's parent will be the Window.  That was an unanticipated use
case, but also a simpler one: if the platform does not support multiple
windows, then we only need to construct the dialog and its decoration
on top of that window's contentItem.  Or if there is to be a separate
dialog window, then it should be transient for the main window.

Also rearranged the parenting strategy around the fact that the
application is always within a QQuickWindow: parentWindow() is
responsible for finding it, and it's not necessary to recursively go
up the Item hierarchy to find the root item if we are sure that
there is a window, because the root item is that window's contentItem.

Task-number: QTBUG-38578
Change-Id: I79e0cf44f789701f5d40e5e9d0449a55947be907
Reviewed-by: default avatarLiang Qi <liang.qi@theqtcompany.com>
Showing with 31 additions and 21 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment