Clarification on removeColum function from QStandardItemModel
-
Hi,
I'm using QStandardItemModel and I would like to delete a column through removeColumn() function.
I know the function takes two arguments, however I don't know how to include the seconde. Here is an example of how I use it:
@
model = new QStandardItemModel;
QStandardItem item1 = new QStandardItem(tr("BMW"));
model->appendColumn(QList<QStandardItem>() << item1);if(model->item(0,2)!=0)
{
model->removeColumn(0);
}
@
As you can see I put just one argument in the function. Although the compiler does not complain, will it work properly that way? if not, how am I supposed to write (or use) it please? -
As we can see "here":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#removeColumn , you just need to inform which column you want to remove.
-
Hi,
This is basic c++, if you re-read the function signature you'll see that the second parameter has a default value if you don't give it.
-
It's documented "here":http://qt-project.org/doc/qt-5/qabstractitemmodel.html#removeColumn