home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / helpviewer / main.cpp < prev    next >
C/C++ Source or Header  |  2001-10-11  |  1KB  |  43 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 "helpwindow.h"
  12. #include <qapplication.h>
  13. #include <qwindowsstyle.h>
  14. #include <qstylesheet.h>
  15. #include <stdlib.h>
  16.  
  17.  
  18. int main( int argc, char ** argv )
  19. {
  20.     QApplication::setColorSpec( QApplication::ManyColor );
  21.     QApplication a(argc, argv);
  22.  
  23.     QString home;
  24.     if (argc > 1)
  25.         home = argv[1];
  26.     else
  27.         home = QString(getenv("QTDIR")) + "/doc/html/index.html";
  28.  
  29.     
  30.     HelpWindow *help = new HelpWindow(home, ".", 0, "help viewer");
  31.     help->setCaption("Qt Example - Helpviewer");
  32.     if ( QApplication::desktop()->width() > 400
  33.      && QApplication::desktop()->height() > 500 )
  34.     help->show();
  35.     else
  36.     help->showMaximized();
  37.  
  38.     QObject::connect( &a, SIGNAL(lastWindowClosed()),
  39.                       &a, SLOT(quit()) );
  40.  
  41.     return a.exec();
  42. }
  43.