source: trunk/examples/demo/display.h@ 168

Last change on this file since 168 was 160, checked in by dmik, 19 years ago

Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1/****************************************************************************
2** $Id: display.h 160 2006-12-11 20:15:57Z 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#ifndef DISPLAY_H
12#define DISPLAY_H
13
14#ifndef QT_H
15#include <qwidget.h>
16#include <qframe.h>
17#endif // QT_H
18
19class QTimer;
20class QDial;
21class QLCDNumber;
22class QProgressBar;
23class QSpinBox;
24class Screen;
25class Curve;
26
27class DisplayWidget : public QWidget {
28 Q_OBJECT
29public:
30 DisplayWidget( QWidget *parent=0, const char *name=0 );
31
32 void run();
33 void stop();
34
35protected:
36 virtual void showEvent( QShowEvent * );
37 virtual void hideEvent( QHideEvent * );
38
39private slots:
40 void tick();
41
42private:
43 Screen *screen;
44 QDial *dial;
45 Curve *curve;
46 QSpinBox *spin;
47 QLCDNumber *lcd;
48 int lcdval;
49 QProgressBar *bar;
50 int tbar;
51 QTimer *timer;
52};
53
54class Screen : public QFrame {
55 Q_OBJECT
56public:
57 enum { FrameWidth = 3 };
58 Screen( QWidget *parent=0, const char *name=0 );
59 ~Screen();
60
61 void animate();
62
63public slots:
64 void setStep( int s );
65
66protected:
67 virtual void drawContents( QPainter * );
68 virtual void resizeEvent( QResizeEvent * );
69
70private:
71 int *yval;
72 int pos0; // buffer pointer for x == 0
73 int t0; // time parameter at x == 0
74 int step;
75};
76
77class Curve : public QFrame {
78 Q_OBJECT
79 enum { FrameWidth = 3 };
80public:
81 Curve( QWidget *parent=0, const char *name=0 );
82
83 void animate();
84public slots:
85 void setFactor( int );
86
87protected:
88 virtual void drawContents( QPainter * );
89
90private:
91 int shift, n;
92};
93
94#endif // PLOT_H
Note: See TracBrowser for help on using the repository browser.