UI: Replace SIGNAL and SLOT macros in custom widgets

This commit is contained in:
gxalpha
2023-07-21 13:16:04 +02:00
parent fc07e59754
commit ac170a2d83
7 changed files with 14 additions and 31 deletions
+4 -9
View File
@@ -388,8 +388,8 @@ VolControl::VolControl(OBSSource source_, bool showConfig, bool vertical)
"audio_monitoring", OBSMixersOrMonitoringChanged,
this);
QWidget::connect(slider, SIGNAL(valueChanged(int)), this,
SLOT(SliderChanged(int)));
QWidget::connect(slider, &VolumeSlider::valueChanged, this,
&VolControl::SliderChanged);
QWidget::connect(mute, &MuteCheckBox::clicked, this,
&VolControl::SetMuted);
@@ -1163,11 +1163,6 @@ void VolumeMeter::paintVTicks(QPainter &painter, int x, int y, int height)
#define CLIP_FLASH_DURATION_MS 1000
void VolumeMeter::ClipEnding()
{
clipping = false;
}
inline int VolumeMeter::convertToInt(float number)
{
constexpr int min = std::numeric_limits<int>::min();
@@ -1264,7 +1259,7 @@ void VolumeMeter::paintHMeter(QPainter &painter, int x, int y, int width,
} else if (int(magnitude) != 0) {
if (!clipping) {
QTimer::singleShot(CLIP_FLASH_DURATION_MS, this,
SLOT(ClipEnding()));
[&]() { clipping = false; });
clipping = true;
}
@@ -1376,7 +1371,7 @@ void VolumeMeter::paintVMeter(QPainter &painter, int x, int y, int width,
} else {
if (!clipping) {
QTimer::singleShot(CLIP_FLASH_DURATION_MS, this,
SLOT(ClipEnding()));
[&]() { clipping = false; });
clipping = true;
}