Programatically generated slot names
Alexander Neundorf
neundorf at kde.org
Thu Jan 29 18:04:13 GMT 2009
On Wednesday 28 January 2009, Jeff Mitchell wrote:
> For a design I'm putting together, I will need to trigger a series of
> slots in succession, returning to a master "control" function in
> between. I *could* do something like (very pseudocode):
>
> switch i:
> case 1: singleshot slotPage1
> case 2: singleshot slotPage2
> ...
> case n: singleshot slotPagen
>
> However, what I'd prefer to do is something like this:
>
> singleshot( SLOT( "slotPage" + n.toString() ) )
I haven't done this myself, but I think you need QMetaObject.
Alex
More information about the kde-core-devel
mailing list