I have a few QLineEdit-s; When the Edit QPushButton is clicked, I want to know which QLineEdit was selected beforehand.
Qt Code:
  1. QLineEdit *clickedLine = qobject_cast<QLineEdit *>(sender());
  2. clickedLine->setText(";)");
To copy to clipboard, switch view to plain text mode 

However, in the case I have several push button and want to know which button was clicked, this is accomplished successfully with the same code snippet:

Qt Code:
  1. QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
  2. int digitValue = clickedButton->text().toInt();
  3. qDebug() << digitValue;
To copy to clipboard, switch view to plain text mode