개정판 31cd836b
find improve
Change-Id: I739b62fcdcfae739c0cbe727440c77647562f8bd
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
725 | 725 |
|
726 | 726 |
from TextItemEditDialog import QTextItemEditDialog |
727 | 727 |
|
728 |
dlgTextItemEdit = QTextItemEditDialog(self) |
|
728 |
items = self.graphicsView.scene().selectedItems() |
|
729 |
item = None |
|
730 |
if len(items) == 1: |
|
731 |
item = items[0] |
|
732 |
|
|
733 |
dlgTextItemEdit = QTextItemEditDialog(self, item) |
|
729 | 734 |
dlgTextItemEdit.show() |
730 | 735 |
dlgTextItemEdit.exec_() |
731 | 736 |
|
DTI_PID/DTI_PID/TextItemEditDialog.py | ||
---|---|---|
16 | 16 |
class QTextItemEditDialog(QDialog): |
17 | 17 |
""" This is text item edit dialog class """ |
18 | 18 |
|
19 |
def __init__(self, parent): |
|
19 |
def __init__(self, parent, item):
|
|
20 | 20 |
QDialog.__init__(self, parent) |
21 | 21 |
|
22 | 22 |
self.mainWindow = parent |
... | ... | |
33 | 33 |
|
34 | 34 |
self.ui.lineEditFindText.setFocus() |
35 | 35 |
|
36 |
if issubclass(type(item), SymbolSvgItem): |
|
37 |
self.ui.lineEditFindText.setText(item.name) |
|
38 |
self.ui.checkBoxSymbol.setCheckState(Qt.Checked) |
|
39 |
elif item == None: |
|
40 |
clipboard = QApplication.clipboard() |
|
41 |
mime_data = clipboard.mimeData() |
|
42 |
if mime_data.hasText(): |
|
43 |
text = mime_data.text() |
|
44 |
try: |
|
45 |
import uuid |
|
46 |
uid = uuid.UUID(text) |
|
47 |
self.ui.lineEditFindText.setText(text) |
|
48 |
self.ui.checkBoxUID.setCheckState(Qt.Checked) |
|
49 |
except: |
|
50 |
pass |
|
51 |
finally: |
|
52 |
pass |
|
53 |
|
|
36 | 54 |
def set_angle_zero(self): |
37 | 55 |
text_items = [item for item in self.mainWindow.graphicsView.scene().items() |
38 | 56 |
if issubclass(type(item), QEngineeringTextItem) and item.owner] |
내보내기 Unified diff