-
大小: 1.91MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2023-08-16
- 語言: 其他
- 標簽:
資源簡介
qt雙緩存實時曲線 可監測數據波動等嵌入式界面設計,絕對可用

代碼片段和文件信息
/****************************************************************************
**?$Id:?qt/display.cpp???3.2.1???edited?Jun?25?18:25?$
**
**?Copyright?(C)?1992-2001?Trolltech?AS.??All?rights?reserved.
**
**?This?file?is?part?of?an?example?program?for?Qt.??This?example
**?program?may?be?used?distributed?and?modified?without?limitation.
**
*****************************************************************************/
#include?“display.h“
#include?
#include?
#include?
#include?
#include?ame.h>
#include?
#include?
#include?
#include?
#include?
Screen::Screen(??QWidget?*parent?const?char?*name?)
????:?Qframe(?parent?name?)
{
????setLineWidth(?frameWidth?);
????setframestyle(?Panel?|?Sunken?);
????setBackgroundMode(?Palettebase?);
????setSizePolicy(?QSizePolicy::MinimumExpanding?QSizePolicy::MinimumExpanding?);
????setPaletteBackgroundColor(?black?);
????setPaletteForegroundColor(?blue?);
????yval?=?new?int[width()];
????memset(?yval?0?sizeof(int)*width()?);
????pos0?=?0;
????t0?=?0;
????step?=?0;
}
Screen::~Screen()
{
????delete?yval;
}
void?Screen::resizeEvent(?QResizeEvent?*e?)
{
????delete?yval;
????int?w?=?e->size().width();
????yval?=?new?int[w];
????memset(?yval?0?sizeof(int)*w);
}
void?Screen::animate()
{
????if?(?step?==?0?)
return;
????int?t?=?t0;
????int?p?=?pos0;
????if?(?step?0?)?{
t?+=?width()?+?step;
????}?else?{
t?-=?step;
p?-=?step;
if?(?p?0?)
????p?+=?width();
???}
????for?(?int?i?=?0;?i? int?y?=?(int)((height()-frameWidth)/2?*?sin(?3.1415*(double)t/180.0?));
yval[?p?]?=?y;
++t;
t?%=?360;
++p;
p?%=?width();
????}
????t0?-=?step;
????if?(?t0?0?)
t0?+=?360;
????pos0?=?(pos0?-?step)?%?width();
????if?(?pos0?0?)
pos0?+=?width();
????scroll(?step?0?QRect(?frameWidth?frameWidth?width()-2*frameWidth?height()-2*frameWidth?));
}
void?Screen::setStep(?int?s?)
{
????step?=?s;
}
void?Screen::drawContents(?QPainter?*p?)
{
????QRect?r?=?p->hasClipping()??
??????p->clipRegion().boundingRect()?:?contentsRect();
????int?vp?=?(?r.left()?-?frameWidth?+?pos0?)?%?width();
????int?y0?=?frameWidth?+?height()/2;
????
????for?(?int?x?=?r.left();?x?<=?r.right();?x++?)?{
p->drawLine(?x?y0?+?yval[?vp?]?x?r.bottom());
++vp;
vp?%=?width();
????}
}
/***********************************************************************/
Curve::Curve(?QWidget?*parent?const?char?*name?)
????:?Qframe(?parent?name?)
{
????setLineWidth(?frameWidth?);
????setframestyle(?Panel?|?Sunken?);
????setBackgroundMode(?Palettebase?);
????setPaletteBackgroundColor(black);
????setPaletteForegroundColor(red);
????setSizePolicy(?QSizePolicy::MinimumExpanding?QSizePolicy::MinimumExpanding?);
????shift?=?0;
????n?=?1;
}
void?Curve::drawContents(?QPainter?*p?)
{
????p->moveTo(?width()/2
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3277??2009-04-03?11:25??qtshuanghuancun\qthumbwheel.h
?????文件???????6758??2009-04-03?11:25??qtshuanghuancun\qthumbwheel.cpp
?????文件??????33446??2009-04-03?11:25??qtshuanghuancun\Makefile
?????文件???????9730??2009-04-03?11:25??qtshuanghuancun\main.cpp
?????文件??????70478??2009-04-03?11:25??qtshuanghuancun\icons.h
?????文件????????807??2009-04-03?11:25??qtshuanghuancun\graph.h
?????文件??????10564??2009-04-03?11:25??qtshuanghuancun\graph.cpp
?????文件???????1163??2009-04-03?11:25??qtshuanghuancun\fr
?????文件???????4887??2009-04-03?11:25??qtshuanghuancun\fr
?????文件???????1945??2009-04-03?11:25??qtshuanghuancun\display.h
?????文件???????5487??2009-04-03?11:25??qtshuanghuancun\display.cpp
?????文件???????2213??2009-04-03?11:25??qtshuanghuancun\demo.pro
?????文件????????328??2009-04-03?11:25??qtshuanghuancun\demo.doc
?????文件????????718??2009-04-03?11:25??qtshuanghuancun\categoryinterface.h
?????文件??????36497??2009-04-03?11:25??qtshuanghuancun\demo.dsp
?????文件?????802816??2009-04-03?11:27??qtshuanghuancun\demo.exe
?????文件??????????4??2009-04-03?12:29??qtshuanghuancun\.history
?????文件??????????4??2009-04-03?12:29??qtshuanghuancun\.bookmarks
?????文件????????531??2009-04-03?12:35??qtshuanghuancun\demo.dsw
?????文件?????246784??2009-04-03?12:40??qtshuanghuancun\demo.ncb
?????文件??????48640??2009-04-03?12:40??qtshuanghuancun\demo.opt
?????文件???????1379??2009-04-03?11:25??qtshuanghuancun\widgets\widgetsba
?????文件?????139141??2009-04-03?11:25??qtshuanghuancun\widgets\widgetsba
?????文件???????1429??2009-04-03?11:25??qtshuanghuancun\widgets\widgetsba
?????文件?????145874??2009-04-03?11:25??qtshuanghuancun\widgets\widgetsba
?????文件???????3722??2009-04-03?11:27??qtshuanghuancun\widgets\widgetsba
?????文件?????158116??2009-04-03?11:27??qtshuanghuancun\widgets\widgetsba
?????文件??????41603??2009-04-03?11:25??qtshuanghuancun\translations\demo_iw.ts
?????文件??????13115??2009-04-03?11:25??qtshuanghuancun\translations\demo_iw.qm
?????文件??????40139??2009-04-03?11:25??qtshuanghuancun\translations\demo_fr.ts
............此處省略389個文件信息
- 上一篇:兩個火車票務管理系統數據結構
- 下一篇:fiddler抓包教程
評論
共有 條評論