I’m using Qt4 to create a table, using the QTableWidget class.
Problem is: I want to hide the row labels (i.e. the numbers). I just care about columns. I want to get this:

(source: ldc.usb.ve)
How can I accomplish this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I was wondering about the same thing. However, I was too lazy to find a solution till you asked. (Thanks!!). Anyway, here is the code that worked for me:
These are actually QTableView’s methods. Since you use a QTableWidget which is a child of QTableView, everything works out.
I am not sure whether this is the best way to do this, but the QHeaderView documentation recommends this method. To quote the PyQt4 docs-