Skip to content
Snippets Groups Projects

Resolve "Simulate SFG in GUI"

Merged Jacob Wahlman requested to merge 88-simulate-sfg-in-gui into develop
Files
2
+ 16
5
@@ -37,6 +37,10 @@ class DragButton(QPushButton):
properties = QAction("Properties")
menu.addAction(properties)
properties.triggered.connect(self.show_properties_window)
delete = QAction("Delete")
menu.addAction(delete)
delete.triggered.connect(self.remove)
menu.exec_(self.cursor().pos())
def show_properties_window(self):
@@ -58,11 +62,12 @@ class DragButton(QPushButton):
if event.buttons() == Qt.LeftButton and self._m_press:
self._m_drag = True
self.move(self.mapToParent(event.pos() - self._mouse_press_pos))
for button in self._window.pressed_operations:
if button is self:
continue
if self in self._window.pressed_operations:
for button in self._window.pressed_operations:
if button is self:
continue
button.move(button.mapToParent(event.pos() - self._mouse_press_pos))
button.move(button.mapToParent(event.pos() - self._mouse_press_pos))
self._window.update()
super(DragButton, self).mouseMoveEvent(event)
@@ -109,4 +114,10 @@ class DragButton(QPushButton):
signal.update()
def remove(self):
self.deleteLater()
\ No newline at end of file
self._window.scene.removeItem(self._window.operationDict[self])
if self in self._window.pressed_operations:
self._window.pressed_operations.remove(self)
if self in self._window.operationDict.keys():
del self._window.operationDict[self]
\ No newline at end of file
Loading