Fix for QPaintDevice errors in test