Skip to content

Commit ea9d97b

Browse files
author
jef
committedMar 16, 2011
fix histogram crash
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 659bfe8 commit ea9d97b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,15 @@ void QgsRasterLayerProperties::refreshHistogram()
18691869
int myBandCountInt = mRasterLayer->bandCount();
18701870
QList<QColor> myColors;
18711871
myColors << Qt::black << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::darkRed << Qt::darkGreen << Qt::darkBlue;
1872+
1873+
while ( myColors.size() <= myBandCountInt )
1874+
{
1875+
myColors <<
1876+
QColor( 1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1877+
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1878+
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ) );
1879+
}
1880+
18721881
//
18731882
//now draw actual graphs
18741883
//

0 commit comments

Comments
 (0)
Please sign in to comment.