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. QTableWidget. Disable selection completely.
Forum Update on Monday, May 27th 2025

QTableWidget. Disable selection completely.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 5.7k 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.
  • Z Offline
    Z Offline
    za83
    wrote on 15 May 2014, 03:45 last edited by
    #1

    I set selectionMode to NoSelection. Selection turned off. But dotted line is still painting. How can I hide it?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      monalisakanungo
      wrote on 15 May 2014, 15:09 last edited by
      #2

      Hi,
      Try with this.

      QTableWidget * tab = new QTableWidget();
      tab->setShowGrid(false);

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        za83
        wrote on 15 May 2014, 21:10 last edited by
        #3

        I talk not about this.
        Selection is disabled. But when I click on a cell there is appear dotted line on the borders of the cell.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on 16 May 2014, 14:05 last edited by
          #4

          This is not a selection, but the current item. That's not the same thing.

          One way would be to use a QProxyStyle to manipulate the flags that get send to the underlying QStyle to render the table. I think that by playing around with the flags in the QStyleItem you can remove the focus rectangle.

          1 Reply Last reply
          0

          1/4

          15 May 2014, 03:45

          • Login

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