dhaumann added a comment.
Thinking aloud: Can you factor this out into a small helper class called WheelEventFilter or similar? I can imagine this would be cleaner. The code possibly would shrink down to something like: if (m_wheelEventFilter.processEvent(event)) { // ... zoom in / out return; } INLINE COMMENTS > kateviewinternal.cpp:3301 > + bool skip = false; > + qint64 deltaT = m_lastWheelEvent.elapsed(); > + Qt::KeyboardModifiers modState = e->modifiers(); const qint64 ... > kateviewinternal.cpp:3331 > + // ctrl pressed -> change font size (only if angle is reported and not > accidentally so) > + // NB: if the ControlModifier is not unset at this point we'd get > accelerated scrolling. > + if (!skip && modState == Qt::ControlModifier) { Note: instead of NB (had to look it up) REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D5037 To: rjvbb, #ktexteditor Cc: dhaumann, kwrite-devel, #ktexteditor, #frameworks, head7, cullmann, kfunk, sars