]> Creatis software - clitk.git/commitdiff
BUG Don't try to change the VF color on cancel.
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 28 Dec 2011 13:27:46 +0000 (14:27 +0100)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 28 Dec 2011 13:27:46 +0000 (14:27 +0100)
- Test the validity of the color returned by the QColorDialog before
  changing the VF color.

vv/vvOverlayPanel.cxx

index 68356bfd2df1d91d1fc7029d20d5e6afe331d44b..28d893991556a77eed1277aa8e4738989040428b 100644 (file)
@@ -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();
 }