I'm trying to open a popup and pass an argument that will be displayed as part of the popup. I can do that by creating a property and just changing the property right before I open the popup, but I'm wondering if I can accomplish this without making a property and by somehow passing an argument to the popup? Basically accomplish this without creating a property:
import QtQuick 2.15
import QtQuick.Window 2.2
import QtQuick.Controls 2.15
Window {
id: window
visible: true
height: 400
width: 400
property var username: "Morbius"
Button {
text: "Click me"
onClicked: {
username = "Definitely not Morbius"
popup.open()
}
}
Popup {
id: popup
width: 220
height: 200
closePolicy: Popup.CloseOnPressOutside
Text {
id: name
text: "Hello, " + username
}
}
}