【发布时间】:2017-01-10 07:32:20
【问题描述】:
【问题讨论】:
-
欢迎来到 Stack Overflow!为了给您一个很好的答案,如果您还没有看过How to Ask,它可能会对我们有所帮助。如果您可以提供minimal reproducible example,它可能也很有用。
【问题讨论】:
从您的边界框创建一个较小的矩形。
QRect adjusted(int dx1, int dy1, int dx2, int dy2) const
QRect smallerbox = boundingRect().adjusted(boundingRect.topLeft().x() +1, boundingRect.topLeft().y() +1, boundingRect.bottomRight().x() -1, boundingRect.bottomRight().y() -1);
【讨论】: