void HYDROGUI_ColorDelegate::paint( QPainter* thePainter, const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex ) const
{
- QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+ QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value<QColor>();
thePainter->fillRect( theOption.rect, aColor );
}
const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex ) const
{
- QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+ QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value<QColor>();
QColor aNewColor = QColorDialog::getColor( aColor );
if( aNewColor.isValid() )
{
myName = new QLineEdit( aNameGroup );
QGroupBox* aAttrNameGroup = new QGroupBox( tr( "STRICKLER_TABLE_ATTR_NAME" ), this );
+ aAttrNameGroup->setVisible( theType == Edit );
QLabel* aAttrNameLabel = new QLabel( tr( "ATTR_NAME" ), aAttrNameGroup );
myAttrName = new QLineEdit( aAttrNameGroup );
myTable->setHorizontalHeaderLabels( aColumnNames );
myTable->horizontalHeader()->setStretchLastSection( false );
- myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::ResizeToContents );
- myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents );
- myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents );
- myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch );
+ myTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::ResizeToContents );
+ myTable->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
+ myTable->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::ResizeToContents );
+ myTable->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::Stretch );
myTable->horizontalHeader()->setMinimumSectionSize( 50 );
- myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
+ myTable->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents );
// Layout
// buttons
myName->setReadOnly( on );
}
-void HYDROGUI_StricklerTableDlg::getGuiData( Handle_HYDROData_StricklerTable& theTable ) const
+void HYDROGUI_StricklerTableDlg::getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const
{
if( theTable.IsNull() )
return;
}
}
-void HYDROGUI_StricklerTableDlg::setGuiData( const Handle_HYDROData_StricklerTable& theTable )
+void HYDROGUI_StricklerTableDlg::setGuiData( const Handle(HYDROData_StricklerTable)& theTable )
{
myAttrName->setText( theTable->GetAttrName() );