프로젝트

일반

사용자정보

개정판 6929ebfb

ID6929ebfb4be3e40a6982bc7b1b3ae314d652f1fd
상위 4efdc42f
하위 8fd45efa

gaqhf 이(가) 6년 이상 전에 추가함

dev issue #643: edit TextItemEdit form

차이점 보기:

DTI_PID/DTI_PID/MainWindow.py
166 166
        self.resultPropertyTableWidget.cellClicked.connect(self.cellClickedEvent)
167 167
        self.actionSave.triggered.connect(self.actionSaveCliked)
168 168
        self.addMessage.connect(self.onAddMessage)
169
        self.actionFindText.triggered.connect(self.findTextClicked)
170
        self.actionReplaceText.triggered.connect(self.replaceTextClicked)
169 171

  
170 172
        # removedItems
171 173
        self.removedItems = {}
......
177 179

  
178 180
    '''
179 181
        @brief      show unknownitem's count
182
        @author     kyouho
183
        @date       2018.08.27
184
    '''
185
    def findTextClicked(self):
186
        print('click')
187
        pass
188

  
189
    '''
190
        @brief      show unknownitem's count
191
        @author     findTextClicked
192
        @date       2018.08.27
193
    '''
194
    def replaceTextClicked(self):
195
        print('click2')
196
        pass
197

  
198
    '''
199
        @brief      show unknownitem's count
180 200
        @author     humkyung
181 201
        @date       2018.08.23
182 202
    '''
DTI_PID/DTI_PID/MainWindow_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

  
3
# Form implementation generated from reading ui file '.\ui\MainWindow.ui'
3
# Form implementation generated from reading ui file './UI/MainWindow.ui'
4 4
#
5
# Created by: PyQt5 UI code generator 5.10.1
5
# Created by: PyQt5 UI code generator 5.9.2
6 6
#
7 7
# WARNING! All changes made in this file will be lost!
8 8

  
......
37 37
        self.menu_3.setObjectName("menu_3")
38 38
        self.menu_4 = QtWidgets.QMenu(self.menubar)
39 39
        self.menu_4.setObjectName("menu_4")
40
        self.menu_5 = QtWidgets.QMenu(self.menubar)
41
        self.menu_5.setObjectName("menu_5")
40 42
        MainWindow.setMenuBar(self.menubar)
41 43
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
42 44
        self.statusbar.setObjectName("statusbar")
......
322 324
        icon12.addPixmap(QtGui.QPixmap(":/newPrefix/Rotate_Minus.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
323 325
        self.actionRotate.setIcon(icon12)
324 326
        self.actionRotate.setObjectName("actionRotate")
327
        self.actionFindText = QtWidgets.QAction(MainWindow)
328
        self.actionFindText.setObjectName("actionFindText")
329
        self.actionReplaceText = QtWidgets.QAction(MainWindow)
330
        self.actionReplaceText.setObjectName("actionReplaceText")
325 331
        self.menu.addAction(self.actionOpen)
326 332
        self.menu.addAction(self.actionArea)
327 333
        self.menu.addAction(self.actionConfiguration)
......
338 344
        self.menu_3.addSeparator()
339 345
        self.menu_3.addAction(self.actionViewUnknown)
340 346
        self.menu_4.addAction(self.actionpdf_to_image)
347
        self.menu_5.addAction(self.actionFindText)
348
        self.menu_5.addAction(self.actionReplaceText)
341 349
        self.menubar.addAction(self.menu.menuAction())
350
        self.menubar.addAction(self.menu_5.menuAction())
342 351
        self.menubar.addAction(self.menu_2.menuAction())
343 352
        self.menubar.addAction(self.menu_3.menuAction())
344 353
        self.menubar.addAction(self.menu_4.menuAction())
......
369 378
        self.menu_2.setTitle(_translate("MainWindow", "데이타"))
370 379
        self.menu_3.setTitle(_translate("MainWindow", "보기"))
371 380
        self.menu_4.setTitle(_translate("MainWindow", "툴"))
381
        self.menu_5.setTitle(_translate("MainWindow", "편집"))
372 382
        self.toolBar.setWindowTitle(_translate("MainWindow", "Main Toolbar"))
373 383
        self.dockWidget.setWindowTitle(_translate("MainWindow", "심볼 탐색기"))
374 384
        self.pushButtonCreateSymbol.setText(_translate("MainWindow", "생성"))
......
417 427
        self.actionRotate.setText(_translate("MainWindow", "회전"))
418 428
        self.actionRotate.setToolTip(_translate("MainWindow", "회전(Ctrl + R)"))
419 429
        self.actionRotate.setShortcut(_translate("MainWindow", "Ctrl+R"))
430
        self.actionFindText.setText(_translate("MainWindow", "텍스트 찾기"))
431
        self.actionReplaceText.setText(_translate("MainWindow", "텍스트 변경"))
420 432

  
421 433
import MainWindow_rc
422 434

  
DTI_PID/DTI_PID/SelectAttributeDialog.py
1
# coding: utf-8
2
import os
3
import sys
4
from PyQt5.QtCore import *
5
from PyQt5.QtGui import *
6
from PyQt5.QtWidgets import *
7
import sqlite3
8
from AppDocData import AppDocData
9
from AppDocData import Config
10
import SelectAttribute_UI
11

  
12
class QSelectAttributeDialog(QDialog):
13
    def __init__(self, parent, symbolType):
14
        QDialog.__init__(self, parent)
15

  
16
        self.attrList = []
17
        self.removeUID = {}
18
        self.currentCode = {}
19

  
20
        self.ui = SelectAttribute_UI.Ui_SelectAttributeDialog()
21
        self.ui.setupUi(self)
22

  
23
        self.dialogResult = False
24
        self.selectedAttribute = ''
25

  
26
        self.settingComboBoxAttribute(symbolType)
27

  
28
        
29

  
30
    '''
31
        @brief  setting comboboxAttribute
32
        @author kyouho
33
        @date   2018.07.18
34
    '''
35
    def settingComboBoxAttribute(self, symbolType):
36
        docData = AppDocData.instance()
37
        symbolAttrs = docData.getSymbolAttribute(symbolType)
38
        for attr in symbolAttrs:
39
            self.attrList.append((attr[0], attr[1], attr[2]))
40
            self.ui.comboBoxAttribute.addItem(attr[2])
41

  
42
    '''
43
        @brief  accept
44
        @author kyouho
45
        @date   2018.07.18
46
    '''
47
    def accept(self):
48
        self.dialogResult = True
49
        index = self.ui.comboBoxAttribute.currentIndex()
50
        self.selectedAttribute = self.attrList[index][0]
51
        QDialog.accept(self)
DTI_PID/DTI_PID/SelectAttribute_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file './UI/SelectAttribute.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.9.2
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10

  
11
class Ui_SelectAttributeDialog(object):
12
    def setupUi(self, SelectAttributeDialog):
13
        SelectAttributeDialog.setObjectName("SelectAttributeDialog")
14
        SelectAttributeDialog.resize(277, 67)
15
        self.gridLayout = QtWidgets.QGridLayout(SelectAttributeDialog)
16
        self.gridLayout.setObjectName("gridLayout")
17
        self.buttonBox = QtWidgets.QDialogButtonBox(SelectAttributeDialog)
18
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
19
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
20
        self.buttonBox.setObjectName("buttonBox")
21
        self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
22
        self.comboBoxAttribute = QtWidgets.QComboBox(SelectAttributeDialog)
23
        self.comboBoxAttribute.setObjectName("comboBoxAttribute")
24
        self.gridLayout.addWidget(self.comboBoxAttribute, 0, 1, 1, 1)
25
        self.label = QtWidgets.QLabel(SelectAttributeDialog)
26
        self.label.setObjectName("label")
27
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
28

  
29
        self.retranslateUi(SelectAttributeDialog)
30
        self.buttonBox.accepted.connect(SelectAttributeDialog.accept)
31
        self.buttonBox.rejected.connect(SelectAttributeDialog.reject)
32
        QtCore.QMetaObject.connectSlotsByName(SelectAttributeDialog)
33

  
34
    def retranslateUi(self, SelectAttributeDialog):
35
        _translate = QtCore.QCoreApplication.translate
36
        SelectAttributeDialog.setWindowTitle(_translate("SelectAttributeDialog", "Dialog"))
37
        self.label.setText(_translate("SelectAttributeDialog", "Attribute"))
38

  
39

  
40
if __name__ == "__main__":
41
    import sys
42
    app = QtWidgets.QApplication(sys.argv)
43
    SelectAttributeDialog = QtWidgets.QDialog()
44
    ui = Ui_SelectAttributeDialog()
45
    ui.setupUi(SelectAttributeDialog)
46
    SelectAttributeDialog.show()
47
    sys.exit(app.exec_())
48

  
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
14 14
from EngineeringConnectorItem import QEngineeringConnectorItem
15 15
from QEngineeringAbstractItem import QEngineeringAbstractItem
16 16
from UserInputAttribute import UserInputAttribute
17
import SelectAttributeDialog
18 17
import SelectAttributeCommand
19 18

  
20 19
class SymbolSvgItem(QGraphicsSvgItem, QEngineeringAbstractItem):
DTI_PID/DTI_PID/SymbolTreeWidget.py
94 94
            App.mainWnd().addMessage.emit(MessageType.Error, message)
95 95

  
96 96
    def displaySymbolActionClickEvent(self, itemType, itemName):
97
        project = AppDocData.instance().getCurrentProject()
97
        project = Ap^pDocData.instance().getCurrentProject()
98 98
        image = QImage(os.path.join(project.getImageFilePath(), itemType, itemName, "PNG")) #itemName includes ".png"
99 99
        dialog = QSymbolDisplayDialog.QSymbolDisplayDialog(image)
100 100
        dialog.showDialog()
DTI_PID/DTI_PID/TextItemEditDialog.py
1
# coding: utf-8
2
import os
3
import sys
4
from PyQt5.QtCore import *
5
from PyQt5.QtGui import *
6
from PyQt5.QtWidgets import *
7
import sqlite3
8
from AppDocData import AppDocData
9
from AppDocData import Config
10
import SelectAttribute_UI
11

  
12
class QSelectAttributeDialog(QDialog):
13
    def __init__(self, parent, symbolType):
14
        QDialog.__init__(self, parent)
15

  
16
        self.attrList = []
17
        self.removeUID = {}
18
        self.currentCode = {}
19

  
20
        self.ui = SelectAttribute_UI.Ui_SelectAttributeDialog()
21
        self.ui.setupUi(self)
22

  
23
        self.dialogResult = False
24
        self.selectedAttribute = ''
25

  
26
        self.settingComboBoxAttribute(symbolType)
27

  
28
        
29

  
30
    '''
31
        @brief  setting comboboxAttribute
32
        @author kyouho
33
        @date   2018.07.18
34
    '''
35
    def settingComboBoxAttribute(self, symbolType):
36
        docData = AppDocData.instance()
37
        symbolAttrs = docData.getSymbolAttribute(symbolType)
38
        for attr in symbolAttrs:
39
            self.attrList.append((attr[0], attr[1], attr[2]))
40
            self.ui.comboBoxAttribute.addItem(attr[2])
41

  
42
    '''
43
        @brief  accept
44
        @author kyouho
45
        @date   2018.07.18
46
    '''
47
    def accept(self):
48
        self.dialogResult = True
49
        index = self.ui.comboBoxAttribute.currentIndex()
50
        self.selectedAttribute = self.attrList[index][0]
51
        QDialog.accept(self)
DTI_PID/DTI_PID/TextItemEdit_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file './UI/TextItemEdit.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.9.2
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10

  
11
class Ui_TextItemEditDialog(object):
12
    def setupUi(self, TextItemEditDialog):
13
        TextItemEditDialog.setObjectName("TextItemEditDialog")
14
        TextItemEditDialog.resize(277, 67)
15
        self.gridLayout = QtWidgets.QGridLayout(TextItemEditDialog)
16
        self.gridLayout.setObjectName("gridLayout")
17
        self.buttonBox = QtWidgets.QDialogButtonBox(TextItemEditDialog)
18
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
19
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
20
        self.buttonBox.setObjectName("buttonBox")
21
        self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
22
        self.comboBoxAttribute = QtWidgets.QComboBox(TextItemEditDialog)
23
        self.comboBoxAttribute.setObjectName("comboBoxAttribute")
24
        self.gridLayout.addWidget(self.comboBoxAttribute, 0, 1, 1, 1)
25
        self.label = QtWidgets.QLabel(TextItemEditDialog)
26
        self.label.setObjectName("label")
27
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
28

  
29
        self.retranslateUi(TextItemEditDialog)
30
        self.buttonBox.accepted.connect(TextItemEditDialog.accept)
31
        self.buttonBox.rejected.connect(TextItemEditDialog.reject)
32
        QtCore.QMetaObject.connectSlotsByName(TextItemEditDialog)
33

  
34
    def retranslateUi(self, TextItemEditDialog):
35
        _translate = QtCore.QCoreApplication.translate
36
        TextItemEditDialog.setWindowTitle(_translate("TextItemEditDialog", "Dialog"))
37
        self.label.setText(_translate("TextItemEditDialog", "Attribute"))
38

  
39

  
40
if __name__ == "__main__":
41
    import sys
42
    app = QtWidgets.QApplication(sys.argv)
43
    TextItemEditDialog = QtWidgets.QDialog()
44
    ui = Ui_TextItemEditDialog()
45
    ui.setupUi(TextItemEditDialog)
46
    TextItemEditDialog.show()
47
    sys.exit(app.exec_())
48

  
DTI_PID/DTI_PID/UI/MainWindow.ui
76 76
    </property>
77 77
    <addaction name="actionpdf_to_image"/>
78 78
   </widget>
79
   <widget class="QMenu" name="menu_5">
80
    <property name="title">
81
     <string>편집</string>
82
    </property>
83
    <addaction name="actionFindText"/>
84
    <addaction name="actionReplaceText"/>
85
   </widget>
79 86
   <addaction name="menu"/>
87
   <addaction name="menu_5"/>
80 88
   <addaction name="menu_2"/>
81 89
   <addaction name="menu_3"/>
82 90
   <addaction name="menu_4"/>
......
671 679
    <string>Ctrl+R</string>
672 680
   </property>
673 681
  </action>
682
  <action name="actionFindText">
683
   <property name="text">
684
    <string>텍스트 찾기</string>
685
   </property>
686
  </action>
687
  <action name="actionReplaceText">
688
   <property name="text">
689
    <string>텍스트 변경</string>
690
   </property>
691
  </action>
674 692
 </widget>
675 693
 <resources>
676 694
  <include location="../res/MainWindow.qrc"/>
DTI_PID/DTI_PID/UI/SelectAttribute.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>SelectAttributeDialog</class>
4
 <widget class="QDialog" name="SelectAttributeDialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>277</width>
10
    <height>67</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Dialog</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout">
17
   <item row="1" column="1">
18
    <widget class="QDialogButtonBox" name="buttonBox">
19
     <property name="orientation">
20
      <enum>Qt::Horizontal</enum>
21
     </property>
22
     <property name="standardButtons">
23
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
24
     </property>
25
    </widget>
26
   </item>
27
   <item row="0" column="1">
28
    <widget class="QComboBox" name="comboBoxAttribute"/>
29
   </item>
30
   <item row="0" column="0">
31
    <widget class="QLabel" name="label">
32
     <property name="text">
33
      <string>Attribute</string>
34
     </property>
35
    </widget>
36
   </item>
37
  </layout>
38
 </widget>
39
 <resources/>
40
 <connections>
41
  <connection>
42
   <sender>buttonBox</sender>
43
   <signal>accepted()</signal>
44
   <receiver>SelectAttributeDialog</receiver>
45
   <slot>accept()</slot>
46
   <hints>
47
    <hint type="sourcelabel">
48
     <x>248</x>
49
     <y>254</y>
50
    </hint>
51
    <hint type="destinationlabel">
52
     <x>157</x>
53
     <y>274</y>
54
    </hint>
55
   </hints>
56
  </connection>
57
  <connection>
58
   <sender>buttonBox</sender>
59
   <signal>rejected()</signal>
60
   <receiver>SelectAttributeDialog</receiver>
61
   <slot>reject()</slot>
62
   <hints>
63
    <hint type="sourcelabel">
64
     <x>316</x>
65
     <y>260</y>
66
    </hint>
67
    <hint type="destinationlabel">
68
     <x>286</x>
69
     <y>274</y>
70
    </hint>
71
   </hints>
72
  </connection>
73
 </connections>
74
</ui>
DTI_PID/DTI_PID/UI/TextItemEdit.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>TextItemEditDialog</class>
4
 <widget class="QDialog" name="TextItemEditDialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>277</width>
10
    <height>67</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Dialog</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout">
17
   <item row="1" column="1">
18
    <widget class="QDialogButtonBox" name="buttonBox">
19
     <property name="orientation">
20
      <enum>Qt::Horizontal</enum>
21
     </property>
22
     <property name="standardButtons">
23
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
24
     </property>
25
    </widget>
26
   </item>
27
   <item row="0" column="1">
28
    <widget class="QComboBox" name="comboBoxAttribute"/>
29
   </item>
30
   <item row="0" column="0">
31
    <widget class="QLabel" name="label">
32
     <property name="text">
33
      <string>Attribute</string>
34
     </property>
35
    </widget>
36
   </item>
37
  </layout>
38
 </widget>
39
 <resources/>
40
 <connections>
41
  <connection>
42
   <sender>buttonBox</sender>
43
   <signal>accepted()</signal>
44
   <receiver>TextItemEditDialog</receiver>
45
   <slot>accept()</slot>
46
   <hints>
47
    <hint type="sourcelabel">
48
     <x>248</x>
49
     <y>254</y>
50
    </hint>
51
    <hint type="destinationlabel">
52
     <x>157</x>
53
     <y>274</y>
54
    </hint>
55
   </hints>
56
  </connection>
57
  <connection>
58
   <sender>buttonBox</sender>
59
   <signal>rejected()</signal>
60
   <receiver>TextItemEditDialog</receiver>
61
   <slot>reject()</slot>
62
   <hints>
63
    <hint type="sourcelabel">
64
     <x>316</x>
65
     <y>260</y>
66
    </hint>
67
    <hint type="destinationlabel">
68
     <x>286</x>
69
     <y>274</y>
70
    </hint>
71
   </hints>
72
  </connection>
73
 </connections>
74
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)