I have a c++ class that inherited from QObject
with name LoginManager
(that I registerd this with qmlRegisterTypes
) in main.qml
file
LoginManager{
id: loginManager
}
now I want to add a LoginPage.qml
file to a StackView
sv.push("/pages/LoginPage.qml",{lManager:loginManager});
LoginPage
Page {
id: root
property LoginManager lManager
Connections{
target: lManager
onMessageChanged: {
}
onLoginSuccessed: {
}
}
}
but I have and error when click button to add LoginPage.qml
to StackView
QmlComponent: Component is not ready qrc:/main.qml:395:5: QML StackView: push: qrc:/pages/LoginPage.qml:16 Cannot assign object to property
I have done same work on another pages but I don't know why I got error just here?
Edit
when I comment the Connections ,the error will go!