Skip to content
Permalink
Browse files

Merge pull request #3356 from 3nids/remove_legendmodel

remove QgsLegendModel
  • Loading branch information
3nids committed Aug 5, 2016
2 parents e82ce54 + bbb9b53 commit 1db19ce8c0f7a83f2f8f5d306997bad7e8583951
@@ -48,6 +48,7 @@ This page tries to maintain a list with incompatible changes that happened in pr
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).</li>
<li>QgsLabel and QgsLabelAttributes. Replaced by labeling based on PAL library, see QgsLabelingEngineV2.</li>
<li>QgsLegendModel was removed.
<li>QgsMapCanvasMap. It is an internal class used by map canvas.</li>
<li>QgsMapRenderer. It has been replaced by QgsMapRendererJob with subclasses and QgsMapSettings.</li>
<li>QgsPseudoColorShader. This shader has been broken for some time and was replaced by QgsSingleBandPseudoColorRenderer.</li>
@@ -60,10 +60,6 @@ class QgsComposerLegend : QgsComposerItem
*/
bool resizeToContents() const;

/** Returns pointer to the legend model*/
//! @deprecated in 2.6 - use modelV2()
QgsLegendModel* model() /Deprecated/;

//! @note added in 2.6
QgsLegendModelV2* modelV2();

This file was deleted.

@@ -207,7 +207,6 @@
%Include composer/qgscomposerutils.sip
%Include composer/qgscomposition.sip
%Include composer/qgsdoubleboxscalebarstyle.sip
%Include composer/qgslegendmodel.sip
%Include composer/qgsnumericscalebarstyle.sip
%Include composer/qgspaperitem.sip
%Include composer/qgsscalebarstyle.sip
@@ -267,7 +267,6 @@ SET(QGIS_CORE_SRCS
composer/qgscomposition.cpp
composer/qgsdoubleboxscalebarstyle.cpp
composer/qgsgroupungroupitemscommand.cpp
composer/qgslegendmodel.cpp
composer/qgsnumericscalebarstyle.cpp
composer/qgspaperitem.cpp
composer/qgsscalebarstyle.cpp
@@ -533,7 +532,6 @@ SET(QGIS_CORE_MOC_HDRS
composer/qgscomposertexttable.h
composer/qgscomposition.h
composer/qgsgroupungroupitemscommand.h
composer/qgslegendmodel.h
composer/qgspaperitem.h

raster/qgsrasterlayer.h
@@ -49,8 +49,6 @@ QgsComposerLegend::QgsComposerLegend( QgsComposition* composition )
{
mLegendModel2 = new QgsLegendModelV2( QgsProject::instance()->layerTreeRoot() );

connect( &mLegendModel, SIGNAL( layersChanged() ), this, SLOT( synchronizeWithModel() ) );

connect( &composition->atlasComposition(), SIGNAL( renderEnded() ), this, SLOT( onAtlasEnded() ) );
connect( &composition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( onAtlasFeature( QgsFeature* ) ) );

@@ -341,10 +339,6 @@ void QgsComposerLegend::synchronizeWithModel()

void QgsComposerLegend::updateLegend()
{
// take layer list from map renderer (to have legend order)
mLegendModel.blockSignals( true );
mLegendModel.setLayerSet( mComposition ? mComposition->mapSettings().layers() : QStringList() );
mLegendModel.blockSignals( false );
adjustBoxSize();
updateItem();
}
@@ -20,7 +20,6 @@

#include "qgscomposeritem.h"
#include "qgslayertreemodel.h"
#include "qgslegendmodel.h"
#include "qgslegendsettings.h"

class QgsLayerTreeModel;
@@ -87,10 +86,6 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
*/
bool resizeToContents() const;

/** Returns pointer to the legend model*/
//! @deprecated in 2.6 - use modelV2()
Q_DECL_DEPRECATED QgsLegendModel* model() {return &mLegendModel;}

//! @note added in 2.6
QgsLegendModelV2* modelV2() { return mLegendModel2; }

@@ -284,8 +279,6 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
//! use new custom layer tree and update model. if new root is null pointer, will use project's tree
void setCustomLayerTree( QgsLayerTreeGroup* rootGroup );

QgsLegendModel mLegendModel;

QgsLegendModelV2* mLegendModel2;
QgsLayerTreeGroup* mCustomLayerTree;

0 comments on commit 1db19ce

Please sign in to comment.
You can’t perform that action at this time.