Skip to content

Commit

Permalink
more consistent flags on TreeWidgetItems
Browse files Browse the repository at this point in the history
  • Loading branch information
pierstitus authored and nyalldawson committed Jun 2, 2016
1 parent e5ab7ca commit 8898d6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Expand Up @@ -228,6 +228,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mAddEntryButton_clicked()
newItem->setText( 0, "0" );
newItem->setBackground( 1, QBrush( QColor( Qt::magenta ) ) );
newItem->setText( 2, "" );
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
connect( newItem, SIGNAL( itemEdited( QTreeWidgetItem*, int ) ),
this, SLOT( mColormapTreeWidget_itemEdited( QTreeWidgetItem*, int ) ) );
mColormapTreeWidget->sortItems( 0, Qt::AscendingOrder );
Expand Down Expand Up @@ -409,6 +410,7 @@ void QgsSingleBandPseudoColorRendererWidget::populateColormapTreeWidget( const Q
newItem->setText( 0, QString::number( it->value, 'g' ) );
newItem->setBackground( 1, QBrush( it->color ) );
newItem->setText( 2, it->label );
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
connect( newItem, SIGNAL( itemEdited( QTreeWidgetItem*, int ) ),
this, SLOT( mColormapTreeWidget_itemEdited( QTreeWidgetItem*, int ) ) );
}
Expand Down Expand Up @@ -675,6 +677,7 @@ void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRen
newItem->setText( 0, QString::number( it->value, 'g' ) );
newItem->setBackground( 1, QBrush( it->color ) );
newItem->setText( 2, it->label );
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
connect( newItem, SIGNAL( itemEdited( QTreeWidgetItem*, int ) ),
this, SLOT( mColormapTreeWidget_itemEdited( QTreeWidgetItem*, int ) ) );
}
Expand Down

0 comments on commit 8898d6c

Please sign in to comment.