Advertisement
Pandarec13

11111

May 24th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.26 KB | None | 0 0
  1. #include "vrem_hir_1.h"
  2. #include "ui_vrem_hir_1.h"
  3. #include "hirurg.h"
  4. #include "QString"
  5. //#include "QMouseEvent"
  6. //#include "QWidget"
  7.  
  8. extern bool flag = false;
  9. extern int fff=0;
  10. extern QString str="";
  11. extern bool flag_1=false;
  12. extern bool flag_2 = false;
  13.  
  14. vrem_hir_1::vrem_hir_1(QWidget *parent) :
  15. QWidget(parent),
  16. ui(new Ui::vrem_hir_1)
  17.  
  18. {
  19. // installEventFilter(this);
  20.  
  21.  
  22. ui->setupUi(this);
  23. // ui->pushButton_2->setFocusPolicy( Qt::StrongFocus);
  24. //ui->pushButton_2->setFocus();
  25.  
  26. // if(ui->pushButton_2->hasFocus()){
  27. // ui->pushButton_2->setText("123");
  28. // }
  29. // else ui->pushButton_2->setText("хуй");
  30.  
  31. ui->pushButton_2->installEventFilter(this);
  32.  
  33.  
  34. if(flag_1==false){
  35. ui->pushButton->setStyleSheet("background: red;color:white");
  36.  
  37. if (fff==2) ui->pushButton_2->setStyleSheet("background: red;color:white");
  38. else ui->pushButton_2->setStyleSheet("background: green;color:white");
  39.  
  40. if(fff==3) ui->pushButton_3->setStyleSheet("background: red;color:white");
  41. else ui->pushButton_3->setStyleSheet("background: green;color:white");
  42.  
  43. ui->pushButton_4->setStyleSheet("background: red;color:white");
  44. ui->pushButton_5->setStyleSheet("background: red;color:white");
  45.  
  46. if(fff==6) ui->pushButton_6->setStyleSheet("background: red;color:white");
  47. else ui->pushButton_6->setStyleSheet("background: green;color:white");
  48.  
  49. if(fff==7) ui->pushButton_7->setStyleSheet("background: red;color:white");
  50. else ui->pushButton_7->setStyleSheet("background: green;color:white");
  51.  
  52. ui->pushButton_8->setStyleSheet("background: red;color:white");
  53. ui->pushButton_9->setStyleSheet("background: red;color:white");
  54.  
  55. if(fff==10) ui->pushButton_10->setStyleSheet("background: red;color:white");
  56. else ui->pushButton_10->setStyleSheet("background: green;color:white");
  57.  
  58. if(fff==11) ui->pushButton_11->setStyleSheet("background: red;color:white");
  59. else ui->pushButton_11->setStyleSheet("background: green;color:white");
  60.  
  61. ui->pushButton_12->setStyleSheet("background: red;color:white");
  62.  
  63. if(fff==13)ui->pushButton_13->setStyleSheet("background: red;color:white");
  64. else ui->pushButton_13->setStyleSheet("background: green;color:white");
  65.  
  66. if(fff==14) ui->pushButton_14->setStyleSheet("background: red;color:white");
  67. else ui->pushButton_14->setStyleSheet("background: green;color:white");
  68.  
  69. ui->pushButton_15->setStyleSheet("background: red;color:white");
  70.  
  71. if(fff==16) ui->pushButton_16->setStyleSheet("background: red;color:white");
  72. else ui->pushButton_16->setStyleSheet("background: green;color:white");
  73.  
  74. ui->pushButton_17->setStyleSheet("background: red;color:white");
  75.  
  76. if (fff==18) ui->pushButton_18->setStyleSheet("background: red;color:white");
  77. else ui->pushButton_18->setStyleSheet("background: green;color:white");
  78. }
  79.  
  80. else if(flag_1==true){
  81. ui->pushButton->setStyleSheet("background: black;color:white");
  82.  
  83. if (fff==2) ui->pushButton_2->setStyleSheet("background: black;color:white");
  84. else ui->pushButton_2->setStyleSheet("background: white;color:black");
  85.  
  86. if(fff==3) ui->pushButton_3->setStyleSheet("background: black;color:white");
  87. else ui->pushButton_3->setStyleSheet("background: white;color:black");
  88.  
  89. ui->pushButton_4->setStyleSheet("background: black;color:white");
  90. ui->pushButton_5->setStyleSheet("background: black;color:white");
  91.  
  92. if(fff==6) ui->pushButton_6->setStyleSheet("background: black;color:white");
  93. else ui->pushButton_6->setStyleSheet("background: white;color:black");
  94.  
  95. if(fff==7) ui->pushButton_7->setStyleSheet("background: black;color:white");
  96. else ui->pushButton_7->setStyleSheet("background: white;color:black");
  97.  
  98. ui->pushButton_8->setStyleSheet("background: black;color:white");
  99. ui->pushButton_9->setStyleSheet("background: black;color:white");
  100.  
  101. if(fff==10) ui->pushButton_10->setStyleSheet("background: black;color:white");
  102. else ui->pushButton_10->setStyleSheet("background: white;color:black");
  103.  
  104. if(fff==11) ui->pushButton_11->setStyleSheet("background: black;color:white");
  105. else ui->pushButton_11->setStyleSheet("background: white;color:black");
  106.  
  107. ui->pushButton_12->setStyleSheet("background: black;color:white");
  108.  
  109. if(fff==13)ui->pushButton_13->setStyleSheet("background: balck;color:white");
  110. else ui->pushButton_13->setStyleSheet("background: white;color:black");
  111.  
  112. if(fff==14) ui->pushButton_14->setStyleSheet("background: black;color:white");
  113. else ui->pushButton_14->setStyleSheet("background: white;color:black");
  114.  
  115. ui->pushButton_15->setStyleSheet("background: black;color:white");
  116.  
  117. if(fff==16) ui->pushButton_16->setStyleSheet("background: black;color:white");
  118. else ui->pushButton_16->setStyleSheet("background: white;color:black");
  119.  
  120. ui->pushButton_17->setStyleSheet("background: black;color:white");
  121.  
  122. if (fff==18) ui->pushButton_18->setStyleSheet("background: black;color:white");
  123. else ui->pushButton_18->setStyleSheet("background: white;color:black");
  124.  
  125. //ui->pushButton_2->setFocusPolicy( Qt::TabFocus);
  126. //if (ui->pushButton_2->focusPolicy()== Qt::TabFocus && ui->pushButton_2->hasFocus()){
  127. //ui->pushButton_2->setText("123");
  128. // }
  129.  
  130. //if(ui->pushButton_2->hasFocus())
  131. //ui->pushButton_2->setText("123");
  132.  
  133. }
  134.  
  135. if(flag_2==true){
  136.  
  137. ui->pushButton->setFixedHeight(60);
  138. ui->pushButton->setFixedWidth(140);
  139.  
  140. ui->pushButton_2->setFixedHeight(60);
  141. ui->pushButton_2->setFixedWidth(140);
  142.  
  143. ui->pushButton_3->setFixedHeight(60);
  144. ui->pushButton_3->setFixedWidth(140);
  145.  
  146. ui->pushButton_4->setFixedHeight(60);
  147. ui->pushButton_4->setFixedWidth(140);
  148.  
  149. ui->pushButton_5->setFixedHeight(60);
  150. ui->pushButton_5->setFixedWidth(140);
  151.  
  152. ui->pushButton_6->setFixedHeight(60);
  153. ui->pushButton_6->setFixedWidth(140);
  154.  
  155. ui->pushButton_7->setFixedHeight(60);
  156. ui->pushButton_7->setFixedWidth(140);
  157.  
  158. ui->pushButton_8->setFixedHeight(60);
  159. ui->pushButton_8->setFixedWidth(140);
  160.  
  161. ui->pushButton_9->setFixedHeight(60);
  162. ui->pushButton_9->setFixedWidth(140);
  163.  
  164. ui->pushButton_10->setFixedHeight(60);
  165. ui->pushButton_10->setFixedWidth(140);
  166.  
  167. ui->pushButton_11->setFixedHeight(60);
  168. ui->pushButton_11->setFixedWidth(140);
  169.  
  170. ui->pushButton_12->setFixedHeight(60);
  171. ui->pushButton_12->setFixedWidth(140);
  172.  
  173. ui->pushButton_13->setFixedHeight(60);
  174. ui->pushButton_13->setFixedWidth(140);
  175.  
  176. ui->pushButton_14->setFixedHeight(60);
  177. ui->pushButton_14->setFixedWidth(140);
  178.  
  179. ui->pushButton_15->setFixedHeight(60);
  180. ui->pushButton_15->setFixedWidth(140);
  181.  
  182. ui->pushButton_16->setFixedHeight(60);
  183. ui->pushButton_16->setFixedWidth(140);
  184.  
  185. ui->pushButton_17->setFixedHeight(60);
  186. ui->pushButton_17->setFixedWidth(140);
  187.  
  188. ui->pushButton_18->setFixedHeight(60);
  189. ui->pushButton_18->setFixedWidth(140);
  190. }
  191. else if(flag_2==false){
  192.  
  193. ui->pushButton->setFixedHeight(30);
  194. ui->pushButton->setFixedWidth(70);
  195.  
  196. ui->pushButton_2->setFixedHeight(30);
  197. ui->pushButton_2->setFixedWidth(70);
  198.  
  199. ui->pushButton_3->setFixedHeight(30);
  200. ui->pushButton_3->setFixedWidth(70);
  201.  
  202. ui->pushButton_4->setFixedHeight(30);
  203. ui->pushButton_4->setFixedWidth(70);
  204.  
  205. ui->pushButton_5->setFixedHeight(30);
  206. ui->pushButton_5->setFixedWidth(70);
  207.  
  208. ui->pushButton_6->setFixedHeight(30);
  209. ui->pushButton_6->setFixedWidth(70);
  210.  
  211. ui->pushButton_7->setFixedHeight(30);
  212. ui->pushButton_7->setFixedWidth(70);
  213.  
  214. ui->pushButton_8->setFixedHeight(30);
  215. ui->pushButton_8->setFixedWidth(70);
  216.  
  217. ui->pushButton_9->setFixedHeight(30);
  218. ui->pushButton_9->setFixedWidth(70);
  219.  
  220. ui->pushButton_10->setFixedHeight(30);
  221. ui->pushButton_10->setFixedWidth(70);
  222.  
  223. ui->pushButton_11->setFixedHeight(30);
  224. ui->pushButton_11->setFixedWidth(70);
  225.  
  226. ui->pushButton_12->setFixedHeight(30);
  227. ui->pushButton_12->setFixedWidth(70);
  228.  
  229. ui->pushButton_13->setFixedHeight(30);
  230. ui->pushButton_13->setFixedWidth(70);
  231.  
  232. ui->pushButton_14->setFixedHeight(30);
  233. ui->pushButton_14->setFixedWidth(70);
  234.  
  235. ui->pushButton_15->setFixedHeight(30);
  236. ui->pushButton_15->setFixedWidth(70);
  237.  
  238. ui->pushButton_16->setFixedHeight(30);
  239. ui->pushButton_16->setFixedWidth(70);
  240.  
  241. ui->pushButton_17->setFixedHeight(30);
  242. ui->pushButton_17->setFixedWidth(70);
  243.  
  244. ui->pushButton_18->setFixedHeight(30);
  245. ui->pushButton_18->setFixedWidth(70);
  246. }
  247.  
  248.  
  249.  
  250. ui->pushButton_22->setDisabled(true);
  251. ui->label->setVisible(false);
  252. if(flag==true) {
  253. ui->label->setVisible(true);
  254. ui->label->setText(str);
  255. }
  256.  
  257.  
  258. }
  259.  
  260. vrem_hir_1::~vrem_hir_1()
  261. {
  262. delete ui;
  263. }
  264.  
  265.  
  266. bool vrem_hir_1::eventFilter(QObject *o, QEvent *e)
  267. {
  268. if(o == ui->pushButton_2)
  269. {
  270. if(e->type() == QEvent::Enter) {
  271. ui->pushButton_2->setStyleSheet("background-color: pink");
  272. return true;
  273. }
  274. if(e->type() == QEvent::Leave) {
  275. ui->pushButton_2->setStyleSheet("background-color: black");
  276. return true;
  277. }
  278.  
  279. }
  280.  
  281. return vrem_hir_1::eventFilter(o, e);
  282. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement