Reputation: 195
I have matrix of QLineEdits in a QGridLayout. I want to signal when one of QLineEdits' text changes. I can connect the signal to a slot but there is no way of knowing which QLineEdit was changed. I would like to send the row column number of QLineEdit but there is pass variables to a slot according nokia fourms.
I was wondering if any of you have any suggestions?
One way to do it is to compare old values to new values, but this is inefficient.
Thank You!
Upvotes: 1
Views: 695
Reputation: 1532
You could use the QSignalMapper class. This would allow you to do what you're asking.
See also Advanced Signals and Slots Usage for more info and some examples.
Upvotes: 2
Reputation: 7924
QObject::sender()
Edit: note the QSignalMapper reference there as well.
Upvotes: 0