#include "MyQlabel.h"
#include <qimage.h>
#include <qpixmap.h>
MyWaveBox::MyWaveBox( QWidget* parent,const char* name)
:QWidget(parent)
{
int x=0;
back_pix=new QPixmap();
QPainter pix(back_pix);
for(x=0;x<300;x+=5)
{
pix.drawLine(x,0,x,300);
pix.drawLine(0,x,300,x);
}
}
void MyWaveBox::enterEvent(QEvent *e)
{
}
void MyWaveBox::leaveEvent(QEvent *e)
{
}
void MyWaveBox::send_in(int x1,int y1,int x2,int y2)
{
QPainter painter(this);
pix.drawLine((300-x1),y1,(300-x2),y2);
}
void MyWaveBox::P_update()
{
repaint(FALSE);
}
MyWaveBox::~MyWaveBox()
{
}
void MyWaveBox::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.drawPixmap(0,0,*back_pix);
}
- 1
- 2
- 3
- 4
- 5
前往页