QListView - only one column visible even thought the model contains 3 columns
-
I am adding entries to a QListView (QStandardItemModel items) in a loop as a read from a linked list:
QStandardItem* item = new QStandardItem(getImagePath()),tr(text.toStdString().c_str()));
standardModel->setItem(row, column, item);I need to be able to display things like
1 2 3
4 5 6
7 8 9but what I get is
1
4
7I have played with QListView setViewMode (IconMode and ListMode) and also setWrapping but the only way I can get the 3*3 grid effect is by putting all the items in column 1.
Any clues please??
-
I thought that, my proposed ideas included a QTableView but I was shown a demo with it using a grid layout but I cannot repeat it, must have been smoke and mirrors - hard to question a task when it has been demonstrated to work, but I have no idea what he did, I'll get him when he is back in the office :-S
So why does it allow me to add columns then, it the only the view accepting colums?
HA HA!!! setFlow(QListView::LeftToRight);
Yes!!