Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How run code in the backround without stack in a loop?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 126 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex_Spi13
    wrote on 3 Mar 2021, 19:01 last edited by
    #1

    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

    qt33.png

    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 );
            ui->right_ultrasonic_lcd->display(ultrasonic_msg.z);
            ros_f->ultrasonic_subscriber();
    }
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Mar 2021, 19:07 last edited by
      #2

      Hi,

      You can use a QTimer for that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4

      2/2

      3 Mar 2021, 19:07

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved