개정판 1c52cea0
issue #506: fix text edit
Change-Id: Id99c4e4750244fcac5719b0295015a2376450bcd
DTI_PID/DTI_PID/CodeTables.py | ||
---|---|---|
17 | 17 |
def __init__(self, name, values): |
18 | 18 |
self.name = name |
19 | 19 |
if self.name != "NOMINALDIAMETER": |
20 |
self.values = [(x[0], x[1], x[2], x[3].replace(' ', '').split(',')) for x in values]
|
|
20 |
self.values = [(x[0], x[1], x[2], sorted(x[3].replace(' ', '').split(','), key=lambda param:len(param), reverse=True)) for x in values]
|
|
21 | 21 |
else: |
22 | 22 |
self.values = values |
23 | 23 |
|
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
352 | 352 |
"""edit text by using ocr dialog""" |
353 | 353 |
from TextItemFactory import TextItemFactory |
354 | 354 |
from OcrResultDialog import QOcrResultDialog |
355 |
from App import App |
|
355 | 356 |
|
356 | 357 |
item = None |
357 | 358 |
try: |
... | ... | |
366 | 367 |
item = QEngineeringTextItem.create_text_with(self.scene(), text_info) |
367 | 368 |
if item: |
368 | 369 |
item.area = self.area |
369 |
item.transfer.onRemoved.connect(self.transfer.onRemoved)
|
|
370 |
item.transfer.onRemoved.connect(App.mainWnd().itemRemoved)
|
|
370 | 371 |
|
371 | 372 |
self.transfer.onRemoved.emit(self) |
372 | 373 |
except Exception as ex: |
DTI_PID/DTI_PID/tesseract_ocr_module.py | ||
---|---|---|
210 | 210 |
# up to here |
211 | 211 |
if minSize <= rect.height() <= maxSize: # TODO: 이 부분이 필요한가? |
212 | 212 |
text_rect = QRect(rect.left(), imgHeight - rect.bottom(), rect.width(), rect.height()) |
213 |
if text_rect.width() < 5 or text_rect.height() < 5: |
|
214 |
continue |
|
213 | 215 |
if angle == 90 or angle == 270: |
214 | 216 |
transform = QTransform() |
215 | 217 |
transform.translate(imgHeight * 0.5, imgWidth * 0.5) |
내보내기 Unified diff