void QgsLayoutItemLegend::onAtlasFeature() { if ( !mLayout->reportContext().feature().isValid() ) return; mInAtlas = mFilterOutAtlas; updateFilterByMap(); }
void QgsComposerLegend::onAtlasFeature( QgsFeature *feat ) { if ( !feat ) return; mInAtlas = mFilterOutAtlas; updateFilterByMap(); }
void QgsComposerLegend::updateItem() { if ( !updatesEnabled() ) return; updateFilterByMap( false ); QgsComposerItem::updateItem(); }
void QgsLayoutItemLegend::nodeCustomPropertyChanged( QgsLayerTreeNode *, const QString & ) { if ( autoUpdateModel() ) { // in "auto update" mode, some parameters on the main app legend may have been changed (expression filtering) // we must then call updateItem to reflect the changes updateFilterByMap( false ); } }
void QgsLayoutItemLegend::setAutoUpdateModel( bool autoUpdate ) { if ( autoUpdate == autoUpdateModel() ) return; setCustomLayerTree( autoUpdate ? nullptr : mLayout->project()->layerTreeRoot()->clone() ); adjustBoxSize(); updateFilterByMap( false ); }
void QgsComposerLegend::setComposerMap( const QgsComposerMap* map ) { if ( mComposerMap ) { disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) ); disconnect( mComposerMap, SIGNAL( itemChanged() ), this, SLOT( updateFilterByMap() ) ); disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateFilterByMap() ) ); disconnect( mComposerMap, SIGNAL( layerStyleOverridesChanged() ), this, SLOT( mapLayerStyleOverridesChanged() ) ); } mComposerMap = map; if ( map ) { QObject::connect( map, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) ); QObject::connect( map, SIGNAL( itemChanged() ), this, SLOT( updateFilterByMap() ) ); QObject::connect( map, SIGNAL( extentChanged() ), this, SLOT( updateFilterByMap() ) ); QObject::connect( map, SIGNAL( layerStyleOverridesChanged() ), this, SLOT( mapLayerStyleOverridesChanged() ) ); } updateItem(); }
void QgsLayoutItemLegend::mapLayerStyleOverridesChanged() { if ( !mMap ) return; // map's style has been changed, so make sure to update the legend here if ( mLegendFilterByMap ) { // legend is being filtered by map, so we need to re run the hit test too // as the style overrides may also have affected the visible symbols updateFilterByMap( false ); } else { mLegendModel->setLayerStyleOverrides( mMap->layerStyleOverrides() ); Q_FOREACH ( QgsLayerTreeLayer *nodeLayer, mLegendModel->rootGroup()->findLayers() ) mLegendModel->refreshLayerLegend( nodeLayer ); } adjustBoxSize(); updateFilterByMap( false ); }
void QgsLayoutItemLegend::setLinkedMap( QgsLayoutItemMap *map ) { if ( mMap ) { setupMapConnections( mMap, false ); } mMap = map; if ( mMap ) { setupMapConnections( mMap, true ); } updateFilterByMap(); }
void QgsComposerLegend::onAtlasEnded() { mInAtlas = false; updateFilterByMap(); }
void QgsComposerLegend::updateFilterByMapAndRedraw() { updateFilterByMap( true ); }
void QgsLayoutItemLegend::onAtlasEnded() { mInAtlas = false; updateFilterByMap(); }
void QgsLayoutItemLegend::updateFilterByMapAndRedraw() { updateFilterByMap( true ); }
void QgsLayoutItemLegend::updateLegend() { adjustBoxSize(); updateFilterByMap( false ); }
void QgsLayoutItemLegend::setLegendFilterByMapEnabled( bool enabled ) { mLegendFilterByMap = enabled; updateFilterByMap( false ); }
void QgsComposerLegend::updateItem() { updateFilterByMap( false ); QgsComposerItem::updateItem(); }
void QgsComposerLegend::setLegendFilterByMapEnabled( bool enabled ) { mLegendFilterByMap = enabled; updateFilterByMap(); }