ReferenceError: python is not found

I’m trying to migrate ankqml to Sailfish and get it to compile. There’s still a lot of work to be done, but I’m taking it step by step. I’m currently stuck on the bindings with Python.

I created a file called PythonHandler.qml and tried to call a Python class in the file DecksManager.qml, but the IDE complained that python (the Python object referenced in the file ‘PythonHandler’) was not found.

What am I doing wrong?

Haven’t looked into the code in detail, but having an id: python in the QML document (file) is not enough. You need something with ID python where the DecksManager can see it.

Someting like


Item {

PythonHandler { id: python
  function foo() { ...}
}

  onSomeEvent: python.foo()

}
1 Like

Indeed, I see now whats was missing. Thanks!

1 Like