Skip to content
Permalink
Browse files

fix histogram crash

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 16, 2011
1 parent 659bfe8 commit ea9d97bec9d924ff77a98f3722bd24f40a8a360b
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 ea9d97b

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