Meshroom/meshroom/ui/components/geom2D.py
Yann Lanthony 6d2e9a2ba9 [ui] Utils: add SelectionBox and DelegateSelectionBox
- SelectionBox: generic Selection box component.
- DelegateSelectionBox: specialized SelectionBox to select model delegates
  from an instantiator (Repeater, ListView).

Also Introduce a Geom2D helper class to provide missing features for
intersection testing in QML.
2024-12-06 10:12:11 +01:00

8 lines
272 B
Python

from PySide6.QtCore import QObject, Slot, QRectF
class Geom2D(QObject):
@Slot(QRectF, QRectF, result=bool)
def rectRectIntersect(self, rect1: QRectF, rect2: QRectF) -> bool:
"""Check if two rectangles intersect."""
return rect1.intersects(rect2)