[Qt-interest] slot parameters

Alessandro Portale alessandro.portale at nokia.com
Fri Sep 10 18:54:15 CEST 2010


On 9/10/2010 6:32 PM, ext emmanuel_mayssat at lynceantech.com wrote:
> I would like to have a signal with no parameters (ex. pushbutton clicked() ) and have it change my toolBox to page 3 ( slot: toolBox changeIndex(int) )
> Given that clicked cannot send a parameter (and shouldn't), how can I have my toolbox receive the signal. In designer I cannot link those the above signal and slot together.
> The first thing that come to mind is to create a pseudo slot on the toolBox, such as goToPage3(), which would be an alias to the changeIndex(3) slot.
> Obviously I would like to do this with as little programming as possible if at all.
>
> Any advice?

Do you have more than one of these buttons, each one making the app jump 
to another page? In that case, I would use QSignalMapper
    http://doc.qt.nokia.com/latest/qsignalmapper.html

It let's you map several parameterless signal sources to one slot with 
parameter.

Hope that helps,
Alessandro



More information about the Qt-interest-old mailing list