From 2ce2e5a8a3b9a1139d1d41f777dfbb65f56b3a67 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Sat, 14 Nov 2020 13:42:43 -0500 Subject: [PATCH] Fixed wheel event scroll direction for custom QWidgets --- src/drivers/Qt/ConsoleDebugger.cpp | 4 ++-- src/drivers/Qt/HexEditor.cpp | 4 ++-- src/drivers/Qt/RamSearch.cpp | 4 ++-- src/drivers/Qt/TraceLogger.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index 48629dff..93141c9a 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -3411,7 +3411,7 @@ void QAsmView::wheelEvent(QWheelEvent *event) if (!numPixels.isNull()) { - wheelPixelCounter += numPixels.y(); + wheelPixelCounter -= numPixels.y(); //printf("numPixels: (%i,%i) \n", numPixels.x(), numPixels.y() ); } else if (!numDegrees.isNull()) @@ -3419,7 +3419,7 @@ void QAsmView::wheelEvent(QWheelEvent *event) //QPoint numSteps = numDegrees / 15; //printf("numSteps: (%i,%i) \n", numSteps.x(), numSteps.y() ); //printf("numDegrees: (%i,%i) %i\n", numDegrees.x(), numDegrees.y(), pxLineSpacing ); - wheelPixelCounter += (pxLineSpacing * numDegrees.y()) / (15*8); + wheelPixelCounter -= (pxLineSpacing * numDegrees.y()) / (15*8); } //printf("Wheel Event: %i\n", wheelPixelCounter); diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index 2e6eb740..914b23ae 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -1787,7 +1787,7 @@ void QHexEdit::wheelEvent(QWheelEvent *event) if (!numPixels.isNull()) { - wheelPixelCounter += numPixels.y(); + wheelPixelCounter -= numPixels.y(); //printf("numPixels: (%i,%i) \n", numPixels.x(), numPixels.y() ); } else if (!numDegrees.isNull()) @@ -1795,7 +1795,7 @@ void QHexEdit::wheelEvent(QWheelEvent *event) //QPoint numSteps = numDegrees / 15; //printf("numSteps: (%i,%i) \n", numSteps.x(), numSteps.y() ); //printf("numDegrees: (%i,%i) %i\n", numDegrees.x(), numDegrees.y(), pxLineSpacing ); - wheelPixelCounter += (pxLineSpacing * numDegrees.y()) / (15*8); + wheelPixelCounter -= (pxLineSpacing * numDegrees.y()) / (15*8); } //printf("Wheel Event: %i\n", wheelPixelCounter); diff --git a/src/drivers/Qt/RamSearch.cpp b/src/drivers/Qt/RamSearch.cpp index 815cd252..664eae49 100644 --- a/src/drivers/Qt/RamSearch.cpp +++ b/src/drivers/Qt/RamSearch.cpp @@ -1673,7 +1673,7 @@ void QRamSearchView::wheelEvent(QWheelEvent *event) if (!numPixels.isNull()) { - wheelPixelCounter += numPixels.y(); + wheelPixelCounter -= numPixels.y(); //printf("numPixels: (%i,%i) \n", numPixels.x(), numPixels.y() ); } else if (!numDegrees.isNull()) @@ -1681,7 +1681,7 @@ void QRamSearchView::wheelEvent(QWheelEvent *event) //QPoint numSteps = numDegrees / 15; //printf("numSteps: (%i,%i) \n", numSteps.x(), numSteps.y() ); //printf("numDegrees: (%i,%i) %i\n", numDegrees.x(), numDegrees.y(), pxLineSpacing ); - wheelPixelCounter += (pxLineSpacing * numDegrees.y()) / (15*8); + wheelPixelCounter -= (pxLineSpacing * numDegrees.y()) / (15*8); } //printf("Wheel Event: %i\n", wheelPixelCounter); diff --git a/src/drivers/Qt/TraceLogger.cpp b/src/drivers/Qt/TraceLogger.cpp index 3017327b..f96b88bd 100644 --- a/src/drivers/Qt/TraceLogger.cpp +++ b/src/drivers/Qt/TraceLogger.cpp @@ -1137,7 +1137,7 @@ void QTraceLogView::wheelEvent(QWheelEvent *event) if (!numPixels.isNull()) { - wheelPixelCounter += numPixels.y(); + wheelPixelCounter -= numPixels.y(); //printf("numPixels: (%i,%i) \n", numPixels.x(), numPixels.y() ); } else if (!numDegrees.isNull()) @@ -1145,7 +1145,7 @@ void QTraceLogView::wheelEvent(QWheelEvent *event) //QPoint numSteps = numDegrees / 15; //printf("numSteps: (%i,%i) \n", numSteps.x(), numSteps.y() ); //printf("numDegrees: (%i,%i) %i\n", numDegrees.x(), numDegrees.y(), pxLineSpacing ); - wheelPixelCounter += (pxLineSpacing * numDegrees.y()) / (15*8); + wheelPixelCounter -= (pxLineSpacing * numDegrees.y()) / (15*8); } //printf("Wheel Event: %i\n", wheelPixelCounter);