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. Can I control the border(frame) of each cell in QTableView?
Forum Updated to NodeBB v4.3 + New Features

Can I control the border(frame) of each cell in QTableView?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 6.1k Views 2 Watching
  • 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.
  • S Offline
    S Offline
    ShinSat
    wrote on last edited by
    #1

    Hello Guru,

    A quick question.
    Is it possible to control either drawing or hiding the border of each cell in QTableView?
    I want to choose the cells with frame. In other words, I want to add the frame to only specific cells.

    Thanks,
    Sat

    JonBJ raven-worxR 2 Replies Last reply
    0
    • S ShinSat

      Hello Guru,

      A quick question.
      Is it possible to control either drawing or hiding the border of each cell in QTableView?
      I want to choose the cells with frame. In other words, I want to add the frame to only specific cells.

      Thanks,
      Sat

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @ShinSat
      I don't know if there is a better way, but one method is shwon in https://stackoverflow.com/questions/7262318/how-do-i-assign-a-border-to-a-specific-qtablewidgetitem-or-a-row-in-a-qtablewidg

      1 Reply Last reply
      2
      • S ShinSat

        Hello Guru,

        A quick question.
        Is it possible to control either drawing or hiding the border of each cell in QTableView?
        I want to choose the cells with frame. In other words, I want to add the frame to only specific cells.

        Thanks,
        Sat

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @ShinSat
        Using an custom QStyledItemDelegate (like @JonB pointed the link to) is the only way

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3
        • S Offline
          S Offline
          ShinSat
          wrote on last edited by
          #4

          Thanks for updates.
          Looks like Delegate will be required for this...

          BTW, does anybody know how to change the border color of cells? (matrix line color)

          Sat

          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