Everall
5th February 2006, 16:04
Hi,
I'm experimenting a little with QTableViews selection behaviour.
The default is when you click on an item it gets selected (blue), but editing doesn't start yet. When you click on a column , the entire column gets selected (blue).
If you alter the editTrigger property for the view to CurrentChanged, then clicking on a cell starts editing immediately. Ok that's what I want.
But when you click a vertical header now, the first cell is in editing state (the delegate shows up) and that is not what I want.
Does anyone know a simple way to use the currentChanged property without getting the first cell in editing state when clicking on a header?
You can see this behaviour yourself if you want:
in the relationaltablemodel example I added a line to the createview function
QTableView *createView(const QString &title, QSqlTableModel *model)
{
QTableView *view = new QTableView;
...
view->setEditTriggers ( QAbstractItemView::CurrentChanged );
return view;
}
Maybe i'm not seeing the obvious...
All suggestions are welcome
I'm experimenting a little with QTableViews selection behaviour.
The default is when you click on an item it gets selected (blue), but editing doesn't start yet. When you click on a column , the entire column gets selected (blue).
If you alter the editTrigger property for the view to CurrentChanged, then clicking on a cell starts editing immediately. Ok that's what I want.
But when you click a vertical header now, the first cell is in editing state (the delegate shows up) and that is not what I want.
Does anyone know a simple way to use the currentChanged property without getting the first cell in editing state when clicking on a header?
You can see this behaviour yourself if you want:
in the relationaltablemodel example I added a line to the createview function
QTableView *createView(const QString &title, QSqlTableModel *model)
{
QTableView *view = new QTableView;
...
view->setEditTriggers ( QAbstractItemView::CurrentChanged );
return view;
}
Maybe i'm not seeing the obvious...
All suggestions are welcome