Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. void MainWindow::on_pushButton_clicked()
  2. {
  3.  
  4. srand(time(NULL));
  5.  
  6. int a=rand()%100;
  7. int b=rand()%100;
  8. int d=rand()%200;
  9. int e=rand()%200;
  10.  
  11. int c=(rand()%5);
  12. if (c>=4)
  13. {
  14. ui->pushButton->move(a,b);
  15. ui->pushButton_2->move(d,e);
  16. }
  17. else
  18. {
  19. ui->pushButton_2->move(400,400);
  20. ui->pushButton->move(a,b);
  21. }
  22. }
  23.  
  24. void MainWindow::on_pushButton_2_clicked()
  25. {
  26. ui->label->move(100,100);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement