Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "vrem_hir_1.h"
- #include "ui_vrem_hir_1.h"
- #include "hirurg.h"
- #include "QString"
- //#include "QMouseEvent"
- //#include "QWidget"
- extern bool flag = false;
- extern int fff=0;
- extern QString str="";
- extern bool flag_1=false;
- extern bool flag_2 = false;
- vrem_hir_1::vrem_hir_1(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::vrem_hir_1)
- {
- // installEventFilter(this);
- ui->setupUi(this);
- // ui->pushButton_2->setFocusPolicy( Qt::StrongFocus);
- //ui->pushButton_2->setFocus();
- // if(ui->pushButton_2->hasFocus()){
- // ui->pushButton_2->setText("123");
- // }
- // else ui->pushButton_2->setText("хуй");
- ui->pushButton_2->installEventFilter(this);
- if(flag_1==false){
- ui->pushButton->setStyleSheet("background: red;color:white");
- if (fff==2) ui->pushButton_2->setStyleSheet("background: red;color:white");
- else ui->pushButton_2->setStyleSheet("background: green;color:white");
- if(fff==3) ui->pushButton_3->setStyleSheet("background: red;color:white");
- else ui->pushButton_3->setStyleSheet("background: green;color:white");
- ui->pushButton_4->setStyleSheet("background: red;color:white");
- ui->pushButton_5->setStyleSheet("background: red;color:white");
- if(fff==6) ui->pushButton_6->setStyleSheet("background: red;color:white");
- else ui->pushButton_6->setStyleSheet("background: green;color:white");
- if(fff==7) ui->pushButton_7->setStyleSheet("background: red;color:white");
- else ui->pushButton_7->setStyleSheet("background: green;color:white");
- ui->pushButton_8->setStyleSheet("background: red;color:white");
- ui->pushButton_9->setStyleSheet("background: red;color:white");
- if(fff==10) ui->pushButton_10->setStyleSheet("background: red;color:white");
- else ui->pushButton_10->setStyleSheet("background: green;color:white");
- if(fff==11) ui->pushButton_11->setStyleSheet("background: red;color:white");
- else ui->pushButton_11->setStyleSheet("background: green;color:white");
- ui->pushButton_12->setStyleSheet("background: red;color:white");
- if(fff==13)ui->pushButton_13->setStyleSheet("background: red;color:white");
- else ui->pushButton_13->setStyleSheet("background: green;color:white");
- if(fff==14) ui->pushButton_14->setStyleSheet("background: red;color:white");
- else ui->pushButton_14->setStyleSheet("background: green;color:white");
- ui->pushButton_15->setStyleSheet("background: red;color:white");
- if(fff==16) ui->pushButton_16->setStyleSheet("background: red;color:white");
- else ui->pushButton_16->setStyleSheet("background: green;color:white");
- ui->pushButton_17->setStyleSheet("background: red;color:white");
- if (fff==18) ui->pushButton_18->setStyleSheet("background: red;color:white");
- else ui->pushButton_18->setStyleSheet("background: green;color:white");
- }
- else if(flag_1==true){
- ui->pushButton->setStyleSheet("background: black;color:white");
- if (fff==2) ui->pushButton_2->setStyleSheet("background: black;color:white");
- else ui->pushButton_2->setStyleSheet("background: white;color:black");
- if(fff==3) ui->pushButton_3->setStyleSheet("background: black;color:white");
- else ui->pushButton_3->setStyleSheet("background: white;color:black");
- ui->pushButton_4->setStyleSheet("background: black;color:white");
- ui->pushButton_5->setStyleSheet("background: black;color:white");
- if(fff==6) ui->pushButton_6->setStyleSheet("background: black;color:white");
- else ui->pushButton_6->setStyleSheet("background: white;color:black");
- if(fff==7) ui->pushButton_7->setStyleSheet("background: black;color:white");
- else ui->pushButton_7->setStyleSheet("background: white;color:black");
- ui->pushButton_8->setStyleSheet("background: black;color:white");
- ui->pushButton_9->setStyleSheet("background: black;color:white");
- if(fff==10) ui->pushButton_10->setStyleSheet("background: black;color:white");
- else ui->pushButton_10->setStyleSheet("background: white;color:black");
- if(fff==11) ui->pushButton_11->setStyleSheet("background: black;color:white");
- else ui->pushButton_11->setStyleSheet("background: white;color:black");
- ui->pushButton_12->setStyleSheet("background: black;color:white");
- if(fff==13)ui->pushButton_13->setStyleSheet("background: balck;color:white");
- else ui->pushButton_13->setStyleSheet("background: white;color:black");
- if(fff==14) ui->pushButton_14->setStyleSheet("background: black;color:white");
- else ui->pushButton_14->setStyleSheet("background: white;color:black");
- ui->pushButton_15->setStyleSheet("background: black;color:white");
- if(fff==16) ui->pushButton_16->setStyleSheet("background: black;color:white");
- else ui->pushButton_16->setStyleSheet("background: white;color:black");
- ui->pushButton_17->setStyleSheet("background: black;color:white");
- if (fff==18) ui->pushButton_18->setStyleSheet("background: black;color:white");
- else ui->pushButton_18->setStyleSheet("background: white;color:black");
- //ui->pushButton_2->setFocusPolicy( Qt::TabFocus);
- //if (ui->pushButton_2->focusPolicy()== Qt::TabFocus && ui->pushButton_2->hasFocus()){
- //ui->pushButton_2->setText("123");
- // }
- //if(ui->pushButton_2->hasFocus())
- //ui->pushButton_2->setText("123");
- }
- if(flag_2==true){
- ui->pushButton->setFixedHeight(60);
- ui->pushButton->setFixedWidth(140);
- ui->pushButton_2->setFixedHeight(60);
- ui->pushButton_2->setFixedWidth(140);
- ui->pushButton_3->setFixedHeight(60);
- ui->pushButton_3->setFixedWidth(140);
- ui->pushButton_4->setFixedHeight(60);
- ui->pushButton_4->setFixedWidth(140);
- ui->pushButton_5->setFixedHeight(60);
- ui->pushButton_5->setFixedWidth(140);
- ui->pushButton_6->setFixedHeight(60);
- ui->pushButton_6->setFixedWidth(140);
- ui->pushButton_7->setFixedHeight(60);
- ui->pushButton_7->setFixedWidth(140);
- ui->pushButton_8->setFixedHeight(60);
- ui->pushButton_8->setFixedWidth(140);
- ui->pushButton_9->setFixedHeight(60);
- ui->pushButton_9->setFixedWidth(140);
- ui->pushButton_10->setFixedHeight(60);
- ui->pushButton_10->setFixedWidth(140);
- ui->pushButton_11->setFixedHeight(60);
- ui->pushButton_11->setFixedWidth(140);
- ui->pushButton_12->setFixedHeight(60);
- ui->pushButton_12->setFixedWidth(140);
- ui->pushButton_13->setFixedHeight(60);
- ui->pushButton_13->setFixedWidth(140);
- ui->pushButton_14->setFixedHeight(60);
- ui->pushButton_14->setFixedWidth(140);
- ui->pushButton_15->setFixedHeight(60);
- ui->pushButton_15->setFixedWidth(140);
- ui->pushButton_16->setFixedHeight(60);
- ui->pushButton_16->setFixedWidth(140);
- ui->pushButton_17->setFixedHeight(60);
- ui->pushButton_17->setFixedWidth(140);
- ui->pushButton_18->setFixedHeight(60);
- ui->pushButton_18->setFixedWidth(140);
- }
- else if(flag_2==false){
- ui->pushButton->setFixedHeight(30);
- ui->pushButton->setFixedWidth(70);
- ui->pushButton_2->setFixedHeight(30);
- ui->pushButton_2->setFixedWidth(70);
- ui->pushButton_3->setFixedHeight(30);
- ui->pushButton_3->setFixedWidth(70);
- ui->pushButton_4->setFixedHeight(30);
- ui->pushButton_4->setFixedWidth(70);
- ui->pushButton_5->setFixedHeight(30);
- ui->pushButton_5->setFixedWidth(70);
- ui->pushButton_6->setFixedHeight(30);
- ui->pushButton_6->setFixedWidth(70);
- ui->pushButton_7->setFixedHeight(30);
- ui->pushButton_7->setFixedWidth(70);
- ui->pushButton_8->setFixedHeight(30);
- ui->pushButton_8->setFixedWidth(70);
- ui->pushButton_9->setFixedHeight(30);
- ui->pushButton_9->setFixedWidth(70);
- ui->pushButton_10->setFixedHeight(30);
- ui->pushButton_10->setFixedWidth(70);
- ui->pushButton_11->setFixedHeight(30);
- ui->pushButton_11->setFixedWidth(70);
- ui->pushButton_12->setFixedHeight(30);
- ui->pushButton_12->setFixedWidth(70);
- ui->pushButton_13->setFixedHeight(30);
- ui->pushButton_13->setFixedWidth(70);
- ui->pushButton_14->setFixedHeight(30);
- ui->pushButton_14->setFixedWidth(70);
- ui->pushButton_15->setFixedHeight(30);
- ui->pushButton_15->setFixedWidth(70);
- ui->pushButton_16->setFixedHeight(30);
- ui->pushButton_16->setFixedWidth(70);
- ui->pushButton_17->setFixedHeight(30);
- ui->pushButton_17->setFixedWidth(70);
- ui->pushButton_18->setFixedHeight(30);
- ui->pushButton_18->setFixedWidth(70);
- }
- ui->pushButton_22->setDisabled(true);
- ui->label->setVisible(false);
- if(flag==true) {
- ui->label->setVisible(true);
- ui->label->setText(str);
- }
- }
- vrem_hir_1::~vrem_hir_1()
- {
- delete ui;
- }
- bool vrem_hir_1::eventFilter(QObject *o, QEvent *e)
- {
- if(o == ui->pushButton_2)
- {
- if(e->type() == QEvent::Enter) {
- ui->pushButton_2->setStyleSheet("background-color: pink");
- return true;
- }
- if(e->type() == QEvent::Leave) {
- ui->pushButton_2->setStyleSheet("background-color: black");
- return true;
- }
- }
- return vrem_hir_1::eventFilter(o, e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement