On Mon, May 25, 2009 at 6:00 PM, Eric Wilhelm <[email protected]> wrote:
> # from Jonathan Yu
> # on Monday 25 May 2009:
>
>>I'd like to remove the Qt module from CPAN, or be able to take it
>> over.
>
> Hi Jonathan,
>
> That's a good question in general, but for Qt4, I'm inclined to say that
> a better approach would be to use the 'Qt4::' namespace.

This is actually something I've been wondering a lot about.  If the
module is called 'Qt', as the one is for Qt version 3, you'd be unable
to install PerlQt3 and PerlQt4 on the same machine, because there'd be
a namespace collision. But it seems like a pain to have to put
Qt4::PushButton, Qt4::Application in all your code.  One thing I
thought of doing was calling the module Qt4, but that would populate
the Qt namespace.  This would let you install both versions on the
same machine, but only use 1 version per script (who'd want to use 2
different versions of Qt in the same program?).  So you'd have code
that would look like:

use Qt4;
my $app = Qt::Application(\...@argv);
my $button = Qt::PushButton( 'Hello, World!', undef );
etc.
Which seems cool, but I thought it'd be kind of strange for the name
of the module and the name of the namespace it creates not be in sync.
 I believe this is what QtRuby does, however.

>
>>I'm working with someone else on perlqt4 bindings for my Google Summer
>>of Code project, and the currently available version of Qt is from
>>1997 and of little use to anybody. (See: code.google.com/p/perlqt4)
>>

Oddly enough, the most recent PerlQt3 (3.009-b2) module doesn't seem
to be on CPAN, but it is on sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=29255&package_id=21164
.  The most recent one on CPAN is 3.008,
http://search.cpan.org/~ggarand/PerlQt-3.008/

>>We'd like to be able to push the module through CPAN once we're done.
>>In order to do that, we need to remove the existing version and
>>register the namespace to one of us.
>>
>>I think the top-level namespace is appropriate since that's exactly
>>what other packages (ie, Wx) do.
>
> From my tinkering with it thus-far, it appears that Qt3 and Qt4 are
> quite different APIs.  That is, current Perl code written for Qt (3)
> won't "just work", right?

That is most definitely correct.

>
> If it breaks existing code (even if it's a few years old), it's rather
> severe to replace a distribution.
>
> Thus, if it's technically feasible (and doesn't make the API horrid),
> adding a '4' to the package name seems reasonable.  I will be glad to
> help with this as time allows.
>
> --Eric
> --
> Like a lot of people, I was mathematically abused as a child.
> --Paul Graham
> ---------------------------------------------------
>    http://scratchcomputing.com
> ---------------------------------------------------
>

Reply via email to