개정판 a5836a89
code arrange
Change-Id: Ie03b892343a117b12409f50d3c3336b251bc71a5
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
689 | 689 |
@author humkyung |
690 | 690 |
@date 2018.04.08 |
691 | 691 |
''' |
692 |
|
|
693 | 692 |
def rect(self): |
694 | 693 |
return self.sceneBoundingRect() |
695 | 694 |
|
... | ... | |
709 | 708 |
@author humkyung |
710 | 709 |
@date 2018.07.03 |
711 | 710 |
''' |
712 |
|
|
713 | 711 |
def is_connected(self, item, at=QEngineeringAbstractItem.CONNECTED_AT_PT): |
714 | 712 |
""" check if given item is connected to self """ |
715 | 713 |
|
... | ... | |
749 | 747 |
@history humkyung 2018.05.08 check if symbol is possible to be connected |
750 | 748 |
Jeongwoo 2018.05.15 Connect each symbol and line |
751 | 749 |
''' |
752 |
|
|
753 | 750 |
def connect_if_possible(self, obj, toler=10): |
754 | 751 |
""" this method not update item's position """ |
755 | 752 |
|
... | ... | |
810 | 807 |
@author kyouho |
811 | 808 |
@date 2018.08.30 |
812 | 809 |
''' |
813 |
|
|
814 | 810 |
def disconnectedItemAtConnector(self, connector): |
815 | 811 |
for conn in self.connectors: |
816 | 812 |
if conn.isOverlapConnector(connector): |
... | ... | |
821 | 817 |
@author humkyung |
822 | 818 |
@dat |
823 | 819 |
''' |
824 |
|
|
825 | 820 |
def getConnectionPointCloseTo(self, pt, toler=10): |
826 | 821 |
import math |
827 | 822 |
|
... | ... | |
839 | 834 |
@author humkyung |
840 | 835 |
@date 2018.04.08 |
841 | 836 |
''' |
842 |
|
|
843 | 837 |
def center(self): |
844 | 838 |
return self.sceneBoundingRect().center() |
845 | 839 |
|
... | ... | |
848 | 842 |
@authro humkyung |
849 | 843 |
@date 2018.05.02 |
850 | 844 |
''' |
851 |
|
|
852 | 845 |
def hoverEnterEvent(self, event, minimum=False): |
853 | 846 |
self.highlight(True, minimum) |
854 | 847 |
|
... | ... | |
886 | 879 |
@author kyouho |
887 | 880 |
@date 2018.08.27 |
888 | 881 |
''' |
889 |
|
|
890 | 882 |
def setHightlight(self): |
891 | 883 |
self.setColor('url(#hover)') |
892 | 884 |
self.update() |
... | ... | |
896 | 888 |
@author kyouho |
897 | 889 |
@date 2018.08.27 |
898 | 890 |
''' |
899 |
|
|
900 | 891 |
def unsetHightlight(self): |
901 | 892 |
self.setColor('url(#normal)') |
902 | 893 |
self.update() |
... | ... | |
906 | 897 |
@author humkyung |
907 | 898 |
@date 2018.04.28 |
908 | 899 |
''' |
909 |
|
|
910 | 900 |
def hoverMoveEvent(self, event): |
911 | 901 |
pass |
912 | 902 |
|
... | ... | |
916 | 906 |
@date 18.04.11 |
917 | 907 |
@history kyouho 2018.07.18 add isClick logic |
918 | 908 |
''' |
919 |
|
|
920 | 909 |
def mousePressEvent(self, event): |
921 | 910 |
if event.buttons() == Qt.LeftButton: |
922 | 911 |
self.clicked.emit(self) |
... | ... | |
956 | 945 |
if modifiers == Qt.ShiftModifier: |
957 | 946 |
step = math.radians(30) |
958 | 947 |
quotient = int(self._angle / step) |
959 |
angle = quotient*step
|
|
960 |
self._angle = angle if (self._angle - angle) < step*0.5 else (quotient + 1)*step
|
|
948 |
angle = quotient * step
|
|
949 |
self._angle = angle if (self._angle - angle) < step * 0.5 else (quotient + 1) * step
|
|
961 | 950 |
|
962 | 951 |
self.rotate(self._angle) |
963 | 952 |
|
... | ... | |
980 | 969 |
@author kyouho |
981 | 970 |
@date 18.07.17 |
982 | 971 |
''' |
983 |
|
|
984 | 972 |
def findTextItemInPoint(self, point): |
985 | 973 |
from EngineeringTextItem import QEngineeringTextItem |
986 | 974 |
|
내보내기 Unified diff