Function painter:stringrect returns a Qt variant of type qt.QRectF representing the bounding box of the text that would be displayed by calling function painter:show with the same arguments.