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

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 5 Mar 2016, 11:31 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
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 5 Mar 2016, 20:01 last edited by Chris Kawa 3 May 2016, 20:07
      #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

      2/2

      5 Mar 2016, 20:01

      • Login

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