Last change
on this file since 127 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:
819 bytes
|
Line | |
---|
1 | /****************************************************************
|
---|
2 | **
|
---|
3 | ** Definition of CannonField class, Qt tutorial 10
|
---|
4 | **
|
---|
5 | ****************************************************************/
|
---|
6 |
|
---|
7 | #ifndef CANNON_H
|
---|
8 | #define CANNON_H
|
---|
9 |
|
---|
10 | #include <qwidget.h>
|
---|
11 |
|
---|
12 |
|
---|
13 | class CannonField : public QWidget
|
---|
14 | {
|
---|
15 | Q_OBJECT
|
---|
16 | public:
|
---|
17 | CannonField( QWidget *parent=0, const char *name=0 );
|
---|
18 |
|
---|
19 | QSizePolicy sizePolicy() const;
|
---|
20 |
|
---|
21 | int angle() const { return ang; }
|
---|
22 | int force() const { return f; }
|
---|
23 |
|
---|
24 | public slots:
|
---|
25 | void setAngle( int degrees );
|
---|
26 | void setForce( int newton );
|
---|
27 |
|
---|
28 | signals:
|
---|
29 | void angleChanged( int );
|
---|
30 | void forceChanged( int );
|
---|
31 |
|
---|
32 | protected:
|
---|
33 | void paintEvent( QPaintEvent * );
|
---|
34 |
|
---|
35 | private:
|
---|
36 | QRect cannonRect() const;
|
---|
37 |
|
---|
38 | int ang;
|
---|
39 | int f;
|
---|
40 | };
|
---|
41 |
|
---|
42 |
|
---|
43 | #endif // CANNON_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.