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. QSerialport and triggering measurements

QSerialport and triggering measurements

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 507 Views
  • 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.
  • E Offline
    E Offline
    Erni42
    wrote on last edited by
    #1

    Hi,
    i have a small problem with my qserialport application. Initialising the measurement device works well, but then...
    click button one to trigger the measurement works, then clickling button two to get the results works too. But if i put these together in one function, the measurement device resets.

    1. button1.click() ==> button_measure_xy(); button2.click() ==> get_result() works as often i click these two buttons

    void MainWindow::last_try()
    {
    button_measure_xy();

    QThread::msleep(500);
    
    get_result();
    

    }
    does not work. Whats different for these two solutions?

    Erni42

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Erni42
      wrote on last edited by
      #2

      Ha,

      I worked it out by replacing the QThread::msleep witha QTimer::singelShot

      void MainWindow::last_try()
      {
          button_measure_xy();
          QTimer::singleShot(ui->spinBox->value(), this, SLOT(get_result()));
      }
      

      Erni42

      1 Reply Last reply
      0

      • Login

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