Merge remote-tracking branch 'gitea/moving_topology' into topo-mov
commit
7b2ff09168
@ -0,0 +1,23 @@
|
||||
from PySide6.QtWidgets import QGraphicsRectItem
|
||||
from PySide6.QtCore import QLineF
|
||||
|
||||
class MyGraphicsRectItem(QGraphicsRectItem):
|
||||
#def __init__(self, *a, **kwa):
|
||||
# return super().__init__(*a, **kwa)
|
||||
#def itemChange(self, change, val):
|
||||
# return super().itemChange(change, val)
|
||||
def mouseMoveEvent(self, evt):
|
||||
print(f'Moving: {self}')
|
||||
line = self.data(0)
|
||||
other_end = line.data(0)
|
||||
if other_end == self:
|
||||
other_end = line.data(1)
|
||||
new_qlinef = QLineF(
|
||||
self.x(),
|
||||
self.y(),
|
||||
other_end.x(),
|
||||
other_end.y(),
|
||||
)
|
||||
line.setLine(new_qlinef)
|
||||
return super().mouseMoveEvent(evt)
|
||||
|
Loading…
Reference in New Issue