[Qt-interest] Multiple Button Problem

André Somers andre at familiesomers.nl
Thu Aug 25 09:32:10 CEST 2011


You are looking for QSignalMapper, I think.

Andre

On Thu, Aug 25, 2011 at 9:19 AM, Ankit Agarwal <ankit17.ag at gmail.com> wrote:

> Hi,
>
> I am using Qt4.2.2 on Linux, Fedora14
>
> I have a QWidget which has 15 buttons. Each button has a different text on
> it. My requirement is that, whenever a user clicks on a button, I need to
> popup an QMessageBox and show that text in the message box.
>
> Secondly, I have QList with 15 quint32 counter items. Each item in the list
> corresponds to each button in the QWidget. So, whenever a user click on one
> of the button, the corresponding counter item in the list should be
> incremented by 1.
>
> One way is to write 15 different connect statements, one for each button.
> But, I believe there should be a better way of doing the same thing.
>
> Please suggest how can I achieve this.
>
> --
> Regards,
> Ankit Agarwal
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110825/19fa6ad6/attachment.html 


More information about the Qt-interest-old mailing list