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. QTableView draw custom lines
Forum Update on Monday, May 27th 2025

QTableView draw custom lines

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtableview c++
2 Posts 2 Posters 1.3k 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
    linuxkid
    wrote on last edited by
    #1

    Is there any way to draw custom lines, like, say, every three rows, with a different thickness?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Yes. You can subclass QTreeView and override drawRow to draw anything you want - lines, shapes, text, pictures, whatever.
      Sorry, I read tree view and you meant table view.
      You can set an item delegate. Then you implement the delegate by subclassing QStyledItemDelegate and override the paint method in which you can draw whatever you need.

      1 Reply Last reply
      1

      • Login

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