]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
It improves a table performance.
authornds <nds@opencascade.com>
Fri, 17 Oct 2008 07:37:36 +0000 (07:37 +0000)
committernds <nds@opencascade.com>
Fri, 17 Oct 2008 07:37:36 +0000 (07:37 +0000)
src/Qtx/QtxTable.cxx

index 630694b454196ae8784558313efa3489d9da54e1..c1fe3590db33bf71d534ce95678606592dfbf8ad 100644 (file)
@@ -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();