PDA

View Full Version : ToolTip on QListView Item



cerr
2nd October 2017, 04:21
Hi,

I hav e a QListView object that's loaded with a QStringListModel and what I want, is to load particular tooltip information for each element and display when the mouse hovers over the row.
I've tried this but it doesn't seem to work:

QAbstractItemModel *model = ui->HostList->model();
QModelIndex idx = model->index(0,0);
qDebug() << model->setData(idx, "Some tooltip",Qt::ToolTipRole);
Anybody here that can help me with this?