diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 484ed9cb05..2a1e5c58b9 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -458,8 +458,8 @@ bool QWindowsTabletSupport::translateTabletPacketEvent() // Z = sin(altitude) // X Tilt = arctan(X / Z) // Y Tilt = arctan(Y / Z) - const double radAzim = (packet.pkOrientation.orAzimuth / 10) * (M_PI / 180); - const double tanAlt = tan((abs(packet.pkOrientation.orAltitude / 10)) * (M_PI / 180)); + const double radAzim = (packet.pkOrientation.orAzimuth / 10.0) * (M_PI / 180); + const double tanAlt = tan((abs(packet.pkOrientation.orAltitude / 10.0)) * (M_PI / 180)); const double degX = atan(sin(radAzim) / tanAlt); const double degY = atan(cos(radAzim) / tanAlt); diff --git a/src/widgets/kernel/qstandardgestures.cpp b/src/widgets/kernel/qstandardgestures.cpp index 64ab68257a..e57c3285d2 100644 --- a/src/widgets/kernel/qstandardgestures.cpp +++ b/src/widgets/kernel/qstandardgestures.cpp @@ -331,7 +331,7 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state, int elapsedTime = d->time.restart(); if (!elapsedTime) elapsedTime = 1; - d->velocityValue = 0.9 * d->velocityValue + distance / elapsedTime; + d->velocityValue = 0.9 * d->velocityValue + (qreal) distance / elapsedTime; d->swipeAngle = QLineF(p1.startScreenPos(), p1.screenPos()).angle(); static const int MoveThreshold = 50;