Skip to content

Commit

Permalink
Re #39: Updated subscriber popup to match the publisher.
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraConnolly committed Dec 15, 2022
1 parent 74dd857 commit d8aa6f9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions qSlicerROS2ModuleWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,11 @@ void qSlicerROS2ModuleWidget::subscriberClicked(int row, int col)
std::cerr << "No subscriber by this name in the scene" << std::endl;
return;
}
QString message = sub->GetLastMessageYAML().c_str();
QString numMessages = QVariant(static_cast<int>(sub->GetNumberOfMessages())).toString(); // to convert to an int and then string
QLabel *popupLabel = new QLabel();
QString numMess = "Num messages: ";
QString mess = " Message: ";
popupLabel->setText(numMess + numMessages + mess + message);
popupLabel->show();
QMessageBox msgBox;
msgBox.setText(QStringLiteral("Number of messages: %1\nLast message: %2")
.arg(sub->GetNumberOfMessages())
.arg(sub->GetLastMessageYAML().c_str()));
msgBox.exec();
}
}

Expand Down

0 comments on commit d8aa6f9

Please sign in to comment.