Advertisement
Guest User

Untitled

a guest
May 25th, 2020
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. void MainWindow::on_pushButton_4_clicked()
  2. {
  3. char ch_msg[4] = {'0', '0', '0', '0'};
  4. std::string o_msg;
  5. for(int i=0; i<16; i++) {
  6. o_msg = "";
  7. if(i == 0)
  8. for(int j=0;j<4; j++) o_msg += ch_msg[j];
  9. else {
  10. for(int j=3; j>=0; j--) {
  11. if(ch_msg[j] == '0') {
  12. ch_msg[j] = '1';
  13. break;
  14. }
  15. else ch_msg[j] = '0';
  16. }
  17. for(int j=0;j<4; j++) o_msg += ch_msg[j];
  18. }
  19. QString str = QString::fromUtf8(o_msg.c_str());
  20. ui->lineEdit->setText(str);
  21. MainWindow::on_pushButton_clicked();
  22. sleep( 1 );
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement