개정판 150e281d
issue #000: fix item highlight when drag with symbol
Change-Id: I30b72d737da13775adcf931253259a7c32201629
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
493 | 493 |
''' |
494 | 494 |
def dragMoveEvent(self, event): |
495 | 495 |
scenePos = self.mapToScene(event.pos()) |
496 |
items = [item for item in self.scene.items(scenePos) if type(item) is not QGraphicsPixmapItem] |
|
496 |
items = [item for item in self.scene.items(scenePos) if type(item) is not QGraphicsPixmapItem and type(item) is not QGraphicsTextItem]
|
|
497 | 497 |
if len(items) > 0: |
498 | 498 |
if not hasattr(self, '_underItem') or self._underItem is not items[0]: |
499 | 499 |
if hasattr(self, '_underItem') and self._underItem is not None: |
500 |
self._underItem.hoverLeaveEvent(event)
|
|
500 |
self._underItem.highlight(False)
|
|
501 | 501 |
|
502 | 502 |
self._underItem = items[0] |
503 |
self._underItem.hoverEnterEvent(event)
|
|
503 |
self._underItem.highlight(True)
|
|
504 | 504 |
elif hasattr(self, '_underItem') and self._underItem is not None: |
505 | 505 |
self._underItem.hoverLeaveEvent(event) |
506 | 506 |
self._underItem = None |
... | ... | |
576 | 576 |
|
577 | 577 |
matches = [item for item in self.scene.items() if (type(item) is QEngineeringLineItem) and (item.distanceTo((scenePos.x(), scenePos.y())) < 20)] |
578 | 578 |
if len(matches) == 1: |
579 |
matches[0].insertSymbol(svg, scenePos) |
|
579 |
pass |
|
580 |
#matches[0].insertSymbol(svg, scenePos) |
|
580 | 581 |
else: |
581 | 582 |
transform = QTransform() |
582 | 583 |
transform.translate(scenePos.x() - svg.symbolOrigin[0], scenePos.y() - svg.symbolOrigin[1]) |
내보내기 Unified diff