Advertisement
popov-aa

Untitled

Oct 31st, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. MksManager mksManager;
  2.  
  3. QEventLoop eventLoop;
  4. QObject::connect(&mksManager, &MksManager::connectionFinished,
  5.                  &eventLoop, &QEventLoop::quit);
  6. mksManager.connectToDevice();
  7. eventLoop.exec();
  8.  
  9. if (mksManager.status() != 1) {
  10.     mksManager.connectToDevice();
  11.     eventLoop.exec();
  12. }
  13.  
  14. if (mksManager.status() != 1)
  15.     throw std::runtime_error(tr("Error of connecting to device.").toStdString());
  16.  
  17. int code = 0;
  18. QByteArray checkpointsByteArray = mksManager.getCheckpoints(code);
  19. if (code != 0)
  20.     throw std::runtime_error(tr("Error of reading checkpoints.xml from device.").toStdString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement