(1) 设置双击事件的代码
ListViewUp->setSelectionBehavior(QAbstractItemView::SelectRows);
bool value = connect(ListViewUp, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotRowDoubleClicked(const QModelIndex &)));
(2)获取详细信息
void homePage::slotRowDoubleClicked(const QModelIndex &index)
{
int row = ListViewUp->currentIndex().row();
for(i = 0; i < 4; i++)
{
QModelIndex index = modelViewOneUp->index(row,i);
QString name = modelViewOneUp->data(index).toString();
qDebug()<<name;
}
}