Skip to content

Commit

Permalink
[composer] Remove last link between composer maps and canvas
Browse files Browse the repository at this point in the history
you WILL respect the separation between core and gui!!\!
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4a0793d commit ad184cd
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions python/core/composer/qgscomposermap.sip
Expand Up @@ -255,9 +255,6 @@ class QgsComposerMap : QgsComposerItem

void updateItem();

/** Sets canvas pointer (necessary to query and draw map canvas items)*/
void setMapCanvas( QGraphicsView* canvas /Transfer/ );

void setDrawAnnotations( bool draw );
bool drawAnnotations() const;

Expand Down
1 change: 0 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -3708,7 +3708,6 @@ void QgsComposer::addComposerMap( QgsComposerMap* map )
return;
}

map->setMapCanvas( mapCanvas() ); //set canvas to composer map to have the possibility to draw canvas items
QgsComposerMapWidget* mapWidget = new QgsComposerMapWidget( map );
connect( this, SIGNAL( zoomLevelChanged() ), map, SLOT( renderModeUpdateCachedImage() ) );
mItemWidgetMap.insert( map, mapWidget );
Expand Down
2 changes: 0 additions & 2 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -56,7 +56,6 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
, mKeepLayerStyles( false )
, mFollowVisibilityPreset( false )
, mUpdatesEnabled( true )
, mMapCanvas( nullptr )
, mDrawAnnotations( true )
, mAtlasDriven( false )
, mAtlasScalingMode( Auto )
Expand Down Expand Up @@ -101,7 +100,6 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
, mKeepLayerStyles( false )
, mFollowVisibilityPreset( false )
, mUpdatesEnabled( true )
, mMapCanvas( nullptr )
, mDrawAnnotations( true )
, mAtlasDriven( false )
, mAtlasScalingMode( Auto )
Expand Down
5 changes: 0 additions & 5 deletions src/core/composer/qgscomposermap.h
Expand Up @@ -34,7 +34,6 @@ class QgsComposerMapGrid;
class QgsMapToPixel;
class QDomNode;
class QDomDocument;
class QGraphicsView;
class QPainter;
class QgsFillSymbol;
class QgsLineSymbol;
Expand Down Expand Up @@ -349,9 +348,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem

void updateItem() override;

//! Sets canvas pointer (necessary to query and draw map canvas items)
void setMapCanvas( QGraphicsView* canvas ) { mMapCanvas = canvas; }

/**
* Sets whether annotations are drawn within the composer map.
* @see drawAnnotations()
Expand Down Expand Up @@ -578,7 +574,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem

//! Current bounding rectangle. This is used to check if notification to the graphics scene is necessary
QRectF mCurrentRectangle;
QGraphicsView* mMapCanvas;
//! True if annotation items, rubber band, etc. from the main canvas should be displayed
bool mDrawAnnotations;

Expand Down
1 change: 0 additions & 1 deletion src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -1643,7 +1643,6 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG
QgsComposerMap* composerMap = new QgsComposerMap( composition, leftMargin, titleLabel->rect().bottom() + titleLabel->pos().y(), mapWidthMM, mapHeightMM );
composerMap->setLayers( mCanvas->mapSettings().layers() );
composerMap->zoomToExtent( layerExtent );
composerMap->setMapCanvas( mCanvas );
composition->addItem( composerMap );

QgsComposerTextTableV2* parameterTable = nullptr;
Expand Down

0 comments on commit ad184cd

Please sign in to comment.