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. HorizontalHeaderViewDelegate overflows cells
Qt 6.11 is out! See what's new in the release blog

HorizontalHeaderViewDelegate overflows cells

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 291 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.
  • L Offline
    L Offline
    lgrosz
    wrote on last edited by lgrosz
    #1

    It seems the HorizontalHeaderViewDelegate overflows the cell content when its content width is greater than its width. I noticed that no implementation^1 of the component has set elide or similar. I can work around this issue by overriding contentItem like so:

    HorizontalHeaderView {
        delegate: HorizontalHeaderViewDelegate {
            contentItem: Label {
                horizontalAlignment: Text.AlignHCenter
                verticalAlignment: Text.AlignVCenter
                text: model[TableView.view.textRole]
                elide: Text.ElideRight
            }
        }
    }
    

    The main issue with this solution is it's not compatible with switching themes. Am I just using the header delegates wrong? Should I make sure my column never has a width less its header content width?

    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