Instead of mTextLeftOffset and mTextTopOffset can't you use text alignment options while painting?
Qt Code:
  1. o.setAlignment(Qt::AlignHCenter| Qt::AlignVCenter);
  2. painter->drawText(textRect, text, o);
To copy to clipboard, switch view to plain text mode