[Kde-bindings] PerlQt constructor syntax

Richard Dale rdale at foton.es
Wed May 27 16:06:27 UTC 2009


On Wednesday 27 May 2009 03:26:14 pm Jonathan Yu wrote:
> Richard:
>
> The reasoning behind naming it "Qt4" instead of just "Qt" is that
> there is currently a module by that name, and some on the CPAN
> module-authors mailing list have objected to the idea of taking over a
> namespace like that.
>
> However, I can see what the PAUSE admins might think, and if they are
> okay with us taking it over (no release was made by those authors
> since 1997 on CPAN) then we can take it over and use it for ourselves.
>
> Primarily the issue people seem to have is backward compatibility,
> though if we only ever need to provide support for the newest version
> (except for critical security fixes) then this isn't an issue.
>
> I just think given past experiences we should have a plan in mind for
> transitioning when Qt5 is out, however long off on the horizon that
> may be.
>
> Cheers,
>
> Jonathan
>
> On Wed, May 27, 2009 at 5:29 AM, Richard Dale <rdale at foton.es> wrote:
> > On Wednesday 27 May 2009 06:24:04 am Chris Burel wrote:
> >> I originally sent this directly to who I believe are the authors of
> >> PerlQt3, Ashley Winters and Germain Garand.  But I figured someone on
> >> the kde-bindings list might have some input on this as well.
> >>
> >>
> >> ---------- Forwarded message ----------
> >> From: Chris Burel <chrisburel at gmail.com>
> >> Date: Tue, May 26, 2009 at 2:36 PM
> >> Subject: PerlQt constructor syntax
> >>
> >> There's a pretty lengthy discussion going on right now on perl's
> >> module-writers list about the syntax of a new Qt4 module.  You can see
> >> it here:
> >> http://www.nntp.perl.org/group/perl.module-authors/2009/05/msg7591.html
> >
> > I don't have an opinion about the Perl constructor syntax one way or
> > another, but to me the suggestion to name the classes like
> > 'Qt4::PushButton' instead of Qt::PushButton is really ugly.
> >
> > It's great to see that the Qt4 version of PerlQt is picking up steam
> > anyway. Do you think that anyone would be doing a KDE version? If so, it
> > would be really nice to have the PerlQt and PerlKDE projects in the
> > kdebindings svn, as then we would have 4 different Smoke based bindings
> > there and it would be easier to coordinate the projects when we were
> > improving the Smoke libs.
I can see a reason for calling the xs extension that you use Qt4 instead of 
Qt, but the only point of renaming the classes would be if you want to use 
them in the same program, which nobody would. In perl if you say:

use Qt4;

Does that mean the classes have to begin with Qt4:: too? In QtRuby for Qt3 you 
do:

require 'Qt' or require 'Qt3'

and for Qt4:

require 'Qt4'

And the classes are called 'Qt::Widget' etc in both cases. I don't know enough 
about perl to see why it wouldn't be the same as Ruby here though.

-- Richard



More information about the Kde-bindings mailing list