mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	[composer] Remove QgsComposerMap::storeCurrentLayerSet
This method was used to sync the canvas layers to a composer map. The logic has been moved to app to avoid a dependancy between compositions and the main map canvas
This commit is contained in:
		
							parent
							
								
									f96364e8dc
								
							
						
					
					
						commit
						49411210b0
					
				@ -569,7 +569,7 @@ and should be accessed using QgsComposerMap::overview() or QgsComposerMap::overv
 | 
			
		||||
instead.
 | 
			
		||||
- atlasFixedScale() and setAtlasFixedScale() were removed. Use atlasScalingMode()
 | 
			
		||||
and setAtlasScalingMode() instead.
 | 
			
		||||
 | 
			
		||||
- storeCurrentLayerSet() was removed. Use setLayers() instead.
 | 
			
		||||
 | 
			
		||||
QgsComposerMapGrid        {#qgis_api_break_3_0_QgsComposerMapGrid}
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
@ -139,8 +139,6 @@ class QgsComposerMap : QgsComposerItem
 | 
			
		||||
    QList<QgsMapLayer*> layers() const;
 | 
			
		||||
    /** Setter for stored layer set that is used if mKeepLayerSet is true */
 | 
			
		||||
    void setLayers( const QList<QgsMapLayer*> layers );
 | 
			
		||||
    /** Stores the current layer set of the qgis mapcanvas in mLayerSet*/
 | 
			
		||||
    void storeCurrentLayerSet();
 | 
			
		||||
 | 
			
		||||
    /** Getter for flag that determines if current styles of layers should be overridden by previously stored styles. @note added in 2.8 */
 | 
			
		||||
    bool keepLayerStyles() const;
 | 
			
		||||
 | 
			
		||||
@ -828,7 +828,7 @@ void QgsComposerMapWidget::on_mKeepLayerListCheckBox_stateChanged( int state )
 | 
			
		||||
 | 
			
		||||
  if ( state == Qt::Checked )
 | 
			
		||||
  {
 | 
			
		||||
    mComposerMap->storeCurrentLayerSet();
 | 
			
		||||
    storeCurrentLayerSet();
 | 
			
		||||
    mComposerMap->setKeepLayerSet( true );
 | 
			
		||||
 | 
			
		||||
    // mutually exclusive with following a preset
 | 
			
		||||
@ -1450,6 +1450,21 @@ void QgsComposerMapWidget::updateOverviewFrameSymbolMarker( const QgsComposerMap
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void QgsComposerMapWidget::storeCurrentLayerSet()
 | 
			
		||||
{
 | 
			
		||||
  if ( !mComposerMap )
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  QList<QgsMapLayer*> layers = QgisApp::instance()->mapCanvas()->mapSettings().layers();
 | 
			
		||||
  mComposerMap->setLayers( layers );
 | 
			
		||||
 | 
			
		||||
  if ( mComposerMap->keepLayerStyles() )
 | 
			
		||||
  {
 | 
			
		||||
    // also store styles associated with the layers
 | 
			
		||||
    mComposerMap->storeCurrentLayerStyles();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QListWidgetItem* QgsComposerMapWidget::addOverviewListItem( const QString& id, const QString& name )
 | 
			
		||||
{
 | 
			
		||||
  QListWidgetItem* item = new QListWidgetItem( name, nullptr );
 | 
			
		||||
 | 
			
		||||
@ -163,6 +163,9 @@ class QgsComposerMapWidget: public QgsComposerItemBaseWidget, private Ui::QgsCom
 | 
			
		||||
    void loadOverviewEntries();
 | 
			
		||||
 | 
			
		||||
    void updateOverviewFrameSymbolMarker( const QgsComposerMapOverview* overview );
 | 
			
		||||
 | 
			
		||||
    void storeCurrentLayerSet();
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -1561,17 +1561,6 @@ bool QgsComposerMap::readXml( const QDomElement& itemElem, const QDomDocument& d
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void QgsComposerMap::storeCurrentLayerSet()
 | 
			
		||||
{
 | 
			
		||||
  mLayers = _qgis_listRawToQPointer( mComposition->mapSettings().layers() );
 | 
			
		||||
 | 
			
		||||
  if ( mKeepLayerStyles )
 | 
			
		||||
  {
 | 
			
		||||
    // also store styles associated with the layers
 | 
			
		||||
    storeCurrentLayerStyles();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QList<QgsMapLayer*> QgsComposerMap::layers() const
 | 
			
		||||
{
 | 
			
		||||
  return _qgis_listQPointerToRaw( mLayers );
 | 
			
		||||
 | 
			
		||||
@ -178,8 +178,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
 | 
			
		||||
    QList<QgsMapLayer*> layers() const;
 | 
			
		||||
    //! Setter for stored layer set that is used if mKeepLayerSet is true
 | 
			
		||||
    void setLayers( const QList<QgsMapLayer*> layers );
 | 
			
		||||
    //! Stores the current layer set of the qgis mapcanvas in mLayerSet
 | 
			
		||||
    void storeCurrentLayerSet();
 | 
			
		||||
 | 
			
		||||
    //! Getter for flag that determines if current styles of layers should be overridden by previously stored styles. @note added in 2.8
 | 
			
		||||
    bool keepLayerStyles() const { return mKeepLayerStyles; }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user