int flag=0, flag1=0;CVIAZ_N::CVIAZ_N(QWidget *parent, Qt::WFlags flags) : QWidget(parent, flags){img2=new QImage(ui.fr_Niz->width()*2,ui.fr_Niz->height()*2,QImage::Format_RGB32);ui.fr_Niz->installEventFilter(this);this->installEventFilter(this);}bool CVIAZ_N::eventFilter(QObject *obj, QEvent *event){ if (event->type() == QEvent::Paint)if(obj==ui.fr_Niz && IN_98_PMN.regim_sv==5 && flag_atgs==1) { paint1=new QPainter(ui.fr_Niz); paint1->drawImage(0,0,*img2,0,flag,820,440); draw_atgs(); delete paint1; } else {return false;} }else {return false;}}void CVIAZ_N::draw_atgs(){ paint=new QPainter(img2); paint->initFrom(this); paint->setPen(QPen(Qt::white,1, Qt::SolidLine)); paint->fillRect(0,0,870,440,QBrush(QColor(77,77,77))); paint->fillRect(20,0,838,430,QBrush(QColor(0,0,0)));// 818 пиксел поле водопада paint->drawLine(20,430,20,0); paint->drawLine(20,105,15,105); paint->drawLine(20,210,15,210); paint->drawLine(20,315,15,315); paint->drawLine(20,0,15,0); paint->drawLine(20,420,15,420); delete paint;}int CVIAZ_N::vodopad_atgs(){ paint=new QPainter(img2); int mycolor=0,my_red=0,my_green=0,my_blue=0; for (int i=0;i<818;i++) { mycolor=mass_color[i]; my_red=bgy_colors[mycolor][0]; my_green=bgy_colors[mycolor][1]; my_blue=bgy_colors[mycolor][2]; paint->setPen(QColor(my_red,my_green,my_blue)); paint->drawPoint(i+20,430-2*flag1); paint->drawPoint(i+20,858-2*flag1+1); } flag1++; return flag1;}void CVIAZ_N::on_bn_Pr_ATGS_clicked(bool at){ ui.fr_Niz_ATGS_A->show(); if(at==true) {ui.bn_Pr_KS->setChecked(false); flag_atgs=1; atgs_color(); draw_atgs(); vodopad_atgs(); } else flag_atgs=0;}void CVIAZ_N::atgs_color(){ int k=0; for(int i=0;i<818;i++)mass_color[i]=0; for(int i=0;i<818;i++) {k=qrand(); while (k<0 || k>128) { k=qrand(); } mass_color[i]=k; }}void CVIAZ_N::Ttime(){update(); flag--;}