forked from IPKM/nmreval
correct tab behavior after value change (part of #79)
This commit is contained in:
parent
30e148de14
commit
775b5e7e8a
@ -188,7 +188,15 @@ class ValueEditWidget(QtWidgets.QWidget, Ui_MaskDialog):
|
|||||||
new_value = complex(val)
|
new_value = complex(val)
|
||||||
new_value = new_value.real if new_value.imag == 0 else new_value
|
new_value = new_value.real if new_value.imag == 0 else new_value
|
||||||
|
|
||||||
|
# table view loses focus when itemChanged is emitted
|
||||||
|
# if edit of item is cause of change resume editing at next item
|
||||||
|
prev_state = self.tableView.state()
|
||||||
|
idx = self.tableView.currentIndex()
|
||||||
|
idx = idx.sibling((col+1)//3+row, (col+1) % 3)
|
||||||
self.itemChanged.emit(sid, (col, row), new_value)
|
self.itemChanged.emit(sid, (col, row), new_value)
|
||||||
|
if prev_state == self.tableView.State.EditingState:
|
||||||
|
self.tableView.setCurrentIndex(idx)
|
||||||
|
self.tableView.edit(idx)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(QtCore.QItemSelection, QtCore.QItemSelection)
|
@QtCore.pyqtSlot(QtCore.QItemSelection, QtCore.QItemSelection)
|
||||||
def show_position(self, *_):
|
def show_position(self, *_):
|
||||||
|
Loading…
Reference in New Issue
Block a user