From 0bd7dda85b4264235e98e29ec4f8d8f497358f8d Mon Sep 17 00:00:00 2001 From: Csaba Pinter Date: Tue, 17 Oct 2023 12:14:35 +0100 Subject: [PATCH] ENH: Displaying "Calculating collisions..." to indicate processing Re #218 --- .../Resources/UI/qSlicerRoomsEyeViewModule.ui | 2 +- RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui b/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui index 23c710fe..0740e02c 100644 --- a/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui +++ b/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui @@ -379,7 +379,7 @@ 4 - + No collisions detected. diff --git a/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx b/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx index 2adf28ba..88297c40 100644 --- a/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx +++ b/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx @@ -1020,17 +1020,21 @@ void qSlicerRoomsEyeViewModuleWidget::checkForCollisions() return; } + d->CollisionDetectionStatusLabel->setText(QString::fromStdString("Calculating collisions...")); + d->CollisionDetectionStatusLabel->setStyleSheet("color: black"); + QApplication::processEvents(); + std::string collisionString = d->logic()->CheckForCollisions(paramNode); if (collisionString.length() > 0) { - d->CollisionsDetected->setText(QString::fromStdString(collisionString)); - d->CollisionsDetected->setStyleSheet("color: red"); + d->CollisionDetectionStatusLabel->setText(QString::fromStdString(collisionString)); + d->CollisionDetectionStatusLabel->setStyleSheet("color: red"); } else { - d->CollisionsDetected->setText(QString::fromStdString("No collisions detected")); - d->CollisionsDetected->setStyleSheet("color: green"); + d->CollisionDetectionStatusLabel->setText(QString::fromStdString("No collisions detected")); + d->CollisionDetectionStatusLabel->setStyleSheet("color: green"); } }