Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QTableWidget. Disable selection completely.



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



  • Hi,
    Try with this.

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



  • 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.



  • 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.


Log in to reply