Skip to content
Permalink
Browse files

fix histogram crash

git-svn-id: http://svn.osgeo.org/qgis/trunk@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 16, 2011
1 parent 59ce32e commit 768ce9ca540221b58a0a3f5641f00f051eaef884
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/app/qgsrasterlayerproperties.cpp
@@ -1869,6 +1869,15 @@ void QgsRasterLayerProperties::refreshHistogram()
int myBandCountInt = mRasterLayer->bandCount();
QList<QColor> myColors;
myColors << Qt::black << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::darkRed << Qt::darkGreen << Qt::darkBlue;

while ( myColors.size() <= myBandCountInt )
{
myColors <<
QColor( 1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ) );
}

//
//now draw actual graphs
//

0 comments on commit 768ce9c

Please sign in to comment.
You can’t perform that action at this time.