- Test the validity of the color returned by the QColorDialog before
changing the VF color.
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?
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 }");