From: nds Date: Tue, 10 Nov 2009 06:28:23 +0000 (+0000) Subject: It's a correction to communicate with cells of a QtxTable object according to the... X-Git-Tag: V2_3_0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=79c9b7acd089ae57f16e2e2bb6045e23b096f5f1;p=modules%2Fgui.git It's a correction to communicate with cells of a QtxTable object according to the it methods. --- diff --git a/src/TableViewer/TableViewer_ViewWindow.cxx b/src/TableViewer/TableViewer_ViewWindow.cxx index eab4fcc8b..ba9fc478f 100755 --- a/src/TableViewer/TableViewer_ViewWindow.cxx +++ b/src/TableViewer/TableViewer_ViewWindow.cxx @@ -181,8 +181,7 @@ QString TableViewer_ViewWindow::text( const ContentType type, const int row, con aTxt = myTable->headerData( Qt::Horizontal, col ).toString(); break; case Cells: - if ( myTable->item( row, col ) ) - aTxt = myTable->item( row, col )->text(); + aTxt = myTable->cellData( row, col ).toString(); break; default: break; @@ -445,7 +444,6 @@ void TableViewer_ViewWindow::pasteData() return; int aLeftCol = myTable->columnCount(), aTopRow = myTable->rowCount(); QModelIndexList::const_iterator anIt = anItems.begin(), aLast = anItems.end(); - QTableWidgetItem* anItem; int aCol, aRow; for ( ; anIt != aLast; ++anIt ) { aRow = (*anIt).row(); @@ -467,13 +465,11 @@ void TableViewer_ViewWindow::pasteData() aRow = aCopyItem.myRow+aTopRow; if ( !canPaste( aRow, aCol, aCopyItem.myText ) ) continue; - anItem = myTable->getItem( aRow, aCol, true ); - anItem->setText( aCopyItem.myText ); - if ( aCopyItem.myBgCol.isValid() ) - anItem->setBackground( aCopyItem.myBgCol ); - if ( aCopyItem.myFgCol.isValid() ) - anItem->setForeground( aCopyItem.myFgCol ); - anItem->setFont( aCopyItem.myFont ); + + myTable->setCellData( aRow, aCol, aCopyItem.myText ); + myTable->setCellBackground( aRow, aCol, aCopyItem.myBgCol ); + myTable->setCellForeground( aRow, aCol, aCopyItem.myFgCol ); + myTable->setCellFont( aRow, aCol, aCopyItem.myFont ); } }