Lambda function in QT
Unsolved
General and Desktop
-
I am having one member function in the class.
In the same class i am using the below code to interact the aws.
client.connect(&client, &QAwsIoTClient::messageReceived,
[&value](const QString &topicName, const QByteArray &message){
//need to call member function
});Now i want to call the member function in the above code.
It will be very helpful any one give some solution for this
Thanks in advance
-
Hi @dhu0504 said in Lambda function in QT:
client.connect(&client, &QAwsIoTClient::messageReceived,
[&value](const QString &topicName, const QByteArray &message){
//need to call member function
});You need to capture
this
to be able to call member functions:client.connect(&client, &QAwsIoTClient::messageReceived, [this, &value](const QString &topicName, const QByteArray &message) { //need to call member function });
After that it should work nicely.