[Kde-perl] Help with connect

Andrea Benazzo dolphin at slacky.it
Sun Jul 3 12:41:39 CEST 2005


Hi! 

I need some help with the signal-slot machine... 

I created this little script, but I've a problem with the correctness of the 
"connect". 


please, tell me where's the error, since I've lsot a couple of hours till 
now, but I found nothing, 

I attach the script. 

Thank you, 

Andy
-------------- next part --------------
#!/usr/bin/perl

use strict;
use warnings;
use Qt;
use Qt::debug;
use utf8;


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

my $wid=Qt::Widget("Main widget");
$wid->setCaption("Display the stem");
$app->setMainWidget($wid);


#setting the layout&title
my $vertical=Qt::VBoxLayout($wid,5,7,"vertical");
my $title=Qt::Label("Find the stem of an Arabic word",$wid,"title");
$vertical->addWidget($title);
my $box=Qt::GridLayout(undef,2,2,5,7,"box");
$vertical->addLayout($box);

#setting the input text edit
my $lb_input=Qt::Label ("Input word:",$wid,"label");
$box->addWidget($lb_input,1,1);
my $te_input=Qt::TextEdit("",undef,$wid,"input word");
$box->addWidget($te_input,1,2);

#setting the Stem button
my $pb_stem=Qt::PushButton("&Stem", $wid,"stem button");
$box->addWidget($pb_stem,1,3);

#setting the output text edit
my $lb_stem=Qt::Label ("Stem:",$wid,"label2");
$box->addWidget($lb_stem,2,1);
my $te_output=Qt::TextEdit("",undef,$wid,"output stem");
$te_output->setReadOnly(1);
$box->addWidget($te_output,2,2);
$te_output->connect($pb_stem, SIGNAL 'clicked()', SLOT 'setText("CIAO!!")');

#setting the Quit button
my $pb_quit=Qt::PushButton("&Quit", $wid);
$vertical->addWidget($pb_quit,1,3);



$wid->show;


exit $app->exec;


More information about the Kde-perl mailing list