[Kde-perl] Signals & Slots

Ashley Winters jahqueel at yahoo.com
Thu Jun 5 19:02:03 CEST 2003


As it turns out, we have no choice. -w will complain if it isn't
uppercase (something about 'possibly reserved' keyword and such).
SLOT() and SIGNAL() it is, unless there's a guaranteed workaround for
the warning. I'll dig through the Perl source and see what mandates the
warning and if it can be overcome.

I like the SIGNAL( int ) syntax, but I'll probably want to have a named
signal interface anyways, since Perl doesn't support overloading on
parameters... SLOT( resize(int, int) ) vs. SLOT( resize(const QSize &)
). However, I much prefer SLOT( const QSize & ). :)

Although, if someone prefers Signal() and Slot(), speak up...

Ashley Winters

--- Germain Garand <germain at ebooksfrance.org> wrote:
> Le Jeudi 05 Juin 2003 23:19, Germain Garand a écrit :
> > I implemented
> >    sub foo : signal( int )
> > rather than
> >    sub foo : signal( foo( int ) )
> 
> BTW, the old/alternative syntax is still perfectly valid of course.
> 
> Eventually, one could even use both redundantly to make the
> declaration 
> perfectly clear:
> 
> e.g:
> 
> package Mine;
> use Qt;
> use Qt::isa qw( Qt::PushButton );
> use Qt::slots
>         'foo'   => [];
> 
> [ ... 10 kilo lines ... ]
> 
> sub foo : slot()
> {
>    ...
> }
> 
> this would need some extra code to check for conflicting declarations
> and if 
> so, decide something ( probably to die )
> 
> Otherwise, I was wondering wether the uppercase form 
>   
>   sub foo : SLOT( int )
> 
> wouldn't be even clearer, has it answers in an obvious way to the
> connect() 
> syntax?
> Noisy though.
> 
> 
> Germain
> 
> 
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-perl


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com


More information about the Kde-perl mailing list