Grid View : draw outside of delagate limits
-
Hi every one, I have some items displayed in a
GridView. In those items, I have a text that might be long so I'm using the elide option on it. The thing is I would like to have a tooltip that popup with the full text.
I managed to do almost everything (tooltip works fine and pop up with the text, ...) except for one thing : when the tooltip is too wide (which is often the case because I'm using it to display long text), a part of it is displayed under the cell on the right.
That totally makes sens as everything inside the cell N is drawn before the cell N+1 so it's z-index is lower but I would like to know if there is a way to force a specific QML element to be drawn above every other (or at least above my wholeGridView).ps : I prefer not to use
z-indexto do so as I have absolutely no idea how many elements I may have in theGridViewso I would like to avoid setting it to 1000 for example and then having some issues when you have more than 1000 layers drawn. But if you have an idea usingz-indexthat doesn't have this problem, I'm totally fine with it.Thx,
MoaMoaK -
The solution would be to have an element that is above all delegates, and preferably above everything else.
Something that would work is an
Itemparented to theWindow'scontentItemwith a highzvalue that you can display on demand and position on your delegate.
Hopefully there are existing components that do that : QQC2Popupdoes the first part, and the rest is done by QQC2Tooltip(a specializedPopup). -
Ok thx, i've also found a very detailed solution on stackoverflow on how to use a parent above evrything to display a component on top.
I didn't know about theToolTipcomponent. i might endup using it since it has the same purpose as what I did but probably more efficient and more weird-case-proof. So thank you for your answser.