screen.h

来自「在ARM9和ARMLinux下利用QT编写的实时数据采集」· C头文件 代码 · 共 70 行

H
70
字号
#ifndef SCREEN_H#define SCREEN_H#include <qframe.h>#include <qvaluevector.h>#include <qpixmap.h> 
#include <qpainter.h>

#define FRAMEWIDTH		3
#define STEP			5
#define BASEFONTHEIGHT		12	//20
#define BASELINELENGHT 	5
#define SPACEMARGIN		2	//5
//#define StringYTitle	QObject::tr( "Operation Value" )
//#define StringXTitle	QObject::tr( "Time (hh:mm:ss)" )//class QPixmap;class QRect;//class QPainter;
class QString;
class Screen : public QFrame {	Q_OBJECTpublic:	//enum { FrameWidth = 3, Step = 5, BaseFontHeight =20 };
	//enum { BaseLineLenght = 5 };
	//enum { SpaceMargin = 5};	Screen( QWidget *parent=0, const char *name=0, WFlags flags=0 );	    	void animate( double y);	void setXTitle(	QString str );
	void setYTitle( QString str );
	//void init();
protected:   	void initNumber( void );  	void initCordinate( QPainter &p );
	void updateCurve( QPainter &p );	//virtual void paintEvent ( QPaintEvent * );	virtual void showEvent ( QShowEvent * );	virtual void hideEvent ( QHideEvent * );
	QSize minimumSize () const;
public:  	double newY, oldY;	int numXTicks, numYTicks;	QValueVector< double > Yval;	bool firstShow;		int sec, min, hour;
	int numX;
	bool drawDotLine;
	QPixmap saveBuffer, newBuffer, midBuffer;	QRect rectCordinate;	QRect fromSaveRect;	QRect toNewRect;
	QRect rectYText;
	QRect rectXText;
	/*We use this painter to draw evering on the newbuffer.*/
	QPainter drawPainter;

	QString stringYTitle;
	QString stringXTitle;};#endif /*SCREEN_H*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?