개정판 6d2e8832
issue #655: fix editor
Change-Id: Ie49d5128fcabd66fcb004c115b4c3001942d4a86
DTI_PID/DTI_PID/TrainingEditorDialog.py | ||
---|---|---|
7 | 7 |
from AppDocData import * |
8 | 8 |
import TrainingEditor_UI |
9 | 9 |
import QtImageViewer |
10 |
from QtImageViewerScene import QtImageViewerScene |
|
10 | 11 |
from GraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
11 | 12 |
from TrainingBoxItem import QTrainingBoxItem |
12 | 13 |
import cv2 |
13 | 14 |
import numpy as np |
14 | 15 |
from PIL import Image |
15 | 16 |
import AreaZoomCommand |
16 |
import PlaceLineCommand |
|
17 | 17 |
|
18 | 18 |
|
19 | 19 |
class QTrainingEditorDialog(QDialog): |
... | ... | |
36 | 36 |
self.ui.setupUi(self) |
37 | 37 |
|
38 | 38 |
self.graphicsViewTrainingDrawing = QtImageViewer.QtImageViewer(self) |
39 |
self.graphicsViewTrainingDrawing.setScene(QtImageViewerScene(self)) |
|
39 | 40 |
self.graphicsViewTrainingDrawing.setParent(self.ui.centralWidget) |
40 | 41 |
self.graphicsViewTrainingDrawing.useDefaultCommand() |
41 | 42 |
self.ui.verticalLayoutTrainingDrawing.addWidget(self.graphicsViewTrainingDrawing) |
... | ... | |
98 | 99 |
cvImg.shape[0] - int(boxComponent[4]), |
99 | 100 |
int(boxComponent[3]) - int(boxComponent[1]), |
100 | 101 |
int(boxComponent[4]) - int(boxComponent[2])) |
101 |
singleBox.transfer.onRemoved.connect(self.itemRemoved) |
|
102 |
#singleBox.transfer.onRemoved.connect(self.itemRemoved)
|
|
102 | 103 |
singleBox.addTextItemToScene(self.ui, self.graphicsViewTrainingDrawing, self.graphicsViewZoomDrawing, |
103 | 104 |
self.spinBoxFlag) |
104 | 105 |
except Exception as ex: |
... | ... | |
119 | 120 |
self.ui.spinBoxHeight.valueChanged.connect(self.spinBoxChangedEvent) |
120 | 121 |
self.ui.lineEditChar.returnPressed.connect(self.pushButtonChangeClicked) |
121 | 122 |
|
123 |
def showEvent(self, QShowEvent): |
|
124 |
"""show event""" |
|
125 |
self.graphicsViewTrainingDrawing.zoomImageInit() |
|
126 |
|
|
122 | 127 |
''' |
123 | 128 |
@brief split boxitem by button click |
124 | 129 |
@author euisung |
... | ... | |
338 | 343 |
items = self.graphicsViewTrainingDrawing.scene().selectedItems() |
339 | 344 |
if len(items) is not 1 or type(items[0]) is not QTrainingBoxItem: |
340 | 345 |
return |
346 |
|
|
341 | 347 |
selectedItem = items[0] |
342 | 348 |
closestItem = None |
343 | 349 |
x = selectedItem.rect().x() |
내보내기 Unified diff