I\'m trying to call a Python method from QML and use the return value.
QML receives undefined, from the Python method.
When passed back to Python it is just an e
You also need to tell what you are returning from your method (pay attention to the result
in the pyqtslot decorator:
class InPython(QObject):
@pyqtSlot(str, result=str) # also works: @pyqtSlot(QVariant, result=QVariant)
def login(self, Login):
print(Login)
return "a"
result – the type of the result and may be a Python type object or a string that specifies a C++ type. This may only be given as a keyword argument.
Documentation about @pyqtslot (and the result
parameter)