개정판 c2a5bd1f
issue #481: add key move
Change-Id: I20976dc53be2339551c39451bb58c4534e159bb8
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
271 | 271 |
# inconsistency table |
272 | 272 |
self.tableWidgetInconsistency.setColumnCount(2) |
273 | 273 |
self.tableWidgetInconsistency.setHorizontalHeaderLabels(['Owner', 'Message']) |
274 |
self.tableWidgetInconsistency.setEditTriggers(QAbstractItemView.NoEditTriggers) |
|
274 | 275 |
self.tableWidgetInconsistency.itemClicked.connect(self.inconsistencyItemClickEvent) |
275 |
#self.tableWidgetInconsistency.keyPressEvent.connect(self.inconsistencyTableKeyPressEvent)
|
|
276 |
self.tableWidgetInconsistency.keyPressEvent = self.inconsistencyTableKeyPressEvent
|
|
276 | 277 |
|
277 | 278 |
def eventFilter(self, source, event): |
278 | 279 |
""" |
... | ... | |
286 | 287 |
|
287 | 288 |
def inconsistencyTableKeyPressEvent(self, event): |
288 | 289 |
try: |
289 |
if event.key() == Qt.Key_Escape: |
|
290 |
pass |
|
291 |
except: |
|
290 |
row = self.tableWidgetInconsistency.selectedIndexes()[0].row() |
|
291 |
col = self.tableWidgetInconsistency.selectedIndexes()[0].column() |
|
292 |
from HighlightCommand import HighlightCommand |
|
293 |
if event.key() == Qt.Key_Up: |
|
294 |
if row is not 0: |
|
295 |
errorItem = self.tableWidgetInconsistency.item(row - 1, 1).tag |
|
296 |
HighlightCommand(self.graphicsView).execute(errorItem) |
|
297 |
elif event.key() == Qt.Key_Down: |
|
298 |
if row is not self.tableWidgetInconsistency.rowCount() - 1: |
|
299 |
errorItem = self.tableWidgetInconsistency.item(row + 1, 1).tag |
|
300 |
HighlightCommand(self.graphicsView).execute(errorItem) |
|
301 |
except Exception as ex: |
|
292 | 302 |
pass |
303 |
finally: |
|
304 |
return QTableView.keyPressEvent(self.tableWidgetInconsistency, event) |
|
293 | 305 |
|
294 | 306 |
def onValidation(self): |
295 | 307 |
""" |
... | ... | |
335 | 347 |
owner = '' |
336 | 348 |
if type(errorItem.parent) is QEngineeringLineItem: |
337 | 349 |
item = QTableWidgetItem('line') |
338 |
item.setFlags(Qt.ItemIsEnabled) |
|
350 |
#item.setFlags(Qt.ItemIsEnabled)
|
|
339 | 351 |
elif issubclass(type(errorItem.parent), SymbolSvgItem): |
340 | 352 |
item = QTableWidgetItem('symbol') |
341 |
item.setFlags(Qt.ItemIsEnabled) |
|
353 |
#item.setFlags(Qt.ItemIsEnabled)
|
|
342 | 354 |
#elif |
343 | 355 |
item.tag = errorItem |
344 | 356 |
items.append(item) |
345 | 357 |
|
346 | 358 |
item = QTableWidgetItem(errorItem.msg) |
347 |
item.setFlags(Qt.ItemIsEnabled) |
|
359 |
#item.setFlags(Qt.ItemIsEnabled)
|
|
348 | 360 |
item.tag = errorItem |
349 | 361 |
items.append(item) |
350 | 362 |
|
내보내기 Unified diff