mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
pamhyr: Catch some table data type exception (crash Fix).
This commit is contained in:
1 parent
e8ae1c0631
commit
464209b6e5
21 files changed
+303
-190
No files matched your search
+34
-25
@@ -16,6 +16,9 @@
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
import traceback
|
||||
|
||||
from tools import trace, timer
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
@@ -40,6 +43,8 @@ from View.Frictions.UndoCommand import (
|
||||
|
||||
from View.Frictions.translate import *
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
class ComboBoxDelegate(QItemDelegate):
|
||||
@@ -148,36 +153,40 @@ class TableModel(QAbstractTableModel):
|
||||
row = index.row()
|
||||
column = index.column()
|
||||
|
||||
if self._headers[column] == "name":
|
||||
self._undo.push(
|
||||
SetNameCommand(
|
||||
self._frictions, row, value
|
||||
try:
|
||||
if self._headers[column] == "name":
|
||||
self._undo.push(
|
||||
SetNameCommand(
|
||||
self._frictions, row, value
|
||||
)
|
||||
)
|
||||
)
|
||||
elif self._headers[column] == "begin_kp":
|
||||
self._undo.push(
|
||||
SetBeginCommand(
|
||||
self._frictions, row, value
|
||||
elif self._headers[column] == "begin_kp":
|
||||
self._undo.push(
|
||||
SetBeginCommand(
|
||||
self._frictions, row, value
|
||||
)
|
||||
)
|
||||
)
|
||||
elif self._headers[column] == "end_kp":
|
||||
self._undo.push(
|
||||
SetEndCommand(
|
||||
self._frictions, row, value
|
||||
elif self._headers[column] == "end_kp":
|
||||
self._undo.push(
|
||||
SetEndCommand(
|
||||
self._frictions, row, value
|
||||
)
|
||||
)
|
||||
)
|
||||
elif self._headers[column] == "begin_strickler":
|
||||
self._undo.push(
|
||||
SetBeginStricklerCommand(
|
||||
self._frictions, row, self._study.river.strickler(value)
|
||||
elif self._headers[column] == "begin_strickler":
|
||||
self._undo.push(
|
||||
SetBeginStricklerCommand(
|
||||
self._frictions, row, self._study.river.strickler(value)
|
||||
)
|
||||
)
|
||||
)
|
||||
elif self._headers[column] == "end_strickler":
|
||||
self._undo.push(
|
||||
SetEndStricklerCommand(
|
||||
self._frictions, row, self._study.river.strickler(value)
|
||||
elif self._headers[column] == "end_strickler":
|
||||
self._undo.push(
|
||||
SetEndStricklerCommand(
|
||||
self._frictions, row, self._study.river.strickler(value)
|
||||
)
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
logger.debug(traceback.format_exc())
|
||||
|
||||
self.dataChanged.emit(index, index)
|
||||
return True
|
||||
|
||||
Reference in new issue
Block a user