Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. In QTableView, how to the text within the cells is always within the visible range.
Qt 6.11 is out! See what's new in the release blog

In QTableView, how to the text within the cells is always within the visible range.

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 163 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.
  • F Offline
    F Offline
    flyfish
    wrote on last edited by flyfish
    #1

    The current approach involves overriding the paint method within a delegate, and recalculating the rectangle.

     auto visiableRect = view->viewport()->rect();
     opt.rect = opt.rect.intersected(visiableRect);
    

    However, this approach fails to fully redraw the corresponding complete cell regions when the QTableView is scrolled, resulting in a rendering discrepancy.
    Is there another method to achieve the same functionality?

    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