How run code in the backround without stack in a loop?

  • Hello I'm trying to make a ROS GUI for control my robot. I want to display the measurements that I subscribe from my robot and display to the lcds without press pushbutton, like running in the backround but not stack in a loop because I want rest functionality of the GUI .

    Here is the measurements when I push the button start measurements


    I want to run this code for example, every second .

    void MainWindow::on_start_measurments_pressed()
            ui->left_ultrasonic_lcd->display(ultrasonic_msg.y );
            ui->middle_ultrasonic_lcd->display(ultrasonic_msg.x );

  • Lifetime Qt Champion


    You can use a QTimer for that.

Log in to reply