##// END OF EJS Templates
Inits threshold mode buttons (auto or manual)...
Inits threshold mode buttons (auto or manual) When mode changes, min/max spinboxes are enabled/disabled

File last commit:

r1044:d3d71155af5e
r1044:d3d71155af5e
Show More
ColorScaleEditor.cpp
34 lines | 1.0 KiB | text/x-c | CppLexer
/ gui / src / Visualization / ColorScaleEditor.cpp
Alexandre Leroux
Inits color scale widget
r1042 #include "Visualization/ColorScaleEditor.h"
#include "ui_ColorScaleEditor.h"
Alexandre Leroux
Inits threshold mode buttons (auto or manual)...
r1044 ColorScaleEditor::ColorScaleEditor(QWidget *parent)
: QDialog{parent}, ui{new Ui::ColorScaleEditor}, m_ThresholdGroup{new QButtonGroup{this}}
Alexandre Leroux
Inits color scale widget
r1042 {
ui->setupUi(this);
Alexandre Leroux
Inits threshold mode buttons (auto or manual)...
r1044 // Creates threshold group
m_ThresholdGroup->addButton(ui->thresholdAutoButton);
m_ThresholdGroup->addButton(ui->thresholdManualButton);
// Inits connections
connect(ui->thresholdAutoButton, SIGNAL(toggled(bool)), this, SLOT(onThresholdChanged(bool)));
connect(ui->thresholdManualButton, SIGNAL(toggled(bool)), this, SLOT(onThresholdChanged(bool)));
// First update
onThresholdChanged(true);
Alexandre Leroux
Inits color scale widget
r1042 }
ColorScaleEditor::~ColorScaleEditor() noexcept
{
delete ui;
}
Alexandre Leroux
Inits threshold mode buttons (auto or manual)...
r1044 void ColorScaleEditor::onThresholdChanged(bool checked)
{
if (checked) {
auto isAutomatic = ui->thresholdAutoButton == m_ThresholdGroup->checkedButton();
ui->minSpinBox->setEnabled(!isAutomatic);
ui->maxSpinBox->setEnabled(!isAutomatic);
}
}