/backendCPP.getStringData() is a method. You can't bind it. You should
use propery (Q_PROPERTY) and bind to it ///instead/.
/
On 7/27/2021 6:50 PM, Nibedit Dey wrote:
Dear All,
I recently came across a strange issue related to QML binding.
The issue is not reproducible often which makes it difficult to find
the root cause.
Sample QML code:
Case 1: /text : "Retrieved details"+ backendCPP.getStringData()
//Sometimes, the complete string is empty/
/Case 2: property string someString : backendCPP.getStringData()/
/text: //"Retrieved details:"+// someString // Displays
//Retrieved details: value remains empty/
99% time, the value is fetched and displayed properly in Text element.
Rarely, it remains empty.
Here backendCPP is a C++ instance exposed through context property and
an invokable method is used to fetch data. Notify signal is not used
in this case.
I believe during failure cases the data is not retrieved from
backendCPP, when binding happened due to delay in the invokable
method. Is my assumption correct?
Although we can handle the issue in multiple ways including using a
NOTIFY signal or using Qt.binding, I am curious if anyone has observed
this issue.
Please share your inputs.
Thanks & Regards,
Nibedit
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest