PDA

View Full Version : Table model header and statustip



frank100
24th November 2010, 14:15
Is it possible to have a statustip message when pointing over a table header?

I am using a custom QTableView with a custom model. After setting viewport()->setMouseTracking(true) I get a status tip for every cell of the table but not for the headers.

I have something like:

QVariant MyModel::headerData ( int section, Qt::Orientation orientation, int role) const {
if (role == Qt::StatusTipRole) {
qDebug() << "!!! at header stuff !!!";
return tr("My status tip test")
....
}
....
}

I can never get that log message :-(

any ideas????

franz
24th November 2010, 20:53
You could try and see if you have to enable mouse tracking on the header views as well (horizontalHeader(), verticalHeader()).

frank100
9th December 2010, 14:52
I have this:

horizontalHeader()->viewport()->setMouseTracking(true);
horizontalHeader()->setMouseTracking(true);

I monitor the calls to MyModel::headerData and I see Qt::ToolTipRole but never Qt::StatusTipRole
maybe am I missing something else?