Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, December 2007
Table Questions


Message 1 in thread

Hi all,

I have a couple of questions regarding QTableWidget in Qt4.3:
- Is it possible to remove the vertical labels (which by default are
the row numbers)?
- What is the best way to fix the sum of the columns width to be
always equal to the table width, even when the user changes a column
width?

Cheers,

-- 
 [ signature omitted ] 

Message 2 in thread

On Dec 5, 2007, at 3:36 PM, Paulo J. Matos wrote:

> I have a couple of questions regarding QTableWidget in Qt4.3:
> - Is it possible to remove the vertical labels (which by default are
> the row numbers)?

table->verticalHeader()->hide();

> - What is the best way to fix the sum of the columns width to be
> always equal to the table width, even when the user changes a column
> width?

Connect to QHeaderView::sectionResized() and manually adjust the  
columns. Note that you would want to disable/ignore this signal while  
mucking around otherwise you will recurse and most likely die.

Brad

-- 
 [ signature omitted ]