Current Environment : Qt 5.8 MSVC2015 64bit, Windows 7 64 bit.
I have successfully called a C++ method from Java Script.
However, I encountered an issue when trying to retrieve the return value of the C++ method in JavaScript.
To address this, I attempted to utilize Q_PROPERTY
for accessing the return value of the C++ method in JavaScript code.
class ExportedObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString myprop MEMBER m_buffer READ GetValue WRITE GetTile)
public:
Q_INVOKABLE void GetTile(int row, int col, int level);
Q_INVOKABLE QString GetValue();
QString m_buffer;
This implementation resulted in the following error :
Error: C2660: 'ExportedObject::GetTile': function does not take 1 arguments
JavaScript Code :
var image = window.interface.GetTile( row , col ,level);
Can anyone provide insight into what may be missing in Q_PROPERTY
?
Are there any alternative approaches to retrieving C++ return values in JavaScript?