29 return toMeasure.width();
31 return toMeasure.height();
43 QRect bounds(toExtrude);
47 bounds.setWidth(size);
51 bounds.setHeight(size);
56 bounds.moveLeft(toExtrude.x() + toExtrude.width() - bounds.width());
60 bounds.moveTop(toExtrude.y() + toExtrude.height() - bounds.height());
73 rect.setWidth(-rect.width());
74 rect.setX(-rect.width());
77 if (rect.height() < 0)
79 rect.setHeight(-rect.height());
80 rect.setY(-rect.height());
92 for (
auto side : sides)
98 if (distance < closestDistance)
100 closestDistance = distance;
109 const QPoint& testPoint,
int edgeOfInterest)
112 return testPoint.y() - rectangle.y();
114 return rectangle.y() + rectangle.height() - testPoint.y();
116 return testPoint.x() - rectangle.x();
118 return rectangle.x() + rectangle.width() - testPoint.x();
134 return directionConstant;
138 const QRect& toConvert)
140 return QRect(coordinateSystem->mapFromGlobal(toConvert.topLeft()),
141 coordinateSystem->mapFromGlobal(toConvert.bottomRight()));
146 return coordinateSystem->mapFromGlobal(toConvert);
150 const QRect& toConvert)
152 return QRect(coordinateSystem->mapToGlobal(toConvert.topLeft()),
153 coordinateSystem->mapToGlobal(toConvert.bottomRight()));
158 return coordinateSystem->mapToGlobal(toConvert);
static int GetDimension(const QRect &toMeasure, bool width)
static int GetDistanceFromEdge(const QRect &rectangle, const QPoint &testPoint, int edgeOfInterest)
static QRect ToDisplay(QWidget *coordinateSystem, const QRect &toConvert)
static QRect ToControl(QWidget *coordinateSystem, const QRect &toConvert)
static int GetClosestSide(const QRect &boundary, const QPoint &toTest)
static QRect GetExtrudedEdge(const QRect &toExtrude, int size, int orientation)
static int GetOppositeSide(int directionConstant)
static void Normalize(QRect &rect)
static bool IsHorizontal(int berrySideConstant)