PDA

View Full Version : Help with Signals and slots



chetu1984
10th March 2011, 20:59
Hi,
I want to know whether it is possible to modify the Clicked signal for push button to make it take a parameter. I know that we can define a new signal which can take a parameter.


Thanks,

Lykurg
10th March 2011, 21:38
What are you want to do with it? I guess you are looking for QSignalMapper.

chetu1984
10th March 2011, 22:35
I want to write a Keyboard for a touch screen device, so if i am able to pass the text of the push button as a parameter, I can connect all the signal to a single slot the accepts characters and set the text of the display.

are we not supposed to do it that way ..what could be the best way possible.?

SixDegrees
10th March 2011, 22:53
Just extend QPushButton, connect its own clicked() signal to an internal function that emits a new signal containing the button's value.

chetu1984
10th March 2011, 23:17
Can you explain me a bit more about extending QPushButton or where to find the documentation on it .

Thanks .

SixDegrees
10th March 2011, 23:30
Inherit a new class from it, and add your own functions. Straight-up C++, OO design.