Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable / disable QTableWidget's horizontal / vertical header?

If I set the horizontalHeaderVisible or verticalHeaderVisible attribute to false in Qt Designer, this works fine. But how can I enable / disable headers in my code? I've been trying something like this:

self.ui.tblContents.horizontalHeaderVisible = False
like image 682
eonhelm Avatar asked Feb 16 '13 12:02

eonhelm


1 Answers

You'd get the header and .hide() (or .setVisible(False):

self.ui.tblContents.horizontalHeader().hide()
# or
# self.ui.tblContents.horizontalHeader().setVisible(False)

self.ui.tblContents.verticalHeader().hide()
# or
# self.ui.tblContents.verticalHeader().setVisible(False)
like image 85
Avaris Avatar answered Sep 19 '22 07:09

Avaris