Fix segfault in QTouchEvent handler