Enter numbers with commas

This commit is contained in:
Paul S 2021-07-06 16:49:43 +02:00
parent f1123a6fd5
commit 6183acf307
4 changed files with 260 additions and 182 deletions

View file

@ -47,7 +47,6 @@ class TableWidget(QTableWidget):
super().__init__()
self.parent = parent
self.setParent(parent)
# self.setSelectionMode(QAbstractItemView.ContiguousSelection)
self.setSelectionMode(QAbstractItemView.SingleSelection)
@ -245,8 +244,7 @@ class TableWidget(QTableWidget):
for idx in sel_idx:
self.clipboard_data.append(idx.data())
def item_del(self):
ask_cofirmation = True
def item_del(self, ask_cofirmation=True):
sel_idx = self.selectionModel().selectedIndexes()
for idx in sel_idx:
row = idx.row()
@ -262,3 +260,9 @@ class TableWidget(QTableWidget):
ask_cofirmation = False
item.setData(Qt.DisplayRole, None)
if len(sel_idx) == self.columnCount() * self.rowCount():
try:
self.parent.is_modified = False # set parents modification flag (if present)
except AttributeError:
pass