[Qt-interest] QTableView navigation with edit strategy OnFieldChange
Mark Brand
mabrand at mabrand.nl
Mon Jan 18 14:32:40 CET 2010
Hi,
When QTableView is used on a QSqlTableModel whose edit strategy is
OnManualSubmit, TAB-key navigation works as expected. Pressing the
TAB-key in edit mode on a cell changes the focus to the next cell and an
editor is opened. I would like to combine this behavior with automatic
submits upon leaving a cell, as when the edit strategy is OnFieldChange.
TAB-key navigation does not work as desired for edit strategy
OnFieldChange. As I understand things, the commit after changing a value
in a cell results in a select() on the model and this prevents the view
from navigating to the "next" cell.
One approach I've toyed with is overriding the model's select(),
blocking the model's normal signals during the select(), and afterwards
explicitly emitting dataChanged() signal telling the view that all cells
have changed. This partially works, but the editor sometimes does not close.
I'm sure I'm not the first who has struggled with this, so I'm hoping
someone will share a tip.
Thanks,
Mark
More information about the Qt-interest-old
mailing list