/
githubmirror
/
obs-studio
Обзор
Документация
Войти
/
githubmirror
/
obs-studio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/properties-view/double-slider.cpp
29 строк
662 B
gxalpha
frontend,shared: Replace and disable contextless connect calls
18 дек 2025, 00:35
18 дек 2025, 00:35
5129612
Код
Авторство
О чём код?
#include "moc_double-slider.cpp" #include <cmath> DoubleSlider::DoubleSlider(QWidget *parent) : SliderIgnoreScroll(parent) { connect(this, &DoubleSlider::valueChanged, this, [this](int val) { emit doubleValChanged((minVal / minStep + val) * minStep); }); } void DoubleSlider::setDoubleConstraints(double newMin, double newMax, double newStep, double val) { minVal = newMin; maxVal = newMax; minStep = newStep; double total = maxVal - minVal; int intMax = int(total / minStep); setMinimum(0); setMaximum(intMax); setSingleStep(1); setDoubleVal(val); } void DoubleSlider::setDoubleVal(double val) { setValue(lround((val - minVal) / minStep)); }