PDA

View Full Version : Issues with Qt::StatusTipRole



laugusti
17th August 2009, 10:48
Hi all,

I am trying to display message in the status bar but I encounter some problems.

I do have a main window containing several widgets.
In a specific widget which includes a treeView, I would like to display status messages when the user roll on cells and headers.

To do so, I use Qt::StatusTipRole in both QAbstractItemModel::data() and QAbstractItemModel::headerData() methods.

For the cells, I am able to display the status message correctly but it won't be clear when I roll on an empty cell.
For the headers, it doesn't work as the headerData() method is never called for the Qt::StatusTipRole.
Last problem, the status message is not clear when I go outside this specific widget.

Somebody already knows this problem so I can get some hints?
Should I use the slots QStatusBar::clearMessage() from QStatusBar?

Lionel

chezifresh
19th August 2009, 23:29
I was looking for the same thing, found the answer here:

http://www.qtcentre.org/forum/f-qt-programming-2/t-status-bar-statustiprole-13322.html


treeview.viewport()->setMouseTracking(true);

laugusti
20th August 2009, 15:43
Unfortunately I already activated the mouse tracking on the viewport but it didn't help.

Thanks for your input.

Regards,
Lionel