From: David Sarrut Date: Fri, 3 Feb 2012 06:57:12 +0000 (+0100) Subject: Correct bug when the user cancel the color selection X-Git-Tag: v1.4.0~297 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f20bada9ca6aace48799090e1d5bf91ef6326603;p=clitk.git Correct bug when the user cancel the color selection --- diff --git a/vv/vvToolROIManager.cxx b/vv/vvToolROIManager.cxx index 645941c..e1d2e5c 100644 --- a/vv/vvToolROIManager.cxx +++ b/vv/vvToolROIManager.cxx @@ -677,6 +677,8 @@ void vvToolROIManager::ChangeColor() { mCurrentROIActor->GetROI()->GetDisplayColor()[1], mCurrentROIActor->GetROI()->GetDisplayColor()[2]); QColor c = QColorDialog::getColor(color, this, "Choose the ROI color"); + if (!c.isValid()) return;// User cancel + mCurrentROIActor->GetROI()->SetDisplayColor(c.redF(), c.greenF(), c.blueF()); mCurrentROIActor->UpdateColor();