I'm currently developed a GUI application with QML/Python.
My problem is the next : I use SetProperty to fix some QML object properties, but for some properties, there is sub properties, and so far, I was not successful to finding the correct syntax of SetProperty with this kind of stuff.
To be more precise, here is a sample of my code :
in my main.qml :
Button {
id: request_copy
objectName: "request_copy"
text: "Copier la requête"
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
onClicked: ATRCReport.request_to_clipboard(search_type.currentText)
ToolTip.visible: hovered
ToolTip.text: "Request copied"
}
My python code :
@pyqtSlot(QVariant)
def request_to_clipboard(self, selected_request):
if selected_request is "":
self.no_search_type_dialog.open()
else:
clipboard.copy(selected_request)
self.request_copy.setProperty("ToolTip.visible", "released")
My goal in this precise exemple is to show a tooltip after an action. But so far, I tried many syntaxes, but nothing work. I found nothind in the online doc of PySide2 etc.