Skip to content

Replace QWheelEvent-related deprecated methods with recommended ones

Apart for simple naming replacements, this patch also has non-trivial refactoring change. Recent Qt only provides two-dimensional angleDelta() function instead of one-dimensional delta(), which forces us to change the approach of how to handle wheel motion orientations.

This patch could change the behavior. I assumed, that in most places we only care about vertical scroll, so it is reasonable to replace delta() with angleDelta().y(), but in some places horizontal scroll (i.e. using mouse with side scroll wheel) may also make sense. So, for example, horizontal scroll on blending mode combo box now would not work, but I am not sure whether this was an intentional design decision or that was just because implementation was simpler by checking only the delta without paying attention to the scroll direction.

Test Plan

Krita's widgets, that rely on the scroll wheel, should work as intended. (e.g. Blending mode combo box)

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports