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" ) );
*/
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