I want to call some lambda function A
once, and all the next time I want to call the lambda function B
.
For example:
connect(someButton, &QPushButton::clicked, this, [=]()
{
QMessageBox::information(this, "Function A", "This is FIRST Message");
});
Then I want to disconnect from this function and connect to the second one:
connect(someButton, &QPushButton::clicked, this, [=]()
{
QMessageBox::information(this, "Function B", "This is SECOND Message");
});
Expected result:
Button clicked first time - "This is FIRST Message"
Button clicked second time - "This is SECOND Message"
…
Button clicked 10th time - "This is TENTH Message"