Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Grid View : draw outside of delagate limits
QtWS25 Last Chance

Grid View : draw outside of delagate limits

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
gridviewdelegatesz-order
3 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MoaMoaK
    wrote on last edited by MoaMoaK
    #1

    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 whole GridView).

    ps : I prefer not to use z-index to do so as I have absolutely no idea how many elements I may have in the GridView so 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 using z-index that doesn't have this problem, I'm totally fine with it.

    Thx,
    MoaMoaK

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      The solution would be to have an element that is above all delegates, and preferably above everything else.

      Something that would work is an Item parented to the Window's contentItem with a high z value that you can display on demand and position on your delegate.
      Hopefully there are existing components that do that : QQC2 Popup does the first part, and the rest is done by QQC2 Tooltip (a specialized Popup).

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MoaMoaK
        wrote on last edited by MoaMoaK
        #3

        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 the ToolTip component. 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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved