[Solved] Customizing QTableWidget
-
Let's say I create a QTableWidget with two rows and columns. The resultant widget has 3 rows and 3 columns (an extra row for the row headers and an extra column for the column headers). Is there anyway to eliminate these? Basically what I'm looking for is a QList with several columns.
-
Getting the "header":http://developer.qt.nokia.com/doc/qt-4.8/qtableview.html#horizontalHeader and setting it not visible?
-
I see isColumnHidden() and isRowHidden(). In the above example, the only valid entries I have for row and column are 0 and 1 (since there are two of each). How would I specify the "extra" row or column that isn't part of the actual table data?
-
You can get access to the header widgets using the horizontalHeader() and verticalHeader() methods.
-
Perfect. I then use setHidden(), and they're both gone.
-
I pointed you to the documentation that allows you to get back the headers, and then you can call setVisible on them.