Descobri que posso fazer isso com o seguinte snippet no meu código ( root
é o identificador de chamadas do método open()
, mas pode ser ignorado para este exemplo). Essencialmente, preenchendo o argumento params
no PopUtils.open () function:
PopupUtils.open(Qt.resolvedUrl("QrCodeDialog.qml"), root, {
title: i18n.tr("This is the title"),
text: i18n.tr("This is the text")
})
E o arquivo QrCodeDialog.qml
contém:
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.Popups 0.1
Dialog {
id: qrcodedialog
title: ""
text: ""
Button {
text: i18n.tr("Close")
onClicked: PopupUtils.close(qrcodedialog)
}
}