From: nds Date: Fri, 17 Oct 2008 07:37:36 +0000 (+0000) Subject: It improves a table performance. X-Git-Tag: V1_1_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=727280b306724c74dacfb6ef7a45302a4acf7936;p=modules%2Fgui.git It improves a table performance. --- 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();