Hello.
I have pretty simple QColumnView and I have assigned to it simple model:
QColumnView *columnView = new QColumnView(this);
for (int i = 0; i < 4; ++i) {
parentItem->appendRow(item);
parentItem = item;
}
columnView->setModel(model);
QColumnView *columnView = new QColumnView(this);
QStandardItemModel *model;
QStandardItem *parentItem = model->invisibleRootItem();
for (int i = 0; i < 4; ++i) {
QStandardItem *item = new QStandardItem(QString("item %0").arg(i));
parentItem->appendRow(item);
parentItem = item;
}
columnView->setModel(model);
To copy to clipboard, switch view to plain text mode
But now when I for example use signal QColumnView::activated(const QModelIndex &index), the index.row() and index.column() is always 0, no matter on what item I click. And it's same also for other signals/functions. Is it a bug or am I doing something wrong? I just need to know, what item in QColumnView was activated.
Thank for help,
tlustoch
Bookmarks