4/// Factory for creating and opening QGCPopupDialog instances from a Component.
5/// Place the factory immediately before its associated Component. The dialog is created
6/// with the factory's parent as the initial parent, then QGCPopupDialog reparents itself
7/// to Overlay.overlay on completion.
10/// QGCPopupDialogFactory {
11/// id: myDialogFactory
12/// dialogComponent: myDialogComponent
16/// id: myDialogComponent
17/// QGCPopupDialog { ... }
20/// onFoo: myDialogFactory.open()
21/// onBar: myDialogFactory.open({ title: "My Title", myProp: someValue })
26 required property Component dialogComponent
28 function open(props) {
29 var dialogParent = root.parent ? root.parent : null
30 var dialog = props === undefined || props === null
31 ? dialogComponent.createObject(dialogParent)
32 : dialogComponent.createObject(dialogParent, props)
35 console.warn("QGCPopupDialogFactory: Failed to create dialog from dialogComponent");