Use QRectF instead of QRect (avoid some bugs with old versions of Qt)