How to rotate(such as rectangle) an object by its center? I find the QPainter::rotate function is rotating an object by the point(0,0), not its center. So who can tell me how to do it? I use the QPainter::translate function before using the QPainter::rotate function,find it also work incorrect. Can you give me a simple sample to do it? thanks.