Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Clarification on removeColum function from QStandardItemModel
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);
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?
guidupas last edited by
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, I have already seen this doc and sorry but it does not answer my questions.
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.
Hi, but will it behave properly even if the default value is given? And sorry how am I supposed to know that the second parameter has a default value if I don't give it?
It's documented "here":http://qt-project.org/doc/qt-5/qabstractitemmodel.html#removeColumn