프로젝트

일반

사용자정보

개정판 c138668b

IDc138668b01cebb46b80fef53f8eb114cb065e585
상위 1ede4a48
하위 eb8919fc, b4079a2f

함의성이(가) 4년 이상 전에 추가함

issue #000: symbol editor add expand image, fix cursor, init open

Change-Id: Ia8e34c9894c8126470143d4d6c86bfdd03a96a7a

차이점 보기:

DTI_PID/DTI_PID/MainWindow.py
1922 1922
        finally:
1923 1923
            self.onCommandRejected()
1924 1924
            QApplication.restoreOverrideCursor()
1925
            QApplication.restoreOverrideCursor()
1925 1926

  
1926 1927
    def on_make_label_data(self):
1927 1928
        """ make label data from symbol info """
DTI_PID/DTI_PID/SymbolEditorDialog.py
129 129
                self.ui.textAreaLineEdit.setEnabled(False)
130 130
                self.ui.addTextAreaButton.setEnabled(False)
131 131
                self.ui.delTextAreaButton.setEnabled(False)
132
                self.ui.toolButtonExpand.setEnabled(False)
132 133

  
133 134
            # unused function
134 135
            self.ui.label.setHidden(True)
......
144 145
            self.ui.label_4.setHidden(True)
145 146
            self.ui.checkBoxChange.setHidden(True)
146 147
            self.ui.pushButtonChange.setHidden(True)
148

  
149
            self.zoomInitToolClickEvent(None)
147 150
        except Exception as ex:
148 151
            from App import App
149 152

  
......
359 362
        self.ui.flipVerticalButton.clicked.connect(self.flipVerticalClickEvent)
360 363
        self.ui.pushButtonDelConnPt.clicked.connect(self.onDeleteConnPt)
361 364
        self.ui.pushButtonChange.clicked.connect(self.changeSymbolInfo)
365
        self.ui.toolButtonExpand.clicked.connect(self.expandImage)
362 366

  
363 367
    '''
364 368
        @brief  Init Forms with type and default values
......
940 944
        elif event.key() == Qt.Key_Escape:
941 945
            self.reject()
942 946

  
947

  
948
    def expandImage(self, event):
949
        ''' expand image '''
950
        image = QImage(int(self.image.width() * 1.1), int(self.image.height() * 1.1), self.image.format())
951
        image.fill(Qt.white)
952
        _painter = QPainter(image)
953
        _painter.drawImage(QPoint(int(self.image.width() * 0.05), int(self.image.height() * 0.05)), self.image)
954
        self.image = image
955

  
956
        self.ui.imageView.setImage(image)
957

  
958
        self.initOriginalAndConnectionPoint()
959

  
943 960
    '''
944 961
        @brief  Hand Tool Button Clicked
945 962
    '''
946

  
947 963
    def handToolClickEvent(self, event):
948 964
        self.ui.imageView.command = HandCommand.HandCommand(self.ui.imageView)
949 965

  
......
1203 1219
    def initOriginalAndConnectionPoint(self):
1204 1220
        self.ui.originalPointLineEdit.setText('')
1205 1221
        self.ui.tableWidgetConnList.setRowCount(0)
1222

  
1223
        self.conn_index = 1
1206 1224
        # self.ui.connectionPointList.clear()
1207 1225

  
1208 1226
    '''
DTI_PID/DTI_PID/SymbolEditor_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

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

  
9

  
10 9
from PyQt5 import QtCore, QtGui, QtWidgets
11 10

  
12

  
13 11
class Ui_Dialog(object):
14 12
    def setupUi(self, Dialog):
15 13
        Dialog.setObjectName("Dialog")
......
194 192
        self.removeTextButton.setIconSize(QtCore.QSize(32, 32))
195 193
        self.removeTextButton.setObjectName("removeTextButton")
196 194
        self.gridLayout_5.addWidget(self.removeTextButton, 1, 8, 1, 1, QtCore.Qt.AlignHCenter)
195
        self.toolButtonExpand = QtWidgets.QToolButton(self.toolWidget)
196
        icon15 = QtGui.QIcon()
197
        icon15.addPixmap(QtGui.QPixmap(":/newPrefix/Language.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
198
        self.toolButtonExpand.setIcon(icon15)
199
        self.toolButtonExpand.setIconSize(QtCore.QSize(32, 32))
200
        self.toolButtonExpand.setObjectName("toolButtonExpand")
201
        self.gridLayout_5.addWidget(self.toolButtonExpand, 0, 13, 1, 1)
197 202
        self.horizontalLayout.addLayout(self.gridLayout_5)
198 203
        self.gridLayout_6 = QtWidgets.QGridLayout()
199 204
        self.gridLayout_6.setObjectName("gridLayout_6")
......
289 294
        self.addTextAreaButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
290 295
        self.addTextAreaButton.setMaximumSize(QtCore.QSize(40, 16777215))
291 296
        self.addTextAreaButton.setText("")
292
        icon15 = QtGui.QIcon()
293
        icon15.addPixmap(QtGui.QPixmap(":/newPrefix/Add.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
294
        self.addTextAreaButton.setIcon(icon15)
297
        icon16 = QtGui.QIcon()
298
        icon16.addPixmap(QtGui.QPixmap(":/newPrefix/Add.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
299
        self.addTextAreaButton.setIcon(icon16)
295 300
        self.addTextAreaButton.setObjectName("addTextAreaButton")
296 301
        self.gridLayout_7.addWidget(self.addTextAreaButton, 6, 2, 1, 1)
297 302
        self.textAreaLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
......
300 305
        self.delTextAreaButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
301 306
        self.delTextAreaButton.setMaximumSize(QtCore.QSize(40, 16777215))
302 307
        self.delTextAreaButton.setText("")
303
        icon16 = QtGui.QIcon()
304
        icon16.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
305
        self.delTextAreaButton.setIcon(icon16)
308
        icon17 = QtGui.QIcon()
309
        icon17.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
310
        self.delTextAreaButton.setIcon(icon17)
306 311
        self.delTextAreaButton.setObjectName("delTextAreaButton")
307 312
        self.gridLayout_7.addWidget(self.delTextAreaButton, 6, 3, 1, 1)
308 313
        self.thresholdLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
......
330 335
        self.pushButtonDelConnPt.setMinimumSize(QtCore.QSize(40, 0))
331 336
        self.pushButtonDelConnPt.setMaximumSize(QtCore.QSize(40, 16777215))
332 337
        self.pushButtonDelConnPt.setText("")
333
        self.pushButtonDelConnPt.setIcon(icon16)
338
        self.pushButtonDelConnPt.setIcon(icon17)
334 339
        self.pushButtonDelConnPt.setObjectName("pushButtonDelConnPt")
335 340
        self.gridLayout_7.addWidget(self.pushButtonDelConnPt, 11, 3, 1, 1)
336 341
        self.addConnectionPointButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
337 342
        self.addConnectionPointButton.setMinimumSize(QtCore.QSize(40, 0))
338 343
        self.addConnectionPointButton.setMaximumSize(QtCore.QSize(40, 16777215))
339 344
        self.addConnectionPointButton.setText("")
340
        self.addConnectionPointButton.setIcon(icon15)
345
        self.addConnectionPointButton.setIcon(icon16)
341 346
        self.addConnectionPointButton.setObjectName("addConnectionPointButton")
342 347
        self.gridLayout_7.addWidget(self.addConnectionPointButton, 11, 2, 1, 1)
343 348
        self.addOriginalPointButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
344 349
        self.addOriginalPointButton.setMaximumSize(QtCore.QSize(40, 16777215))
345 350
        self.addOriginalPointButton.setText("")
346
        self.addOriginalPointButton.setIcon(icon15)
351
        self.addOriginalPointButton.setIcon(icon16)
347 352
        self.addOriginalPointButton.setObjectName("addOriginalPointButton")
348 353
        self.gridLayout_7.addWidget(self.addOriginalPointButton, 10, 2, 1, 1)
349 354
        self.connectionPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
......
482 487
        self.addAdditionalSymbolButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
483 488
        self.addAdditionalSymbolButton.setMaximumSize(QtCore.QSize(40, 16777215))
484 489
        self.addAdditionalSymbolButton.setText("")
485
        self.addAdditionalSymbolButton.setIcon(icon15)
490
        self.addAdditionalSymbolButton.setIcon(icon16)
486 491
        self.addAdditionalSymbolButton.setObjectName("addAdditionalSymbolButton")
487 492
        self.horizontalLayout_3.addWidget(self.addAdditionalSymbolButton)
488 493
        self.gridLayout_7.addLayout(self.horizontalLayout_3, 8, 1, 1, 3)
......
538 543
        _translate = QtCore.QCoreApplication.translate
539 544
        Dialog.setWindowTitle(_translate("Dialog", "Symbol Editor"))
540 545
        self.guidelineCheckbox.setText(_translate("Dialog", "Show Guideline"))
546
        self.toolButtonExpand.setText(_translate("Dialog", "..."))
541 547
        self.label.setText(_translate("Dialog", "Normal Color :"))
542 548
        self.label_2.setText(_translate("Dialog", "Highlight Color :"))
543 549
        self.groupBox.setTitle(_translate("Dialog", "Base Symbol"))
......
558 564
        self.minMatchPointLabel.setText(_translate("Dialog", "Min Feature Count"))
559 565
        self.isExceptDetectLabel.setText(_translate("Dialog", "Exclude"))
560 566
        self.label_5.setText(_translate("Dialog", "Text Area"))
567

  
561 568
import MainWindow_rc
569

  
570
if __name__ == "__main__":
571
    import sys
572
    app = QtWidgets.QApplication(sys.argv)
573
    Dialog = QtWidgets.QDialog()
574
    ui = Ui_Dialog()
575
    ui.setupUi(Dialog)
576
    Dialog.show()
577
    sys.exit(app.exec_())
578

  
DTI_PID/DTI_PID/UI/SymbolEditor.ui
389 389
                </property>
390 390
               </widget>
391 391
              </item>
392
              <item row="0" column="13">
393
               <widget class="QToolButton" name="toolButtonExpand">
394
                <property name="text">
395
                 <string>...</string>
396
                </property>
397
                <property name="icon">
398
                 <iconset resource="../res/MainWindow.qrc">
399
                  <normaloff>:/newPrefix/Language.svg</normaloff>:/newPrefix/Language.svg</iconset>
400
                </property>
401
                <property name="iconSize">
402
                 <size>
403
                  <width>32</width>
404
                  <height>32</height>
405
                 </size>
406
                </property>
407
               </widget>
408
              </item>
392 409
             </layout>
393 410
            </item>
394 411
            <item>

내보내기 Unified diff

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