Hi,
I am developing a program using QTableView. I am sort of lazy using QStandardItemModel
to create the default empty table. The data inputed to the model is dynamic.
itemmodel_=new QStandardItemModel(0,5);
itemmodel_->setHeaderData(0, Qt::Horizontal, tr("View"));
itemmodel_->setHeaderData(1, Qt::Horizontal, tr("Gene type"));
itemmodel_->setHeaderData(2, Qt::Horizontal, tr("Proportion (%)"));
itemmodel_->setHeaderData(3, Qt::Horizontal, tr("Time (msec)"));
itemmodel_->setHeaderData(4, Qt::Horizontal, tr("Density"));
QItemSelectionModel* selmodel = ODTableView->selectionModel();
ODTableView->setSelectionMode(QAbstractItemView::ExtendedSelec tion);
QObject::connect(selmodel, SIGNAL(selectionChanged(const QItemSelection &,
const QItemSelection &)),
this, SLOT(slectionHandle(const QItemSelection &,
const QItemSelection &)) );
In my application I want to select "rows" or "all" to generate a signal to update statistical
graph in another dialog. But now the selectionChanged signal is not released when the
mouse changes selection in the table view. Actually, I tried to connect the signal even after
the table items are added but still not work. additionally, the table view is set to visible only if data are loaded. Can anyone help?![]()
Bookmarks