Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::on_pushButton_4_clicked()
- {
- char ch_msg[4] = {'0', '0', '0', '0'};
- std::string o_msg;
- for(int i=0; i<16; i++) {
- o_msg = "";
- if(i == 0)
- for(int j=0;j<4; j++) o_msg += ch_msg[j];
- else {
- for(int j=3; j>=0; j--) {
- if(ch_msg[j] == '0') {
- ch_msg[j] = '1';
- break;
- }
- else ch_msg[j] = '0';
- }
- for(int j=0;j<4; j++) o_msg += ch_msg[j];
- }
- QString str = QString::fromUtf8(o_msg.c_str());
- ui->lineEdit->setText(str);
- MainWindow::on_pushButton_clicked();
- sleep( 1 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement