From 727280b306724c74dacfb6ef7a45302a4acf7936 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 17 Oct 2008 07:37:36 +0000 Subject: [PATCH] It improves a table performance. --- src/Qtx/QtxTable.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Qtx/QtxTable.cxx b/src/Qtx/QtxTable.cxx index 630694b45..c1fe3590d 100644 --- a/src/Qtx/QtxTable.cxx +++ b/src/Qtx/QtxTable.cxx @@ -1180,18 +1180,17 @@ void QtxTable::setHeaderData( const Qt::Orientation o, const int section, const anItem = horizontalHeaderItem( section ); else anItem = verticalHeaderItem( section ); - if ( !anItem ) { - QVariant aValue = headerData( o, section ); + + if ( anItem ) + anItem->setData( Qt::DisplayRole, var ); + else { anItem = new QTableWidgetItem(); - anItem->setData( Qt::DisplayRole, aValue ); + anItem->setData( Qt::DisplayRole, var ); if ( o == Qt::Horizontal ) setHorizontalHeaderItem( section, anItem ); else setVerticalHeaderItem( section, anItem ); } - - if ( model() ) - model()->setHeaderData( section, o, var, role ); } void QtxTable::setHeaderFont( const Qt::Orientation o, const int section, const QFont& font ) @@ -1368,7 +1367,7 @@ bool QtxTable::indexPosition( const QModelIndex& theIndex, int& theRow, void QtxTable::clear( const bool withHeaders ) { if ( withHeaders ) - clear(); + QTableWidget::clear(); else clearContents(); -- 2.39.2