Skip to content

Commit a877a1a

Browse files
author
timlinux
committed
Show raster preview mini thumbnail as legend icon
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8958 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3ac19d9 commit a877a1a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/app/legend/qgslegendlayer.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,15 @@ QPixmap QgsLegendLayer::getOriginalPixmap() const
454454
return QgisApp::getThemePixmap("/mIconLayer.png");
455455
}
456456
}
457-
else // RASTER
457+
else if (firstLayer->type() == QgsMapLayer::RASTER)
458+
{
459+
QgsRasterLayer* rlayer = dynamic_cast<QgsRasterLayer*>(firstLayer);
460+
QPixmap myPixmap(32,32);
461+
rlayer->drawThumbnail(&myPixmap);
462+
return myPixmap;
463+
464+
}
465+
else // undefined - should never reach this
458466
{
459467
return QgisApp::getThemePixmap("/mIconLayer.png");
460468
}

0 commit comments

Comments
 (0)