frontend: Minor Spinbox cleanup

Fixes some minor codestyle problems.
This commit is contained in:
Warchamp7
2026-09-03 14:11:24 -04:00
committed by Ryan Foster
parent ecebe28a1e
commit 57bfcf10ac
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -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<double>(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;
+3 -2
View File
@@ -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<double>(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;