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. How to fix table column width is resetting/overlapping when the table is scrolled
Qt 6.11 is out! See what's new in the release blog

How to fix table column width is resetting/overlapping when the table is scrolled

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 114 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.
  • A Offline
    A Offline
    AndyMf
    wrote last edited by
    #1

    When I resize my table column width and scroll the table, the column that was out of view now overlaps weirdly and the width seems to reset somehow. See these 3 images below.

    Original (not resized):
    57b26b47-2995-4e0b-b0b2-c64d5464593c-image.png

    Resized the "description" column (any column will do):
    20c915b2-73dd-4cb4-9f0c-699c722620fb-image.png

    After scrolled back and forth (horizontally) a few times:
    eee81ef2-8c91-4090-af15-a916e86acb96-image.png

    This is part of my QML code that contains the table:

    https://pastebin.com/s8QvqEyQ (on pastebin since it keeps getting flagged by akismet)

    My table model is implemented in Python but I don't think it's the cause since there's nothing related to the UI there.

    I already tried using onWidthChanged: <tableViewId>.forceLayout() on both my table view and horizontal header view after searching from Google but it doesn't seem to fix it.

    I'm using PySide 6.10.2 on Fedora KDE Linux.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bob64
      wrote last edited by
      #2

      I haven't used TableView in Qt 6 but I wonder whether your use of RowLayout in your delegate is necessary. Not saying it is causing the issue but it might be worth simplifying your implementation by removing it and debugging from there.

      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