Im using a using a QTableView
in conjuction with table model derived from QAbstaractTableModel
. Now I want to insert rows/columns (which represent states/input chars) but I need to pass a string as a label (which is then shown in the HeaderView) for state/input char down to my data classes.
bool TransTableModel::insertRows(int position, int rows, const QModelIndex &index)
{
beginInsertRows(index, position, position+rows-1);
garage->addUsedState("q6");
endInsertRows();
}
TransTableModel
is my custom model. My problem: how do I obtain this string from user? In this case I hardcoded "q6"
as a label, but I need this to be user-supplied. Is there a way? Should I open an input dialog? From the model class?