Skip to content

Commit

Permalink
Remove layer/legend/palette preview from raster layer properties
Browse files Browse the repository at this point in the history
These boxes were not very useful - two of them (legend and palette)
have been disabled for many years now, and the layer preview was
occasionally causing an exception when used with contour renderer,
which caused the raster properties dialog to fail to load at all.

See https://lists.osgeo.org/pipermail/qgis-developer/2020-November/062651.html
  • Loading branch information
wonder-sk committed Dec 6, 2020
1 parent e93bda8 commit b0f5f09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 145 deletions.
22 changes: 0 additions & 22 deletions src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -856,24 +856,6 @@ void QgsRasterLayerProperties::sync()
mLayerOrigNameLineEd->setText( mRasterLayer->name() );
leDisplayName->setText( mRasterLayer->name() );

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

// TODO fix legend + palette pixmap

//update the legend pixmap on this dialog
#if 0
pixmapLegend->setPixmap( mRasterLayer->legendAsPixmap() );
pixmapLegend->setScaledContents( true );
pixmapLegend->repaint();

//set the palette pixmap
pixmapPalette->setPixmap( mRasterLayer->paletteAsPixmap( mRasterLayer->bandNumber( mRasterLayer->grayBandName() ) ) );
pixmapPalette->setScaledContents( true );
pixmapPalette->repaint();
#endif

QgsDebugMsgLevel( QStringLiteral( "populate metadata tab" ), 2 );
/*
* Metadata Tab
Expand Down Expand Up @@ -1113,10 +1095,6 @@ void QgsRasterLayerProperties::apply()

mRasterLayer->setCrs( mCrsSelector->crs() );

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

if ( mRasterLayer->shortName() != mLayerShortNameLineEdit->text() )
mMetadataFilled = false;
mRasterLayer->setShortName( mLayerShortNameLineEdit->text() );
Expand Down
123 changes: 0 additions & 123 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Expand Up @@ -1243,129 +1243,6 @@ border-radius: 2px;</string>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="spacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox10">
<property name="title">
<string>Thumbnail</string>
</property>
<layout class="QGridLayout" name="_7">
<item row="0" column="0">
<widget class="QLabel" name="pixmapThumbnail">
<property name="minimumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox9">
<property name="title">
<string>Legend</string>
</property>
<layout class="QGridLayout" name="_8">
<item row="0" column="0">
<widget class="QLabel" name="pixmapLegend">
<property name="minimumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox8">
<property name="title">
<string>Palette</string>
</property>
<layout class="QGridLayout" name="_9">
<item row="0" column="0">
<widget class="QLabel" name="pixmapPalette">
<property name="minimumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
Expand Down

0 comments on commit b0f5f09

Please sign in to comment.