[Qt-interest] Changing font size in QTableWidgetItem

Paul England pengland at cmt-asia.com
Tue Jan 20 00:20:45 CET 2009


Hi

Trying to change the font size of a QTableWidget (well, the 
QTableWidgetItems in the QTableWidget).
Something like this works, but is painfully slow:

QFont f( "Tahoma", 10, QFont::Bold );
my_table->item( row, col )->setFont( f );

For a table of 18 rows and about 40-50 columns,  it takes a few seconds 
to update.
I tried this:
tbl_main->item( row, col )->font().setPointSize( font_size );

Doesn't really work, unfortunately.  Do I have to repaint it or something?

Thanks
Paul



More information about the Qt-interest-old mailing list