#!/usr/bin/perl -w
package MyWidget;

use Qt 2.0;
import Qt::app;

@ISA = qw(Qt::Widget);

sub new {
    my $self = shift->SUPER::new(@_);

    $self->setMinimumSize(200, 120);
    $self->setMaximumSize(200, 120);

    my $quit = Qt::PushButton->new('Quit', $self, 'quit');
    $quit->setGeometry(62, 40, 75, 30);
    $quit->setFont(Qt::Font->new('Times', 18, Qt::Font::Bold));

    $app->connect($quit, 'clicked()', 'quit()');

    return $self;
}

package main;

use Qt 2.0;
import Qt::app;

$w = MyWidget->new;
$w->setGeometry(100, 100, 200, 120);
$app->setMainWidget($w);
$w->show();
exit $app->exec();

