Skip to content
Permalink
Browse files
Less warnings
  • Loading branch information
m-kuhn committed May 23, 2015
1 parent 916fbbc commit 1516e63b60f29446157e0ed4d49395f360c4d7bb
Showing with 5 additions and 3 deletions.
  1. +4 −2 src/app/qgsrasterlayerproperties.cpp
  2. +1 −1 src/core/layertree/qgslayertreemodel.cpp
@@ -721,7 +721,8 @@ void QgsRasterLayerProperties::sync()
}

//get the thumbnail for the layer
pixmapThumbnail->setPixmap( mRasterLayer->previewAsPixmap( pixmapThumbnail->size() ) );
QPixmap thumbnail = QPixmap::fromImage( mRasterLayer->previewAsImage( pixmapThumbnail->size() ) );
pixmapThumbnail->setPixmap( thumbnail );

// TODO fix legend + palette pixmap

@@ -927,7 +928,8 @@ void QgsRasterLayerProperties::apply()
mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );

//get the thumbnail for the layer
pixmapThumbnail->setPixmap( mRasterLayer->previewAsPixmap( pixmapThumbnail->size() ) );
QPixmap thumbnail = QPixmap::fromImage( mRasterLayer->previewAsImage( pixmapThumbnail->size() ) );
pixmapThumbnail->setPixmap( thumbnail );

mRasterLayer->setTitle( mLayerTitleLineEdit->text() );
mRasterLayer->setAbstract( mLayerAbstractTextEdit->toPlainText() );
@@ -192,7 +192,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
if ( testFlag( ShowRasterPreviewIcon ) )
{
QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( layer );
return QIcon( rlayer->previewAsPixmap( QSize( 32, 32 ) ) );
return QIcon( QPixmap::fromImage( rlayer->previewAsImage( QSize( 32, 32 ) ) ) );
}
else
{

1 comment on commit 1516e63

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on 1516e63 May 23, 2015

@m-kuhn nice!

Please sign in to comment.