@@ -626,19 +626,19 @@ void QgsRasterLayerProperties::sync()
626
626
}
627
627
628
628
// get the thumbnail for the layer
629
- QPixmap myQPixmap = QPixmap ( pixmapThumbnail-> width (), pixmapThumbnail->height ( ) );
630
- mRasterLayer -> thumbnailAsPixmap ( &myQPixmap );
631
- pixmapThumbnail-> setPixmap ( myQPixmap );
629
+ pixmapThumbnail-> setPixmap ( mRasterLayer -> previewAsPixmap ( pixmapThumbnail->size () ) );
630
+
631
+ // TODO fix legend + palette pixmap
632
632
633
633
// update the legend pixmap on this dialog
634
634
// pixmapLegend->setPixmap( mRasterLayer->legendAsPixmap() );
635
- pixmapLegend->setScaledContents ( true );
636
- pixmapLegend->repaint ();
635
+ // pixmapLegend->setScaledContents( true );
636
+ // pixmapLegend->repaint();
637
637
638
638
// set the palette pixmap
639
- // pixmapPalette->setPixmap( mRasterLayer->paletteAsPixmap( mRasterLayer->bandNumber( mRasterLayer->grayBandName() ) ) );
640
- pixmapPalette->setScaledContents ( true );
641
- pixmapPalette->repaint ();
639
+ // pixmapPalette->setPixmap( mRasterLayer->paletteAsPixmap( mRasterLayer->bandNumber( mRasterLayer->grayBandName() ) ) );
640
+ // pixmapPalette->setScaledContents( true );
641
+ // pixmapPalette->repaint();
642
642
643
643
QgsDebugMsg ( " populate metadata tab" );
644
644
/*
@@ -761,9 +761,9 @@ void QgsRasterLayerProperties::apply()
761
761
mRasterLayer ->setMaximumScale ( 1.0 / cbMaximumScale->scale () );
762
762
763
763
// update the legend pixmap
764
- pixmapLegend->setPixmap ( mRasterLayer ->legendAsPixmap () );
765
- pixmapLegend->setScaledContents ( true );
766
- pixmapLegend->repaint ();
764
+ // pixmapLegend->setPixmap( mRasterLayer->legendAsPixmap() );
765
+ // pixmapLegend->setScaledContents( true );
766
+ // pixmapLegend->repaint();
767
767
768
768
QgsRasterResampleFilter* resampleFilter = mRasterLayer ->resampleFilter ();
769
769
@@ -803,9 +803,7 @@ void QgsRasterLayerProperties::apply()
803
803
804
804
805
805
// get the thumbnail for the layer
806
- QPixmap myQPixmap = QPixmap ( pixmapThumbnail->width (), pixmapThumbnail->height () );
807
- mRasterLayer ->thumbnailAsPixmap ( &myQPixmap );
808
- pixmapThumbnail->setPixmap ( myQPixmap );
806
+ pixmapThumbnail->setPixmap ( mRasterLayer ->previewAsPixmap ( pixmapThumbnail->size () ) );
809
807
810
808
mRasterLayer ->setTitle ( mLayerTitleLineEdit ->text () );
811
809
mRasterLayer ->setAbstract ( mLayerAbstractTextEdit ->toPlainText () );
@@ -914,9 +912,10 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
914
912
}
915
913
}
916
914
// update the legend pixmap
917
- pixmapLegend->setPixmap ( mRasterLayer ->legendAsPixmap () );
918
- pixmapLegend->setScaledContents ( true );
919
- pixmapLegend->repaint ();
915
+ // pixmapLegend->setPixmap( mRasterLayer->legendAsPixmap() );
916
+ // pixmapLegend->setScaledContents( true );
917
+ // pixmapLegend->repaint();
918
+
920
919
// populate the metadata tab's text browser widget with gdal metadata info
921
920
QString myStyle = QgsApplication::reportStyleSheet ();
922
921
txtbMetadata->setHtml ( mRasterLayer ->metadata () );
0 commit comments