From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- doc/html/t12-cannon-h.html | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 doc/html/t12-cannon-h.html (limited to 'doc/html/t12-cannon-h.html') diff --git a/doc/html/t12-cannon-h.html b/doc/html/t12-cannon-h.html new file mode 100644 index 0000000..6c98d45 --- /dev/null +++ b/doc/html/t12-cannon-h.html @@ -0,0 +1,106 @@ + + + + + +t12/cannon.h Example File + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

t12/cannon.h Example File

+ + +
/****************************************************************
+**
+** Definition of CannonField class, Qt tutorial 12
+**
+****************************************************************/
+
+#ifndef CANNON_H
+#define CANNON_H
+
+class QTimer;
+
+
+#include <qwidget.h>
+
+
+class CannonField : public QWidget
+{
+    Q_OBJECT
+public:
+    CannonField( QWidget *parent=0, const char *name=0 );
+
+    int   angle() const { return ang; }
+    int   force() const { return f; }
+    QSizePolicy sizePolicy() const;
+
+public slots:
+    void  setAngle( int degrees );
+    void  setForce( int newton );
+    void  shoot();
+    void  newTarget();
+
+private slots:
+    void  moveShot();
+
+signals:
+    void  hit();
+    void  missed();
+    void  angleChanged( int );
+    void  forceChanged( int );
+
+protected:
+    void  paintEvent( QPaintEvent * );
+
+private:
+    void  paintShot( QPainter * );
+    void  paintTarget( QPainter * );
+    void  paintCannon( QPainter * );
+    QRect cannonRect() const;
+    QRect shotRect() const;
+    QRect targetRect() const;
+
+    int ang;
+    int f;
+
+    int timerCount;
+    QTimer * autoShootTimer;
+    float shoot_ang;
+    float shoot_f;
+
+    QPoint target;
+};
+
+
+#endif // CANNON_H
+
+


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ -- cgit v1.2.1