I've got a table model derived from QAbstractTableModel. I would like to create column objects within it using something like:
int MyTableModel::appendColumn(...)
{
Column * column = new Column(..., this->parent());
...
}
However this->parent() expects a QModelIndex parameter. I want to supply the parent object given to the MyTableModel when it was created, e.g.
model = new MyTableModel(..., parent);
How should I retrieve that original parent if model->parent() doesn't do it?
Or should I instead be making the model the parent of the column like:
Column * column = new Column(..., this);
Thanks for your help.
Max
Bookmarks