C++ (Qt)void MainWindow::onPrintButtonClick(){ setEnabled(false); QEventLoop loop; connect (communicator, &DeviceCommunicator::commandSent, [&loop] (int index, const QByteArray &answer) {loop.quit();}); communicator.sendCommand(....); loop.exec(); setEnabled(true);}
C++ (Qt) QQueue<std::tuple<int, QByteArray, int>> commandsQueue_;