How to use openPersistentEditor(...) properly?
Hi there
In my app I created a Table which uses custom table view, table model and delegate.
In one of the columns of the table should be shown a button. I managed to set is as editor in my delegate.
But now I'd like to have the button always shown in the table.
I tried with openPersistentEditor(...) in the view. But I don't know how to use it properly.
Where and how should I call it.
Thanks for your help!
Cheers
Re: How to use openPersistentEditor(...) properly?
So I found a solution.
I created a slot in the table view in which I call the function openPersistentEditor(...) for every row:
Code:
void TableView::makeButtonsPersistentEditors()
{
for (int i=0; i<model()->rowCount(); i++) {
openPersistentEditor
(model
()->index
(i, _filtersColumn,
QModelIndex()));
}
}
The slot is connected with the modelReset() signal of the table model.
Cheers woodtluk