// Name : Qt PictView // Author : Terrence Ma // Email : terrence@terrence.com // Web : http://www.terrence.com // Date : V1.0 03/16/2003 // License : GNU GPL - http://www.gnu.org/copyleft/gpl.html // Warranty : No Warranty #include #include #include int main( int argc, char* argv[] ) { QApplication myapp( argc, argv ); // see Programming with Qt Example 4-2 p.111 if( argc != 2 ) { qDebug( "Usage: PictView filename\n" ); return 1; } QPixmap mypixmap; mypixmap.load( argv[1] ); QLabel* mylabel = new QLabel( 0 ); mylabel->resize( mypixmap.size() ); mylabel->setPixmap( mypixmap ); myapp.setMainWidget( mylabel ); mylabel->show(); return myapp.exec(); }