From: akl Date: Tue, 18 Mar 2008 12:53:07 +0000 (+0000) Subject: Fix of IPAL19226(Show Table operation led to segmentation violation). X-Git-Tag: V5_0_0a1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e97820ff4c8adb5bacbb9f063730681ef856f8ad;p=modules%2Fvisu.git Fix of IPAL19226(Show Table operation led to segmentation violation). --- diff --git a/src/GUITOOLS/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx index 38106537..802644bd 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.cxx +++ b/src/GUITOOLS/VisuGUI_TableDlg.cxx @@ -204,7 +204,7 @@ VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, myRealTable = new VisuGUI_TableWidget( top, "myRealTable", edit, orient, showColumnTitles ); //myRealTable->getTable()->setValidator( new QDoubleValidator( this ) ); //QAbstractItemDelegate* item = myIntTable->getTable()->itemDelegate(); - myIntTable->getTable()->setItemDelegate( new NumDelegateItem( myIntTable, NumDelegateItem::NV_Real ) ); + myRealTable->getTable()->setItemDelegate( new NumDelegateItem( myRealTable, NumDelegateItem::NV_Real ) ); //item->deleteLater(); if ( bDoInt && bDoReal ) ( ( QTabWidget* )top )->addTab( myRealTable, tr( "TABLE_OF_REAL_TLT" ) ); @@ -754,9 +754,7 @@ void VisuGUI_TableWidget::getColTitles( QStringList& tlts ) */ void VisuGUI_TableWidget::setUnitsTitle( const QString& tlt ) { // !!! first column contains units !!! - myOrientation == Qt::Horizontal ? - myTable->horizontalHeaderItem(0)->setText( tlt.isNull() ? "" : tlt ) : - myTable->verticalHeaderItem(0)->setText( tlt.isNull() ? "" : tlt ); + myTable->model()->setHeaderData( 0, myOrientation, QVariant(tlt.isNull() ? "" : tlt), Qt::DisplayRole ); } /*! Sets units