Last change
on this file since 7 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:
952 bytes
|
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 <qapplication.h>
|
---|
12 | #include <stdlib.h>
|
---|
13 | #include "tictac.h"
|
---|
14 |
|
---|
15 |
|
---|
16 | int main( int argc, char **argv )
|
---|
17 | {
|
---|
18 | QApplication a( argc, argv );
|
---|
19 | int n = 3;
|
---|
20 | if ( argc == 2 ) // get board size n
|
---|
21 | n = atoi(argv[1]);
|
---|
22 | if ( n < 3 || n > 10 ) { // out of range
|
---|
23 | qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] );
|
---|
24 | return 1;
|
---|
25 | }
|
---|
26 | TicTacToe ttt( n ); // create game
|
---|
27 | a.setMainWidget( &ttt );
|
---|
28 | ttt.setCaption("Qt Example - TicTac");
|
---|
29 | ttt.show(); // show widget
|
---|
30 | return a.exec(); // go
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.