21 #include <QColorDialog>
37 for (
int i = 1; i <= nBands; ++i )
53 int nColors = mTreeWidget->topLevelItemCount();
54 QColor* colorArray =
new QColor[nColors];
55 for (
int i = 0; i < nColors; ++i )
57 colorArray[i] = mTreeWidget->topLevelItem( i )->background( 1 ).color();
59 int bandNumber = mBandComboBox->itemData( mBandComboBox->currentIndex() ).toInt();
65 if ( column == 1 && item )
67 QColor c = QColorDialog::getColor( item->background( column ).color() );
70 item->setBackground( column, QBrush( c ) );
82 QColor* colors = pr->
colors();
83 for (
int i = 0; i < nColors; ++i )
85 QTreeWidgetItem* item =
new QTreeWidgetItem( mTreeWidget );
86 item->setText( 0, QString::number( i ) );
87 item->setBackground( 1, QBrush( colors[i] ) );
97 QList<QgsColorRampShader::ColorRampItem> itemList = provider->
colorTable( mBandComboBox->itemData( mBandComboBox->currentIndex() ).toInt() );
98 QList<QgsColorRampShader::ColorRampItem>::const_iterator itemIt = itemList.constBegin();
100 for ( ; itemIt != itemList.constEnd(); ++itemIt )
102 QTreeWidgetItem* item =
new QTreeWidgetItem( mTreeWidget );
103 item->setText( 0, QString::number( index ) );
104 item->setBackground( 1, QBrush( itemIt->color ) );