10enum class WheelDistanceMode
16inline std::optional<WheelDistanceMode> parseWheelDistanceMode(QByteArray value) {
17 value = value.trimmed().toLower();
18 if (value.isEmpty() || value ==
"steps")
return WheelDistanceMode::Steps;
19 if (value ==
"platform")
return WheelDistanceMode::Platform;
28inline WheelInput wheelInput(
const QWheelEvent& event, WheelDistanceMode mode,
int scrollLines) {
30 const bool smooth =
event.phase() == Qt::NoScrollPhase;
31 const QPointF pixels = -QPointF(event.pixelDelta());
32 if (! pixels.isNull() && (! smooth || mode == WheelDistanceMode::Platform))
33 return { pixels, smooth };
34 return { -QPointF(event.angleDelta()) / 120 * (24.0 * scrollLines), smooth };