#!/usr/bin/perl -w # Name : PerlQt PictView # Author : Terrence Ma # Email : terrence@terrence.com # Web : http://www.terrence.com # Date : V1.0 04/06/2003 # License : GNU GPL - http://www.gnu.org/copyleft/gpl.html # Warranty : No Warranty # see http://www.terrence.com/qt/pictview/pictview.html use strict; use Qt; my($myapp, $filename, $mypixmap, $mylabel); $myapp = Qt::Application(\@ARGV); $filename = $ARGV[0]; if (!($filename)) { print("Usage: pictview.pl filename\n"); exit(0); } $mypixmap = Qt::Pixmap(); $mypixmap->load($filename); $mylabel = Qt::Label(undef); $mylabel->resize($mypixmap->size()); $mylabel->setPixmap($mypixmap); $myapp->setMainWidget($mylabel); $mylabel->setCaption("PerlQt PictView"); $mylabel->show(); exit $myapp->exec();