[Qt-interest] inherit QPushButton and implement clicked()?
Nikos Chantziaras
realnc at arcor.de
Sat Feb 27 23:08:37 CET 2010
On 02/27/2010 11:28 PM, Sebastian Songemann wrote:
> Hi,
>
> I created a custom button and inherited QPushButton. The button should notice when it has been clicked. Can I implement a method that is called as soon as the button is clicked? (I've tried clicked(), but no luck.)
>
> Of course, I could connect the clicked() signal to a private slot and then emit another signal, but this should be easier. I can, for example, just implement mouseMoved() without having to connect a signal and slot in QWidget.
Why not? That's how it's done usually. You connect clicked() to a
slot. It's the easiest and most straightforward way.
More information about the Qt-interest-old
mailing list