PDA

View Full Version : array of QPushButton



Erich
3rd August 2010, 03:05
Hello folks,

how can I manage, that every button sends some idenification (e.g. his index in the array) to the console, when it is clicked?

tbscope
3rd August 2010, 05:42
There are a couple of ways to do this:

1. Subclass QPushbutton, create a setting for an ID, implement custom signals etc...
2. Use a QDialogButtonBox
3. Use a QSignalMapper
4. Use the sender() function to know who sent the signal

aamer4yu
3rd August 2010, 08:43
You can also use objectName or some custom property to identify the button :)

Erich
4th August 2010, 05:43
Hi folks,

many thanks for your answers! I could solve the problem.

Erich