This patch fixes the following papercut: I regularly write on pdf files in presentation mode, using the styles that comes with my laptop. When I approach the screen with the pen, the cursor appears, and it follows the pen tip during writing. When I lift off the pen, the cursor stays on, and auto-hides only a few seconds later (because of Okular::Settings::EnumSlidesCursor::HiddenDelay). As a consequence, the cursor frequently hides the last bits of what I have just written. This is a nuisance.
With this patch, Okular catches the TabletEnterProximity and TabletLeaveProximity events. The former will make the cursor turn into a cross-hair; the latter will make it disappear directly, unless the cursor mode is 'always visible'.
There is one drawback to this patch. With the cursor mode HiddenDelay, the cursor disappears after a short time, and should reappear at the next mouse move. This does not work if the cursor has been hidden by TabletLeaveProximity, and I don't understand why. The patch therefore currently adds code to mouseMoveEvent that explicitly brings the cursor back. Any help on how to debug this (or an explanation of why it is necessary) is much appreciated.