You could also change the above lines to:

    QPoint pos(mapObject->position().toPoint());
    QSize size(mapObject->size().toSize()); 

In the future I may want to consider not throwing away the sub-pixel precision...