better ui, change colors and font
This commit is contained in:
parent
1fccbf64fd
commit
88704cd726
9 changed files with 129 additions and 97 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "slidergroup.h"
|
||||
|
||||
SliderGroup::SliderGroup(int min,
|
||||
SliderGroup::SliderGroup(QString name,
|
||||
int min,
|
||||
int max,
|
||||
int decimals,
|
||||
QWidget *parent)
|
||||
|
@ -8,23 +9,43 @@ SliderGroup::SliderGroup(int min,
|
|||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->setAlignment(Qt::AlignHCenter);
|
||||
this->setMaximumWidth(65);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
//this->setMaximumWidth(40);
|
||||
slider = new QSlider(Qt::Orientation::Vertical);
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
slider->setTickPosition(QSlider::TicksBothSides);
|
||||
slider->setTickInterval((max - min) / 11);
|
||||
slider->setMinimumHeight(100);
|
||||
slider->setSingleStep(1);
|
||||
slider->setRange(min, max);
|
||||
slider->setMaximumWidth(65);
|
||||
//slider->setMaximumWidth(40);
|
||||
slider->setToolTip(name);
|
||||
slider->setStyleSheet("QSlider {"
|
||||
"border: 1px solid #999999;"
|
||||
"margin: 0px;"
|
||||
"height: 200px;"
|
||||
"width: 40px;}"
|
||||
);
|
||||
slider->setContentsMargins(0, 0, 0, 0);
|
||||
valueBox = new QDoubleSpinBox();
|
||||
valueBox->setFocusPolicy(Qt::NoFocus);
|
||||
valueBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
valueBox->setMaximumWidth(65);
|
||||
//valueBox->setMaximumWidth(40);
|
||||
valueBox->setRange(min, max);
|
||||
valueBox->setDecimals(decimals);
|
||||
valueBox->setObjectName(name);
|
||||
valueBox->setToolTip(name);
|
||||
valueBox->setAlignment(Qt::AlignHCenter);
|
||||
valueBox->setContentsMargins(0, 0, 0, 0);
|
||||
connect(slider, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged(int)));
|
||||
layout->addWidget(slider);
|
||||
layout->addWidget(valueBox);
|
||||
this->setStyleSheet("border: 1px solid #999999;"
|
||||
"width: 40px;"
|
||||
"margin: 0px;"
|
||||
);
|
||||
layout->setSpacing(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue