I have created a QList of QPushButton that I have assigned to a slot function. But I would like to get coordinates of the button which is clicked in the list.
For example, pushbutton n°5 is clicked, it return me (25,150).
listButton = new QList<QPushButton*>;
//some code here
QPushButton *button = new QPushButton(QString::number(1),ui->widget);
button->setGeometry(50, 50, 30, 30);
button->setStyleSheet("background-color:red;");
QObject::connect(button, SIGNAL(clicked()), this, SLOT(selectP()));
listeButton->append(button);
//some code here
void selectP()
{
//I'd like to print here, coordinates of the button which has called "selectP()"
}
Sorry for my language, thanks in advance !