How can I get the application QmlEngine ?
-
@KroMignon Damn it is so hard to debug a binding loop with QT. Will keep you updated if I finally found out what's going on with my program.
@kmarconi said in How can I get the application QmlEngine ?:
Damn it is so hard to debug a binding loop with QT.
Yes, binding loops are the hell!
Which Qt Version are you using? For Qt 5.10 and upper you can enable tracing to help you to find bindings problems withQT_LOGGING_RULES
.
For example in your main.cpp:qputenv("QT_LOGGING_RULES", "qt.qml.binding.removal.info=true");
Take look at this https://www.kdab.com/new-qt-5-10-diagnostics-breaking-qml-bindings/ for more details.
-
@kmarconi said in How can I get the application QmlEngine ?:
Damn it is so hard to debug a binding loop with QT.
Yes, binding loops are the hell!
Which Qt Version are you using? For Qt 5.10 and upper you can enable tracing to help you to find bindings problems withQT_LOGGING_RULES
.
For example in your main.cpp:qputenv("QT_LOGGING_RULES", "qt.qml.binding.removal.info=true");
Take look at this https://www.kdab.com/new-qt-5-10-diagnostics-breaking-qml-bindings/ for more details.
@KroMignon I'm on QT 5.12.3 so that could save me. Will tell you, thanks !
-
@kmarconi said in How can I get the application QmlEngine ?:
Damn it is so hard to debug a binding loop with QT.
Yes, binding loops are the hell!
Which Qt Version are you using? For Qt 5.10 and upper you can enable tracing to help you to find bindings problems withQT_LOGGING_RULES
.
For example in your main.cpp:qputenv("QT_LOGGING_RULES", "qt.qml.binding.removal.info=true");
Take look at this https://www.kdab.com/new-qt-5-10-diagnostics-breaking-qml-bindings/ for more details.
@KroMignon My binding loop error hasn't changed at all even with "qputenv("QT_LOGGING_RULES", "qt.qml.binding.removal.info=true");" in my main.cpp file .. Am I condemned to live in this infinite binding loop ? haha
-
@KroMignon My binding loop error hasn't changed at all even with "qputenv("QT_LOGGING_RULES", "qt.qml.binding.removal.info=true");" in my main.cpp file .. Am I condemned to live in this infinite binding loop ? haha
-
Here is my main.qml file :
Item {
id:root
visible: true
width: 640
height: 480property var mainMenu: Menu{rootStack: root} StackView { anchors.fill: parent id: menuStack property var button: hmiclass.button initialItem: mainMenu onButtonChanged: { mainMenu.onButtonPushed(button) } }
}
EDIT: I need to find where that loop is coming from.. Or to find a patch to refresh only the bindings which are in the translation file.
@kmarconi said in How can I get the application QmlEngine ?:
Here is my main.qml file :
Item {
id:root
visible: true
width: 640
height: 480property var mainMenu: Menu{rootStack: root} StackView { anchors.fill: parent id: menuStack property var button: hmiclass.button initialItem: mainMenu onButtonChanged: { mainMenu.onButtonPushed(button) } }
}
EDIT: I need to find where that loop is coming from.. Or to find a patch to refresh only the bindings which are in the translation file.
This is the one
-
@kmarconi said in How can I get the application QmlEngine ?:
Here is my main.qml file :
Item {
id:root
visible: true
width: 640
height: 480property var mainMenu: Menu{rootStack: root} StackView { anchors.fill: parent id: menuStack property var button: hmiclass.button initialItem: mainMenu onButtonChanged: { mainMenu.onButtonPushed(button) } }
}
EDIT: I need to find where that loop is coming from.. Or to find a patch to refresh only the bindings which are in the translation file.
This is the one
-
@kmarconi And what is the binding loop error message? I can't see any obvious error on this code extract.
@KroMignon Sorry, the error is : QML StackView: Binding loop detected for property "button"
-
@KroMignon Sorry, the error is : QML StackView: Binding loop detected for property "button"
@kmarconi said in How can I get the application QmlEngine ?:
the error is : QML StackView: Binding loop detected for property "button"
According to your code, it looks like
mainMenu.onButtunPushed()
will changehmiclass.button
content, which will recallmainMenu.onButtunPushed()
... -
@kmarconi said in How can I get the application QmlEngine ?:
the error is : QML StackView: Binding loop detected for property "button"
According to your code, it looks like
mainMenu.onButtunPushed()
will changehmiclass.button
content, which will recallmainMenu.onButtunPushed()
...@KroMignon Yeah that's what I tought but why this error is only showing on retranslate and not on the app boot too ?
-
@KroMignon Yeah that's what I tought but why this error is only showing on retranslate and not on the app boot too ?
@kmarconi said in How can I get the application QmlEngine ?:
Yeah that's what I tought but why this error is only showing on retranslate and not on the app boot too ?
Because there have to be a first change to start the loop!
I don't know what is changinghmiclass.button
?I suppose
hmiclass
is a C++ class instance andbutton
is a property of this class.
In some way the attached signal to this property is emitted, which will start the loop.That is just an hypothesis, I don't have a clue about your code.
-
@kmarconi said in How can I get the application QmlEngine ?:
Yeah that's what I tought but why this error is only showing on retranslate and not on the app boot too ?
Because there have to be a first change to start the loop!
I don't know what is changinghmiclass.button
?I suppose
hmiclass
is a C++ class instance andbutton
is a property of this class.
In some way the attached signal to this property is emitted, which will start the loop.That is just an hypothesis, I don't have a clue about your code.
@KroMignon Yeah sorry I know that I'm asking a lot of help without any clue of my code. But I canno't share more information about it, I'm sorry... Will try to solve my problem with what you gave me today and will keep you updated. Thanks a lot