[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.
This commit is contained in:
Yann Lanthony 2024-12-06 10:12:11 +01:00
parent dfe2166942
commit 6d2e9a2ba9
5 changed files with 106 additions and 1 deletions

View file

@ -0,0 +1,8 @@
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)