home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / qwerty / main.cpp < prev    next >
C/C++ Source or Header  |  2001-10-11  |  1KB  |  39 lines

  1. /****************************************************************************
  2. ** $Id:  qt/main.cpp   3.0.0   edited Jun 22 13:24 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #include <qapplication.h>
  12. #include "qwerty.h"
  13.  
  14.  
  15. int main( int argc, char **argv )
  16. {
  17.     QApplication a( argc, argv );
  18.  
  19.     
  20.     bool isSmall =  qApp->desktop()->size().width() < 450 
  21.           || qApp->desktop()->size().height() < 450;
  22.     
  23.     int i;
  24.     for ( i= argc <= 1 ? 0 : 1; i<argc; i++ ) {
  25.     Editor *e = new Editor;
  26.     e->setCaption("Qt Example - QWERTY");
  27.     if ( i > 0 )
  28.         e->load( argv[i] );
  29.     if ( isSmall ) {
  30.         e->showMaximized();
  31.     } else {
  32.         e->resize( 400, 400 );
  33.         e->show();
  34.     }
  35.     }
  36.     a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
  37.     return a.exec();
  38. }
  39.