hello every one i want to make list in Qt having 3 column i have made code but its not working kindly have a look at it
Code:
root->appendRow(item);
i am getting an error at 3rd line kindly tell me how to add columns in list box
Printable View
hello every one i want to make list in Qt having 3 column i have made code but its not working kindly have a look at it
Code:
root->appendRow(item);
i am getting an error at 3rd line kindly tell me how to add columns in list box
If you need columns in your list, then you should use table (not list), list is always one column.
Start exploring use of QTableView
You get that error because there is no c-tor like you which there were. Further it is more a table than a list you are creating. Have a look at QStandardItemModel and the first example in the detailed description is what you are looking for.
You can also fix your code:
Code:
QList<QStandardItem *> row; root->appendRow(row);