Skip to content
Permalink
Browse files

[composer] Remove last link between composer maps and canvas

you WILL respect the separation between core and gui!!\!
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4a0793d commit ad184cdeeddc385cd420c35bdc4032d49b9aa32e
@@ -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;

@@ -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 );
@@ -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 )
@@ -101,7 +100,6 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
, mKeepLayerStyles( false )
, mFollowVisibilityPreset( false )
, mUpdatesEnabled( true )
, mMapCanvas( nullptr )
, mDrawAnnotations( true )
, mAtlasDriven( false )
, mAtlasScalingMode( Auto )
@@ -34,7 +34,6 @@ class QgsComposerMapGrid;
class QgsMapToPixel;
class QDomNode;
class QDomDocument;
class QGraphicsView;
class QPainter;
class QgsFillSymbol;
class QgsLineSymbol;
@@ -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()
@@ -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;

@@ -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;

0 comments on commit ad184cd

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