[Kde-perl] I've a interesting issue with PerlQt 3.008

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Aug 17 03:14:36 CEST 2004


On Tuesday 17 August 2004 01:36, Gary Greene wrote:
>
> The script follows:
> #!/usr/bin/perl
> use Qt 2.0;
> use Qt::app;
>
> $mylabel = new Qt::Label( "Hello world", 0 );
> $mylabel->resize( 120, 30 );
>
> $app->setMainWidget( $mylabel );
> $mylabel->show();
>
> exit $app->exec();
>
> Is the "use Qt 2.0;" line the culprit? I'll admit that I'm using Qt 3.3.3
> with the bindings.
Umm.. yes indeed
> Any help is appreciated. Thanks.
Please compare and contrast your code with this 'Hello World' tutorial 
PerlQt/tutorials/t1 in PerlQt 3.008:

#!/usr/bin/perl -w
use strict;
use blib;
use Qt;

my $a = Qt::Application(\@ARGV);

my $hello = Qt::PushButton("Hello World!", undef);
$hello->resize(100, 30);

$a->setMainWidget($hello);
$hello->show;
exit $a->exec;

I assume you've copied a code snippet from the obsolete PerlQt 2.x bindings, 
otherwise where does the 'use Qt 2.0' come from?

-- Richard


More information about the Kde-perl mailing list