Fix crash when opening a file using a tablet
We tablet press widget might have been already destroyed, so we should wrap it into a QPointer.