Skip to content

Commit 330d024

Browse files
committed
[GRASS] no icon module fix
1 parent 75c7bfe commit 330d024

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ QPixmap QgsGrassModule::pixmap( QString path, int height )
352352
{
353353
//QgsDebugMsg( QString( "path = %1" ).arg( path ) );
354354

355-
std::vector<QPixmap> pixmaps;
355+
QList<QPixmap> pixmaps;
356356

357357
// Create vector of available pictures
358358
int cnt = 1;
@@ -383,7 +383,7 @@ QPixmap QgsGrassModule::pixmap( QString path, int height )
383383
pic.render( &painter );
384384
painter.end();
385385

386-
pixmaps.push_back( pixmap );
386+
pixmaps << pixmap;
387387
}
388388
else // PNG
389389
{
@@ -410,9 +410,14 @@ QPixmap QgsGrassModule::pixmap( QString path, int height )
410410
cnt++;
411411
}
412412

413+
if ( pixmaps.isEmpty() )
414+
{
415+
return QPixmap();
416+
}
417+
413418
// Get total width
414419
int width = 0;
415-
for ( unsigned int i = 0; i < pixmaps.size(); i++ )
420+
for ( int i = 0; i < pixmaps.size(); i++ )
416421
{
417422
width += pixmaps[i].width();
418423
}
@@ -514,7 +519,7 @@ QPixmap QgsGrassModule::pixmap( QString path, int height )
514519
painter.setRenderHint( QPainter::Antialiasing );
515520

516521
int pos = 0;
517-
for ( unsigned int i = 0; i < pixmaps.size(); i++ )
522+
for ( int i = 0; i < pixmaps.size(); i++ )
518523
{
519524
if ( i == 1 && pixmaps.size() == 3 ) // +
520525
{

0 commit comments

Comments
 (0)