TropicalPenguin
19th November 2011, 21:48
Hello.
I have a QListView in which I have arranged the items of an item model in a grid (using the icons from each item's Qt::DecorationRole).
What I would like to do now is to create an effect whereby, when the user hovers the mouse over one of the items in this grid - after a given delay - a box containing information about the hovered item is displayed somewhere near the cursor.
The box can not be constrained by the size of the viewport.
The problem is that I am not very sure where to begin. As far as I understand delegates, they seem insufficient for achieving this. Regular tooltips even more so (since their content's layout is fairly fixed).
Would this be a matter of creating a QWidget-subclass (layed out in whatever way I need) with certain window flags somewhere in my QListView subclass after the firing of a timer after a hover has been detected?
Any ideas?
Thanks in advance.
I have a QListView in which I have arranged the items of an item model in a grid (using the icons from each item's Qt::DecorationRole).
What I would like to do now is to create an effect whereby, when the user hovers the mouse over one of the items in this grid - after a given delay - a box containing information about the hovered item is displayed somewhere near the cursor.
The box can not be constrained by the size of the viewport.
The problem is that I am not very sure where to begin. As far as I understand delegates, they seem insufficient for achieving this. Regular tooltips even more so (since their content's layout is fairly fixed).
Would this be a matter of creating a QWidget-subclass (layed out in whatever way I need) with certain window flags somewhere in my QListView subclass after the firing of a timer after a hover has been detected?
Any ideas?
Thanks in advance.