33 return toMeasure.width();
35 return toMeasure.height();
47 QRect bounds(toExtrude);
51 bounds.setWidth(size);
55 bounds.setHeight(size);
60 bounds.moveLeft(toExtrude.x() + toExtrude.width() - bounds.width());
64 bounds.moveTop(toExtrude.y() + toExtrude.height() - bounds.height());
77 rect.setWidth(-rect.width());
78 rect.setX(-rect.width());
81 if (rect.height() < 0)
83 rect.setHeight(-rect.height());
84 rect.setY(-rect.height());
96 for (
auto side : sides)
102 if (distance < closestDistance)
104 closestDistance = distance;
113 const QPoint& testPoint,
int edgeOfInterest)
116 return testPoint.y() - rectangle.y();
118 return rectangle.y() + rectangle.height() - testPoint.y();
120 return testPoint.x() - rectangle.x();
122 return rectangle.x() + rectangle.width() - testPoint.x();
138 return directionConstant;
142 const QRect& toConvert)
144 return QRect(coordinateSystem->mapFromGlobal(toConvert.topLeft()),
145 coordinateSystem->mapFromGlobal(toConvert.bottomRight()));
150 return coordinateSystem->mapFromGlobal(toConvert);
154 const QRect& toConvert)
156 return QRect(coordinateSystem->mapToGlobal(toConvert.topLeft()),
157 coordinateSystem->mapToGlobal(toConvert.bottomRight()));
162 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)