프로젝트

일반

사용자정보

개정판 6fa02c93

ID6fa02c93de6630240f5a9c9621aa846811d2ff25
상위 969b7533
하위 35ecb7c8

함의성이(가) 약 6년 전에 추가함

issue #655: add split delete merge

차이점 보기:

DTI_PID/DTI_PID/TrainingEditorDialog.py
111 111
        self.ui.pushButtonChange.clicked.connect(self.pushButtonChangeClicked)
112 112
        self.ui.pushButtonDelete.clicked.connect(self.pushButtonDeleteClicked)
113 113
        self.ui.pushButtonAdd.clicked.connect(self.pushButtonAddClicked)
114
        self.ui.pushButtonSplit.clicked.connect(self.pushButtonSplitClicked)
114 115
        self.ui.spinBoxLeft.valueChanged.connect(self.spinBoxChangedEvent)
115 116
        self.ui.spinBoxTop.valueChanged.connect(self.spinBoxChangedEvent)
116 117
        self.ui.spinBoxWidth.valueChanged.connect(self.spinBoxChangedEvent)
117 118
        self.ui.spinBoxHeight.valueChanged.connect(self.spinBoxChangedEvent)
118 119

  
119 120
    '''
121
        @brief      split boxitem by button click
122
        @author     euisung
123
        @date       2018.10.31
124
    '''
125
    def pushButtonSplitClicked(self):
126
        self.isChanged = True
127
        items = self.graphicsViewTrainingDrawing.scene.selectedItems()
128
        if len(items) is not 1:
129
            return
130
        rect = items[0].rect()
131
        secondBox = QTrainingBoxItem('', rect.x() + round(rect.width() / 2), rect.y(), round(rect.width() / 2), rect.height())
132
        secondBox.transfer.onRemoved.connect(self.itemRemoved)
133
        secondBox.addTextItemToScene(self.ui, self.graphicsViewTrainingDrawing, self.graphicsViewZoomDrawing, self.spinBoxFlag)
134
        items[0].setRect(rect.x(), rect.y(), round(rect.width() / 2), rect.height())
135

  
136
    '''
120 137
        @brief      add boxitem by button click
121 138
        @author     euisung
122 139
        @date       2018.10.17
DTI_PID/DTI_PID/TrainingEditor_UI.py
49 49
        self.pushButtonDelete.setAutoDefault(False)
50 50
        self.pushButtonDelete.setObjectName("pushButtonDelete")
51 51
        self.horizontalLayout.addWidget(self.pushButtonDelete)
52
        self.pushButtonMerge = QtWidgets.QPushButton(TrainingEditorDialog)
52
        self.pushButtonSplit = QtWidgets.QPushButton(TrainingEditorDialog)
53 53
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
54 54
        sizePolicy.setHorizontalStretch(0)
55 55
        sizePolicy.setVerticalStretch(0)
56
        sizePolicy.setHeightForWidth(self.pushButtonMerge.sizePolicy().hasHeightForWidth())
57
        self.pushButtonMerge.setSizePolicy(sizePolicy)
58
        self.pushButtonMerge.setMinimumSize(QtCore.QSize(64, 64))
59
        self.pushButtonMerge.setMaximumSize(QtCore.QSize(64, 64))
60
        self.pushButtonMerge.setAutoDefault(False)
61
        self.pushButtonMerge.setObjectName("pushButtonMerge")
62
        self.horizontalLayout.addWidget(self.pushButtonMerge)
63
        self.pushButtonSplite = QtWidgets.QPushButton(TrainingEditorDialog)
64
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
65
        sizePolicy.setHorizontalStretch(0)
66
        sizePolicy.setVerticalStretch(0)
67
        sizePolicy.setHeightForWidth(self.pushButtonSplite.sizePolicy().hasHeightForWidth())
68
        self.pushButtonSplite.setSizePolicy(sizePolicy)
69
        self.pushButtonSplite.setMinimumSize(QtCore.QSize(64, 64))
70
        self.pushButtonSplite.setMaximumSize(QtCore.QSize(64, 64))
71
        self.pushButtonSplite.setAutoDefault(False)
72
        self.pushButtonSplite.setObjectName("pushButtonSplite")
73
        self.horizontalLayout.addWidget(self.pushButtonSplite)
56
        sizePolicy.setHeightForWidth(self.pushButtonSplit.sizePolicy().hasHeightForWidth())
57
        self.pushButtonSplit.setSizePolicy(sizePolicy)
58
        self.pushButtonSplit.setMinimumSize(QtCore.QSize(64, 64))
59
        self.pushButtonSplit.setMaximumSize(QtCore.QSize(64, 64))
60
        self.pushButtonSplit.setAutoDefault(False)
61
        self.pushButtonSplit.setObjectName("pushButtonSplit")
62
        self.horizontalLayout.addWidget(self.pushButtonSplit)
74 63
        self.horizontalLayout_2.addLayout(self.horizontalLayout)
75 64
        spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
76 65
        self.horizontalLayout_2.addItem(spacerItem)
......
201 190
    def retranslateUi(self, TrainingEditorDialog):
202 191
        _translate = QtCore.QCoreApplication.translate
203 192
        TrainingEditorDialog.setWindowTitle(_translate("TrainingEditorDialog", "Training Editor"))
204
        self.pushButtonZoom.setText(_translate("TrainingEditorDialog", "Zoom"))
193
        self.pushButtonZoom.setText(_translate("TrainingEditorDialog", "확대"))
205 194
        self.pushButtonAdd.setText(_translate("TrainingEditorDialog", "추가"))
206 195
        self.pushButtonDelete.setText(_translate("TrainingEditorDialog", "삭제"))
207
        self.pushButtonMerge.setText(_translate("TrainingEditorDialog", "병합"))
208
        self.pushButtonSplite.setText(_translate("TrainingEditorDialog", "분할"))
196
        self.pushButtonSplit.setText(_translate("TrainingEditorDialog", "분할"))
209 197
        self.label_3.setText(_translate("TrainingEditorDialog", "Left"))
210 198
        self.label_6.setText(_translate("TrainingEditorDialog", "Top"))
211 199
        self.label_5.setText(_translate("TrainingEditorDialog", "Width"))
DTI_PID/DTI_PID/UI/TrainingEditor.ui
35 35
            </size>
36 36
           </property>
37 37
           <property name="text">
38
            <string>Zoom</string>
38
            <string>확대</string>
39 39
           </property>
40 40
           <property name="checkable">
41 41
            <bool>true</bool>
......
102 102
          </widget>
103 103
         </item>
104 104
         <item>
105
          <widget class="QPushButton" name="pushButtonMerge">
106
           <property name="sizePolicy">
107
            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
108
             <horstretch>0</horstretch>
109
             <verstretch>0</verstretch>
110
            </sizepolicy>
111
           </property>
112
           <property name="minimumSize">
113
            <size>
114
             <width>64</width>
115
             <height>64</height>
116
            </size>
117
           </property>
118
           <property name="maximumSize">
119
            <size>
120
             <width>64</width>
121
             <height>64</height>
122
            </size>
123
           </property>
124
           <property name="text">
125
            <string>병합</string>
126
           </property>
127
           <property name="autoDefault">
128
            <bool>false</bool>
129
           </property>
130
          </widget>
131
         </item>
132
         <item>
133
          <widget class="QPushButton" name="pushButtonSplite">
105
          <widget class="QPushButton" name="pushButtonSplit">
134 106
           <property name="sizePolicy">
135 107
            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
136 108
             <horstretch>0</horstretch>

내보내기 Unified diff

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