From 57bfcf10ac731b9577e6ec42b3d7913f3e9ef168 Mon Sep 17 00:00:00 2001 From: Warchamp7 Date: Fri, 28 Aug 2026 18:15:35 +0200 Subject: [PATCH] frontend: Minor Spinbox cleanup Fixes some minor codestyle problems. --- shared/qt/obs-spinbox/DoubleSpinBox.cpp | 4 ++-- shared/qt/obs-spinbox/SpinBox.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shared/qt/obs-spinbox/DoubleSpinBox.cpp b/shared/qt/obs-spinbox/DoubleSpinBox.cpp index cd7f00f03..46bf536b8 100644 --- a/shared/qt/obs-spinbox/DoubleSpinBox.cpp +++ b/shared/qt/obs-spinbox/DoubleSpinBox.cpp @@ -122,7 +122,7 @@ void DoubleSpinBox::mousePressEvent(QMouseEvent *event) // Mouse button was pressed and is not over the spinbox buttons, forward event to the lineEdit. QRect lineEditRect = lineEdit()->geometry(); - mouseDragYOffset = ((double)height() / 2) - event->position().y(); + mouseDragYOffset = (static_cast(height()) / 2) - event->position().y(); if (!lineEditRect.contains(event->pos())) { QPointF localPos = event->pos() - lineEditRect.topLeft(); @@ -205,7 +205,7 @@ void DoubleSpinBox::wheelEvent(QWheelEvent *event) void DoubleSpinBox::clampCursorPosition() { - QSignalBlocker block(lineEdit()); + QSignalBlocker block{lineEdit()}; if (suffix().isEmpty() && prefix().isEmpty()) { return; diff --git a/shared/qt/obs-spinbox/SpinBox.cpp b/shared/qt/obs-spinbox/SpinBox.cpp index 7861e3660..b3e607d50 100644 --- a/shared/qt/obs-spinbox/SpinBox.cpp +++ b/shared/qt/obs-spinbox/SpinBox.cpp @@ -121,7 +121,7 @@ void SpinBox::mousePressEvent(QMouseEvent *event) // Mouse button was pressed and is not over the spinbox buttons, forward event to the lineEdit. QRect lineEditRect = lineEdit()->geometry(); - mouseDragYOffset = ((double)height() / 2) - event->position().y(); + mouseDragYOffset = (static_cast(height()) / 2) - event->position().y(); if (!lineEditRect.contains(event->pos())) { QPointF localPos = event->pos() - lineEditRect.topLeft(); @@ -129,6 +129,7 @@ void SpinBox::mousePressEvent(QMouseEvent *event) event->buttons(), event->modifiers()); QCoreApplication::sendEvent(lineEdit(), &forwardEvent); + event->accept(); return; } @@ -203,7 +204,7 @@ void SpinBox::wheelEvent(QWheelEvent *event) void SpinBox::clampCursorPosition() { - QSignalBlocker block(lineEdit()); + QSignalBlocker block{lineEdit()}; if (suffix().isEmpty() && prefix().isEmpty()) { return;