mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix tabbing over hidden columns
This commit is contained in:
parent
7142173460
commit
59289e67cd
@ -44,21 +44,27 @@ class TableView(QTableView):
|
|||||||
m = self.model()
|
m = self.model()
|
||||||
row = current.row()
|
row = current.row()
|
||||||
vdx = hdr.visualIndex(current.column()) # must work with visual indices, not logical indices
|
vdx = hdr.visualIndex(current.column()) # must work with visual indices, not logical indices
|
||||||
|
if vdx < 0:
|
||||||
|
return
|
||||||
|
num_columns = hdr.count()
|
||||||
|
idx = QModelIndex()
|
||||||
while True:
|
while True:
|
||||||
vdx = vdx + delta
|
vdx = vdx + delta
|
||||||
if vdx < 0:
|
if vdx < 0:
|
||||||
if row <= 0:
|
if row <= 0:
|
||||||
return
|
return
|
||||||
row -= 1
|
row -= 1
|
||||||
vdx += len(self.column_map)
|
vdx += num_columns
|
||||||
if vdx >= len(self.column_map):
|
if vdx >= num_columns:
|
||||||
if row >= m.rowCount(QModelIndex()) - 1:
|
if row >= m.rowCount(QModelIndex()) - 1:
|
||||||
return
|
return
|
||||||
row += 1
|
row += 1
|
||||||
vdx -= len(self.column_map)
|
vdx -= num_columns
|
||||||
if vdx < 0 or vdx >= len(self.column_map):
|
if vdx < 0 or vdx >= num_columns:
|
||||||
return
|
return
|
||||||
ldx = hdr.logicalIndex(vdx) # We need the logical index for the model
|
ldx = hdr.logicalIndex(vdx) # We need the logical index for the model
|
||||||
|
if hdr.isSectionHidden(ldx):
|
||||||
|
continue
|
||||||
colname = self.column_map[ldx]
|
colname = self.column_map[ldx]
|
||||||
idx = m.index(row, ldx, current.parent())
|
idx = m.index(row, ldx, current.parent())
|
||||||
if m.is_custom_column(colname):
|
if m.is_custom_column(colname):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user