|
Last change
on this file since 92 was 67, checked in by dmik, 20 years ago |
|
Imported canvas and session manager sources from the official release 3.3.1 from Trolltech.
|
-
Property svn:keywords
set to
Id
|
|
File size:
921 bytes
|
| Line | |
|---|
| 1 | #include <qstatusbar.h>
|
|---|
| 2 | #include <qmessagebox.h>
|
|---|
| 3 | #include <qmenubar.h>
|
|---|
| 4 | #include <qapplication.h>
|
|---|
| 5 | #include <qimage.h>
|
|---|
| 6 |
|
|---|
| 7 | #include "canvas.h"
|
|---|
| 8 |
|
|---|
| 9 | #include <stdlib.h>
|
|---|
| 10 |
|
|---|
| 11 | extern QString butterfly_fn;
|
|---|
| 12 | extern QString logo_fn;
|
|---|
| 13 |
|
|---|
| 14 | int main(int argc, char** argv)
|
|---|
| 15 | {
|
|---|
| 16 | QApplication app(argc,argv);
|
|---|
| 17 |
|
|---|
| 18 | if ( argc > 1 )
|
|---|
| 19 | butterfly_fn = argv[1];
|
|---|
| 20 | else
|
|---|
| 21 | butterfly_fn = "butterfly.png";
|
|---|
| 22 |
|
|---|
| 23 | if ( argc > 2 )
|
|---|
| 24 | logo_fn = argv[2];
|
|---|
| 25 | else
|
|---|
| 26 | logo_fn = "qtlogo.png";
|
|---|
| 27 |
|
|---|
| 28 | QCanvas canvas(800,600);
|
|---|
| 29 | canvas.setAdvancePeriod(30);
|
|---|
| 30 | Main m(canvas);
|
|---|
| 31 | m.resize(m.sizeHint());
|
|---|
| 32 | m.setCaption("Qt Example - Canvas");
|
|---|
| 33 | if ( QApplication::desktop()->width() > m.width() + 10
|
|---|
| 34 | && QApplication::desktop()->height() > m.height() +30 )
|
|---|
| 35 | m.show();
|
|---|
| 36 | else
|
|---|
| 37 | m.showMaximized();
|
|---|
| 38 |
|
|---|
| 39 | QObject::connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()) );
|
|---|
| 40 |
|
|---|
| 41 | return app.exec();
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.