From: Vivien Delmon Date: Wed, 28 Dec 2011 13:27:46 +0000 (+0100) Subject: BUG Don't try to change the VF color on cancel. X-Git-Tag: v1.3.0~125 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=390aea3ee689bd8a605e07fe5a8fde85bd4124f5;p=clitk.git BUG Don't try to change the VF color on cancel. - Test the validity of the color returned by the QColorDialog before changing the VF color. --- diff --git a/vv/vvOverlayPanel.cxx b/vv/vvOverlayPanel.cxx index 68356bf..28d8939 100644 --- a/vv/vvOverlayPanel.cxx +++ b/vv/vvOverlayPanel.cxx @@ -250,7 +250,8 @@ void vvOverlayPanel::VFColorChangeRequest() QColor color(vfColorButton->palette().color(QPalette::Background)); color = QColorDialog::getColor(color, this, "Choose the new color of the vector field"); //vfColorButton->palette().setColor(QPalette::Background, color); SR: Not working? - vfColorButton->setStyleSheet("* { background-color: " + color.name() + "; border: 0px }"); + if (color.isValid()) + vfColorButton->setStyleSheet("* { background-color: " + color.name() + "; border: 0px }"); this->setVFProperty(); }