Ejemplo n.º 1
0
RangeSelector::RangeSelector(const QString& name, ColorCalibrationWidget* parent,
                             int min, int max)
: QGroupBox(name, parent), parent(parent)
{
  QHBoxLayout* layout = new QHBoxLayout(this);
  setLayout(layout);

  slider = new QxtSpanSlider(Qt::Orientation::Horizontal, this);
  slider->setHandleMovementMode(QxtSpanSlider::HandleMovementMode::FreeMovement);
  slider->setMinimum(min);
  slider->setMaximum(max);

  lower = new QLineEdit(QString::number(min), this);
  lower->setFixedWidth(40);
  lower->setValidator(new QIntValidator(min, max, lower));
  upper = new QLineEdit(QString::number(min), this);
  upper->setFixedWidth(40);
  upper->setValidator(new QIntValidator(min, max, upper));

  connect(slider, SIGNAL(lowerValueChanged(int)), this, SLOT(sliderLowerChanged(int)));
  connect(slider, SIGNAL(upperValueChanged(int)), this, SLOT(sliderUpperChanged(int)));
  connect(lower, SIGNAL(textEdited(QString)), this, SLOT(labelLowerChanged(QString)));
  connect(upper, SIGNAL(textEdited(QString)), this, SLOT(labelUpperChanged(QString)));

  connect(slider, SIGNAL(sliderReleased()), parent, SLOT(currentCalibrationChanged()));
  connect(upper, SIGNAL(editingFinished()), parent, SLOT(currentCalibrationChanged()));
  connect(lower, SIGNAL(editingFinished()), parent, SLOT(currentCalibrationChanged()));

  layout->addWidget(lower);
  layout->addWidget(slider);
  layout->addWidget(upper);
  setEnabled(false);
}
Ejemplo n.º 2
0
void ColorCalibrationWidget::expandCurrentColor(const PixelTypes::YUYVPixel& pixel, const bool reduce)
{
  bool changed = false;

  if(changed)
    currentCalibrationChanged();
}
Ejemplo n.º 3
0
void ColorCalibrationWidget::colorAct(int color)
{
  updateWidgets(static_cast<FieldColors::Color>(color + FieldColors::numOfNonColors - 1));
  currentCalibrationChanged();
}