how to use Qtconcurrent::run with either a member function or maybe a lamdba function
-
@jsulm said in how to use Qtconcurrent::run with either a member function or maybe a lamdba function:
connect(&client, &QMMqttClient::onConnected, this, this{ // Use client here
Hi jsulm, thanks for your help, but that didnt work, the error message was
client' is not captured
and it the error says the error is on the client.subscribeTopic("command/stop") ; line
-
@Dean21
Let's start with: did you actually delete theQMMqttClient client;
statement in the constructor? -
@Dean21 Please show your current code.
This code works for me just fine (ui is member of the class calling connect):connect(ui->pushButton, &QPushButton::pressed, [this]() { ui->pushButton->setText("DONE"); });
@jsulm sorry i forgot to comment a line of code, this is working now thank you so much for your help I was really stuck and dont think I would have fixed without help from everyone here thank you.
But would this prevent any functionality of any other code from working, for example I have a lineEdit box and once I enter a value its suppose to show in another lineEdit box but that functionality seems to have stopped working, since this new part started working -
@jsulm sorry i forgot to comment a line of code, this is working now thank you so much for your help I was really stuck and dont think I would have fixed without help from everyone here thank you.
But would this prevent any functionality of any other code from working, for example I have a lineEdit box and once I enter a value its suppose to show in another lineEdit box but that functionality seems to have stopped working, since this new part started working