Real time push button click check
Unsolved
General and Desktop
-
//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
listBtn
element has been clicked I want to call another function calledload
, and do something with thelistBtn
clicked button text. -
Hi,
You can connect a lambda to call your load function with the button text.