개정판 498cd3ed
issue #1362: add a function to place callout text box - revised
Change-Id: I7ef35272e515700b4edaa306052c74aea3e24c08
HYTOS/HYTOS/OptionsDialog.py | ||
---|---|---|
59 | 59 |
def callout_text_color(self): |
60 | 60 |
return self._callout_text_color if self._callout_text_color else '#000000' |
61 | 61 |
|
62 |
""" |
|
63 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
|
64 |
|
|
65 |
return self.isAccepted, self.ui.comboBox_TagFontSize.currentData(), self.ui.pushButton_TagFontColor.palette().color( |
|
66 |
QPalette.Background).name() |
|
67 |
""" |
|
68 |
|
|
69 | 62 |
def initWorkSpace(self): |
70 | 63 |
self.ui.lineEdit_WorkSpace.setText(os.getcwd()) |
71 | 64 |
|
... | ... | |
100 | 93 |
configs = app_doc_data.getAppConfigs('option', 'TagFontSize') |
101 | 94 |
if configs and len(configs) == 1: |
102 | 95 |
self._tag_font_size = configs[0].value |
103 |
index = self.ui.comboBox_TagFontSize.findText(configs[0].value, QtCore.Qt.MatchExactly)
|
|
96 |
index = self.ui.comboBox_TagFontSize.findText(self._tag_font_size, QtCore.Qt.MatchExactly)
|
|
104 | 97 |
if index > -1: |
105 | 98 |
self.ui.comboBox_TagFontSize.setCurrentIndex(index) |
106 | 99 |
|
107 |
configs = app_doc_data.getAppConfigs('option', 'CallFontSize') |
|
100 |
configs = app_doc_data.getAppConfigs('option', 'CalloutFontSize')
|
|
108 | 101 |
if configs and len(configs) == 1: |
109 | 102 |
self._callout_font_size = configs[0].value |
110 |
index = self.ui.comboBoxCalloutFontSize.findText(configs[0].value, QtCore.Qt.MatchExactly)
|
|
103 |
index = self.ui.comboBoxCalloutFontSize.findText(self._callout_font_size, QtCore.Qt.MatchExactly)
|
|
111 | 104 |
if index > -1: |
112 | 105 |
self.ui.comboBoxCalloutFontSize.setCurrentIndex(index) |
113 | 106 |
|
... | ... | |
116 | 109 |
self._tag_text_color = configs[0].value |
117 | 110 |
self.ui.pushButton_TagFontColor.setStyleSheet('background-color:{}'.format(configs[0].value)) |
118 | 111 |
|
119 |
configs = app_doc_data.getAppConfigs('option', 'CallTextColor') |
|
112 |
configs = app_doc_data.getAppConfigs('option', 'CalloutTextColor')
|
|
120 | 113 |
if configs and len(configs) == 1: |
121 | 114 |
self._callout_text_color = configs[0].value |
122 | 115 |
self.ui.pushButtonCalloutTextColor.setStyleSheet('background-color:{}'.format(configs[0].value)) |
HYTOS/HYTOS/Shapes/EngineeringCalloutTextItem.py | ||
---|---|---|
108 | 108 |
def hoverMoveEvent(self, event): |
109 | 109 |
pass |
110 | 110 |
|
111 |
def keyPressEvent(self, event): |
|
112 |
try: |
|
113 |
if event.key() == Qt.Key_Escape: |
|
114 |
self.lost_focus.emit(self) |
|
115 |
self.clearFocus() |
|
116 |
|
|
117 |
super(QEngineeringCalloutTextItem, self).keyPressEvent(event) |
|
118 |
except Exception as ex: |
|
119 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
120 |
sys.exc_info()[-1].tb_lineno) |
|
121 |
self.addMessage.emit(MessageType.Error, message) |
|
122 |
|
|
111 | 123 |
def itemChange(self, change, value): |
112 | 124 |
if change == QGraphicsItem.ItemSelectedChange: |
113 | 125 |
self.selected_change.emit(self) |
내보내기 Unified diff