|
Last change
on this file since 94 was 2, checked in by dmik, 20 years ago |
|
Imported xplatform parts of the official release 3.3.1 from Trolltech
|
-
Property svn:keywords
set to
Id
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /****************************************************************************
|
|---|
| 2 | ** $Id: main.cpp 2 2005-11-16 15:49:26Z dmik $
|
|---|
| 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 <qdir.h>
|
|---|
| 14 | #include <stdlib.h>
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | int main( int argc, char ** argv )
|
|---|
| 18 | {
|
|---|
| 19 | QApplication::setColorSpec( QApplication::ManyColor );
|
|---|
| 20 | QApplication a(argc, argv);
|
|---|
| 21 |
|
|---|
| 22 | QString home;
|
|---|
| 23 | if (argc > 1) {
|
|---|
| 24 | home = argv[1];
|
|---|
| 25 | } else {
|
|---|
| 26 | // Use a hard coded path. It is only an example.
|
|---|
| 27 | home = QDir( "../../doc/html/index.html" ).absPath();
|
|---|
| 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 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.