#!/usr/bin/perl -w
import
Qt::app;
@ISA
=
qw(Qt::VBox)
;
sub
new {
my
$self
=
shift
->SUPER::new(
@_
);
my
$quit
= Qt::PushButton->new(
'Quit'
,
$self
,
'quit'
);
$quit
->setFont(Qt::Font->new(
'Times'
, 18, Qt::Font::Bold));
$app
->
connect
(
$quit
,
'clicked()'
,
'quit()'
);
my
$grid
= Qt::Grid->new(4,
$self
);
my
$previous
;
for
(
my
$r
= 0;
$r
< 4;
$r
++) {
for
(
my
$c
= 0;
$c
< 4;
$c
++) {
my
$lr
= LCDRange->new(
$grid
);
$previous
->
connect
(
$lr
,
'valueChanged(int)'
,
'setValue(int)'
)
if
$previous
;
$previous
=
$lr
;
}
}
return
$self
;
}
import
Qt::app;
$w
= MyWidget->new;
$app
->setMainWidget(
$w
);
$w
->show();
exit
$app
->
exec
();