Exemplo n.º 1
0
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));
    }
}
Exemplo n.º 2
0
void ColorPropertyWidget::setProperty() {
    if (!disconnected_) {
        colorDialog();
        updateColorLabel();
        tgt::Color value = toTgtColor(currentColor_);
        property_->set(value);
        emit modified();
    }
}
Exemplo n.º 3
0
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_));
}
Exemplo n.º 5
0
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);
}