-----------------------------------------------------------------------------
| 34 | |
| 35 | //----------------------------------------------------------------------------- |
| 36 | DataColorOptions::DataColorOptions( |
| 37 | QString const& settingsGroup, QWidget* parent, Qt::WindowFlags flags) |
| 38 | : QWidget(parent, flags), d_ptr(new DataColorOptionsPrivate) |
| 39 | { |
| 40 | QTE_D(); |
| 41 | |
| 42 | // Set up UI |
| 43 | d->UI.setupUi(this); |
| 44 | |
| 45 | d->uiState.setCurrentGroup(settingsGroup + "/DataColor"); |
| 46 | |
| 47 | d->uiState.mapChecked("AutomaticMinimum", d->UI.autoMinimum); |
| 48 | d->uiState.mapChecked("AutomaticMaximum", d->UI.autoMaximum); |
| 49 | d->uiState.mapValue("Minimum", d->UI.minimum); |
| 50 | d->uiState.mapValue("Maximum", d->UI.maximum); |
| 51 | |
| 52 | auto const gradientItem = new qtUiState::Item<int, QComboBox>( |
| 53 | d->UI.gradient, &QComboBox::currentIndex, &QComboBox::setCurrentIndex); |
| 54 | d->uiState.map("Colors", gradientItem); |
| 55 | |
| 56 | d->uiState.restore(); |
| 57 | |
| 58 | d->scalarsToGradient->SetGradient(d->UI.gradient->currentGradient()); |
| 59 | |
| 60 | connect(d->UI.minimum, QOverload<double>::of(&QDoubleSpinBox::valueChanged), |
| 61 | this, &DataColorOptions::updateMinimum); |
| 62 | connect(d->UI.maximum, QOverload<double>::of(&QDoubleSpinBox::valueChanged), |
| 63 | this, &DataColorOptions::updateMaximum); |
| 64 | connect(d->UI.autoMinimum, &QAbstractButton::toggled, |
| 65 | this, &DataColorOptions::updateMinimum); |
| 66 | connect(d->UI.autoMaximum, &QAbstractButton::toggled, |
| 67 | this, &DataColorOptions::updateMaximum); |
| 68 | |
| 69 | connect(d->UI.gradient, QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 70 | this, &DataColorOptions::setGradient); |
| 71 | } |
| 72 | |
| 73 | //----------------------------------------------------------------------------- |
| 74 | DataColorOptions::~DataColorOptions() |
nothing calls this directly
no test coverage detected