I have a very simple Qml/Python application with some content in a StackView(), with the first page containing a simple button. My question is, does EVERYTHING between Qml and P
QML uses the MetaObject (MOC) of the QObjects to access the properties, signals and slots, in your case changePage is not a slot but a function that is not accessible from QML.
The solution is to make the changePage function accessible in QML using the @pyqtSlot decorator:
homeFunctions.py
from PyQt5.QtCore import pyqtSlot, QObject
class HomeFunctions(QObject):
@pyqtSlot()
def changePage(self):
print("Button was pressed")