void PlotEntitySettingsDialog::secondColorDialog() { QColor col = QColorDialog::getColor(cclrSecond_->getColor(), this, "Color", QColorDialog::ShowAlphaChannel); if(col.isValid()) { cclrSecond_->setColor(col); if (entitySettings_.getEntity() == PlotEntitySettings::LINE) cclrFourth_->setColor(col); entitySettings_.setSecondColor(toTgtColor(col)); } }
void ColorPropertyWidget::setProperty() { if (!disconnected_) { colorDialog(); updateColorLabel(); tgt::Color value = toTgtColor(currentColor_); property_->set(value); emit modified(); } }
void PlotEntitySettingsDialog::firstColorDialog() { QColor col = QColorDialog::getColor(cclrFirst_->getColor(), this, "Color", QColorDialog::ShowAlphaChannel); if(col.isValid()) { cclrFirst_->setColor(col); //third ccclr only exist in line mode if (entitySettings_.getEntity() == PlotEntitySettings::LINE) cclrThird_->setColor(col); entitySettings_.setFirstColor(toTgtColor(col)); entitySettings_.setUseTextureFlag(false); } }
void PlotEntitySettingsDialog::secondColorDialog() { #if (QT_VERSION >= 0x040500) QColor col = QColorDialog::getColor(secondColor_, this, "Color", QColorDialog::ShowAlphaChannel); if(col.isValid()) secondColor_ = col; #else //if qt is < version 4.5 there is no way to set the alpha value to its correct value secondColor_.setRgba(QColorDialog::getRgba(secondColor_.rgba())); #endif cclrSecond_->setColor(secondColor_); if (entitySettings_.getEntity() == PlotEntitySettings::LINE) cclrFourth_->setColor(secondColor_); entitySettings_.setSecondColor(toTgtColor(secondColor_)); }
void PlotEntitySettingsDialog::cbMainColumnChanged(int index) { int plotDataIndex = cbMainColumn_->itemData(index).toInt(); entitySettings_.setMainColumnIndex(plotDataIndex); if(plotData_ && (plotDataIndex < plotData_->getColumnCount()) && plotData_->hasColumnColorHint(plotDataIndex)) { // we have a color hint for this column QColor col = toQColor(plotData_->getColumnColorHint(plotDataIndex)); cclrFirst_->setColor(col); switch (entitySettings_.getEntity()) { case PlotEntitySettings::LINE: cclrFourth_->setColor(col); case PlotEntitySettings::SURFACE: cclrThird_->setColor(col); break; case PlotEntitySettings::BAR: case PlotEntitySettings::SCATTER: break; } entitySettings_.setFirstColor(toTgtColor(col)); entitySettings_.setSecondColor(toTgtColor(col)); } }
void PlotEntitySettingsDialog::firstColorDialog() { #if (QT_VERSION >= 0x040500) QColor col = QColorDialog::getColor(firstColor_, this, "Color", QColorDialog::ShowAlphaChannel); if(col.isValid()) firstColor_ = col; #else //if qt is < version 4.5 there is no way to set the alpha value to its correct value firstColor_.setRgba(QColorDialog::getRgba(firstColor_.rgba())); #endif cclrFirst_->setColor(firstColor_); //third ccclr only exist in line mode if (entitySettings_.getEntity() == PlotEntitySettings::LINE) cclrThird_->setColor(firstColor_); entitySettings_.setFirstColor(toTgtColor(firstColor_)); entitySettings_.setUseTextureFlag(false); }