Files
tenmon/stretchpanel.cpp
T
2020-05-14 22:42:39 +02:00

28 lines
973 B
C++

#include "stretchpanel.h"
#include <QVBoxLayout>
#include <QComboBox>
StretchPanel::StretchPanel(QWidget *parent) : QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
setLayout(layout);
m_lowSlider = new QSlider(Qt::Horizontal, this);
m_highSlider = new QSlider(Qt::Horizontal, this);
m_lowSlider->setRange(0, UINT16_MAX);
m_highSlider->setRange(0, UINT16_MAX);
m_highSlider->setValue(UINT16_MAX);
QComboBox *stretchSelect = new QComboBox(this);
stretchSelect->addItems({tr("Linear"), tr("Square root"), tr("Power"), tr("Logarithm"), tr("Asinh")});
layout->addWidget(m_lowSlider);
layout->addWidget(m_highSlider);
layout->addWidget(stretchSelect);
connect(m_lowSlider, SIGNAL(valueChanged(int)), this, SIGNAL(lowChanged(int)));
connect(m_highSlider, SIGNAL(valueChanged(int)), this, SIGNAL(highChanged(int)));
connect(stretchSelect, SIGNAL(activated(int)), this, SIGNAL(stretchChanged(int)));
}