QRectF UBGraphicsCompass::closeButtonRect() const { QPixmap closePixmap(":/images/closeTool.svg"); QSizeF closeRectSize( closePixmap.width() * mAntiScaleRatio, closePixmap.height() * mAntiScaleRatio); QPointF closeRectTopLeft( sNeedleLength + sNeedleBaseLength + 4, (rect().height() - closeRectSize.height()) / 2); QRectF closeRect(closeRectTopLeft, closeRectSize); closeRect.translate(rect().topLeft()); return closeRect; }
QRectF UBGraphicsRuler::closeButtonRect() const { QPixmap closePixmap(":/images/closeTool.svg"); QSizeF closeRectSize( closePixmap.width() * mAntiScaleRatio, closePixmap.height() * mAntiScaleRatio); QPointF closeRectCenter( rect().left() + sLeftEdgeMargin + sPixelsPerMillimeter * 5, rect().center().y()); QPointF closeRectTopLeft( closeRectCenter.x() - closeRectSize.width() / 2, closeRectCenter.y() - closeRectSize.height() / 2); return QRectF(closeRectTopLeft, closeRectSize); }