[Qt-interest] QTableView navigation with edit strategy OnFieldChange
Mark Brand
mabrand at mabrand.nl
Mon Jan 18 15:41:18 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
>
>
After posting, I found a description of the problem here:
http://bugreports.qt.nokia.com/browse/QTBUG-2875
Also related:
http://bugreports.qt.nokia.com/browse/QTBUG-1054
http://bugreports.qt.nokia.com/browse/QTBUG-772
Still need a workaround though..
-Mark
More information about the Qt-interest-old
mailing list