mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[needs-docs] Remove option to show raster preview icons in layer tree
This option is not safe - see #16803, and generally undesirable due to how slow generating the preview icons are
This commit is contained in:
parent
d8398400f9
commit
de7b33a373
@ -1566,6 +1566,7 @@ QgsLayerTreeModel {#qgis_api_break_3_0_QgsLayerTreeMode}
|
||||
-----------------
|
||||
|
||||
- The ShowSymbology flag was removed. Use ShowLegend instead.
|
||||
- The ShowRasterPreviewIcon was removed. This is no longer supported.
|
||||
- The AllowSymbologyChangeState flag was removed. Use AllowLegendChangeState instead.
|
||||
- legendFilterByMap() was renamed to legendFilterMapSettings()
|
||||
- isIndexSymbologyNode() was removed. Use index2legendNode() instead.
|
||||
@ -1575,6 +1576,7 @@ QgsLayerTreeModel {#qgis_api_break_3_0_QgsLayerTreeMode}
|
||||
- autoCollapseSymbologyNodes() was removed. Use autoCollapseLegendNodes() instead.
|
||||
- the constructor takes a `QgsLayerTree*` instead of a `QgsLayerTreeGroup*`
|
||||
|
||||
|
||||
QgsLayerTreeModelLegendNode {#qgis_api_break_3_0_QgsLayerTreeModelLegendNode}
|
||||
---------------------------
|
||||
|
||||
|
@ -77,7 +77,6 @@ class QgsLayerTreeModel : QAbstractItemModel
|
||||
{
|
||||
// display
|
||||
ShowLegend,
|
||||
ShowRasterPreviewIcon,
|
||||
ShowLegendAsTree,
|
||||
DeferredLegendInvalidation,
|
||||
UseEmbeddedWidgets,
|
||||
|
@ -3686,8 +3686,6 @@ void QgisApp::setupLayerTreeViewFromSettings()
|
||||
QgsSettings s;
|
||||
|
||||
QgsLayerTreeModel *model = mLayerTreeView->layerTreeModel();
|
||||
model->setFlag( QgsLayerTreeModel::ShowRasterPreviewIcon, s.value( QStringLiteral( "/qgis/createRasterLegendIcons" ), false ).toBool() );
|
||||
|
||||
QFont fontLayer, fontGroup;
|
||||
fontLayer.setBold( true );
|
||||
fontGroup.setBold( false );
|
||||
|
@ -673,7 +673,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
||||
cbxAddPostgisDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addPostgisDC" ), false ).toBool() );
|
||||
cbxAddOracleDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addOracleDC" ), false ).toBool() );
|
||||
cbxCompileExpressions->setChecked( mSettings->value( QStringLiteral( "/qgis/compileExpressions" ), true ).toBool() );
|
||||
cbxCreateRasterLegendIcons->setChecked( mSettings->value( QStringLiteral( "/qgis/createRasterLegendIcons" ), false ).toBool() );
|
||||
|
||||
mComboCopyFeatureFormat->addItem( tr( "Plain text, no geometry" ), QgsClipboard::AttributesOnly );
|
||||
mComboCopyFeatureFormat->addItem( tr( "Plain text, WKT geometry" ), QgsClipboard::AttributesWithWKT );
|
||||
@ -1283,8 +1282,6 @@ void QgsOptions::saveOptions()
|
||||
mSettings->setValue( QStringLiteral( "/qgis/addOracleDC" ), cbxAddOracleDC->isChecked() );
|
||||
mSettings->setValue( QStringLiteral( "/qgis/compileExpressions" ), cbxCompileExpressions->isChecked() );
|
||||
mSettings->setValue( QStringLiteral( "/qgis/defaultLegendGraphicResolution" ), mLegendGraphicResolutionSpinBox->value() );
|
||||
bool createRasterLegendIcons = mSettings->value( QStringLiteral( "/qgis/createRasterLegendIcons" ), false ).toBool();
|
||||
mSettings->setValue( QStringLiteral( "/qgis/createRasterLegendIcons" ), cbxCreateRasterLegendIcons->isChecked() );
|
||||
mSettings->setValue( QStringLiteral( "/qgis/copyFeatureFormat" ), mComboCopyFeatureFormat->currentData().toInt() );
|
||||
|
||||
mSettings->setValue( QStringLiteral( "/qgis/new_layers_visible" ), chkAddedVisibility->isChecked() );
|
||||
@ -1549,8 +1546,7 @@ void QgsOptions::saveOptions()
|
||||
saveGdalDriverList();
|
||||
|
||||
// refresh symbology for any legend items, only if needed
|
||||
if ( showLegendClassifiers != cbxLegendClassifiers->isChecked()
|
||||
|| createRasterLegendIcons != cbxCreateRasterLegendIcons->isChecked() )
|
||||
if ( showLegendClassifiers != cbxLegendClassifiers->isChecked() )
|
||||
{
|
||||
// TODO[MD] QgisApp::instance()->legend()->updateLegendItemSymbologies();
|
||||
}
|
||||
|
@ -195,15 +195,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
|
||||
// icons possibly overriding default icon
|
||||
if ( layer->type() == QgsMapLayer::RasterLayer )
|
||||
{
|
||||
if ( testFlag( ShowRasterPreviewIcon ) )
|
||||
{
|
||||
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
|
||||
return QIcon( QPixmap::fromImage( rlayer->previewAsImage( QSize( 32, 32 ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return QgsLayerItem::iconRaster();
|
||||
}
|
||||
return QgsLayerItem::iconRaster();
|
||||
}
|
||||
|
||||
QgsVectorLayer *vlayer = dynamic_cast<QgsVectorLayer *>( layer );
|
||||
|
@ -96,7 +96,6 @@ class CORE_EXPORT QgsLayerTreeModel : public QAbstractItemModel
|
||||
{
|
||||
// display flags
|
||||
ShowLegend = 0x0001, //!< Add legend nodes for layer nodes
|
||||
ShowRasterPreviewIcon = 0x0002, //!< Will use real preview of raster layer as icon (may be slow)
|
||||
ShowLegendAsTree = 0x0004, //!< For legends that support it, will show them in a tree instead of a list (needs also ShowLegend). Added in 2.8
|
||||
DeferredLegendInvalidation = 0x0008, //!< Defer legend model invalidation
|
||||
UseEmbeddedWidgets = 0x0010, //!< Layer nodes may optionally include extra embedded widgets (if used in QgsLayerTreeView). Added in 2.16
|
||||
|
@ -2681,8 +2681,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>741</width>
|
||||
<height>779</height>
|
||||
<width>269</width>
|
||||
<height>424</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_46">
|
||||
@ -2991,27 +2991,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3" columnminimumwidth="0,1,0">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="cbxLegendClassifiers">
|
||||
<property name="text">
|
||||
<string>Display classification attribute names</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="label_53">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Legend item styles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QGridLayout" name="gridLayout_3" columnstretch="0,1,0">
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_34">
|
||||
<property name="orientation">
|
||||
@ -3028,10 +3008,23 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="label_53">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create raster icons (may be slow)</string>
|
||||
<string>Legend item styles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="cbxLegendClassifiers">
|
||||
<property name="text">
|
||||
<string>Display classification attribute names</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -5526,7 +5519,6 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
|
||||
<tabstop>mLegendGrpBx</tabstop>
|
||||
<tabstop>cmbLegendDoubleClickAction</tabstop>
|
||||
<tabstop>cbxLegendClassifiers</tabstop>
|
||||
<tabstop>cbxCreateRasterLegendIcons</tabstop>
|
||||
<tabstop>mLegendGraphicResolutionSpinBox</tabstop>
|
||||
<tabstop>mOptionsScrollArea_05</tabstop>
|
||||
<tabstop>mIdentifyGroupBox</tabstop>
|
||||
|
Loading…
x
Reference in New Issue
Block a user