Qt 6.11 is out! See what's new in the release
blog
Real time push button click check
-
//Constructor connect(btn, &QPushButton::clicked, this, &MainWindow::add); void MainWindow::add() { QPushButton* btn = new QPushButton(scrollAreaSlider); ...... listBtn.push_back(btn); //it is a QList, and it is a private variable } void MainWindow::load(QString str) { ........... }In real time, if the
listBtnelement has been clicked I want to call another function calledload, and do something with thelistBtnclicked button text. -
Hi,
You can connect a lambda to call your load function with the button text.
-
Okey so, I have to go thorugh each button with foreach, and using lambda function.