[composer] Remove last link between composer maps and canvas

you WILL respect the separation between core and gui!!\!
This commit is contained in:
Nyall Dawson 2017-01-30 15:09:27 +10:00
parent 4a0793d1a3
commit ad184cdeed
5 changed files with 0 additions and 12 deletions

View File

@ -255,9 +255,6 @@ class QgsComposerMap : QgsComposerItem
void updateItem(); void updateItem();
/** Sets canvas pointer (necessary to query and draw map canvas items)*/
void setMapCanvas( QGraphicsView* canvas /Transfer/ );
void setDrawAnnotations( bool draw ); void setDrawAnnotations( bool draw );
bool drawAnnotations() const; bool drawAnnotations() const;

View File

@ -3708,7 +3708,6 @@ void QgsComposer::addComposerMap( QgsComposerMap* map )
return; return;
} }
map->setMapCanvas( mapCanvas() ); //set canvas to composer map to have the possibility to draw canvas items
QgsComposerMapWidget* mapWidget = new QgsComposerMapWidget( map ); QgsComposerMapWidget* mapWidget = new QgsComposerMapWidget( map );
connect( this, SIGNAL( zoomLevelChanged() ), map, SLOT( renderModeUpdateCachedImage() ) ); connect( this, SIGNAL( zoomLevelChanged() ), map, SLOT( renderModeUpdateCachedImage() ) );
mItemWidgetMap.insert( map, mapWidget ); mItemWidgetMap.insert( map, mapWidget );

View File

@ -56,7 +56,6 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
, mKeepLayerStyles( false ) , mKeepLayerStyles( false )
, mFollowVisibilityPreset( false ) , mFollowVisibilityPreset( false )
, mUpdatesEnabled( true ) , mUpdatesEnabled( true )
, mMapCanvas( nullptr )
, mDrawAnnotations( true ) , mDrawAnnotations( true )
, mAtlasDriven( false ) , mAtlasDriven( false )
, mAtlasScalingMode( Auto ) , mAtlasScalingMode( Auto )
@ -101,7 +100,6 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
, mKeepLayerStyles( false ) , mKeepLayerStyles( false )
, mFollowVisibilityPreset( false ) , mFollowVisibilityPreset( false )
, mUpdatesEnabled( true ) , mUpdatesEnabled( true )
, mMapCanvas( nullptr )
, mDrawAnnotations( true ) , mDrawAnnotations( true )
, mAtlasDriven( false ) , mAtlasDriven( false )
, mAtlasScalingMode( Auto ) , mAtlasScalingMode( Auto )

View File

@ -34,7 +34,6 @@ class QgsComposerMapGrid;
class QgsMapToPixel; class QgsMapToPixel;
class QDomNode; class QDomNode;
class QDomDocument; class QDomDocument;
class QGraphicsView;
class QPainter; class QPainter;
class QgsFillSymbol; class QgsFillSymbol;
class QgsLineSymbol; class QgsLineSymbol;
@ -349,9 +348,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
void updateItem() override; 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. * Sets whether annotations are drawn within the composer map.
* @see drawAnnotations() * @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 //! Current bounding rectangle. This is used to check if notification to the graphics scene is necessary
QRectF mCurrentRectangle; QRectF mCurrentRectangle;
QGraphicsView* mMapCanvas;
//! True if annotation items, rubber band, etc. from the main canvas should be displayed //! True if annotation items, rubber band, etc. from the main canvas should be displayed
bool mDrawAnnotations; bool mDrawAnnotations;

View File

@ -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 ); QgsComposerMap* composerMap = new QgsComposerMap( composition, leftMargin, titleLabel->rect().bottom() + titleLabel->pos().y(), mapWidthMM, mapHeightMM );
composerMap->setLayers( mCanvas->mapSettings().layers() ); composerMap->setLayers( mCanvas->mapSettings().layers() );
composerMap->zoomToExtent( layerExtent ); composerMap->zoomToExtent( layerExtent );
composerMap->setMapCanvas( mCanvas );
composition->addItem( composerMap ); composition->addItem( composerMap );
QgsComposerTextTableV2* parameterTable = nullptr; QgsComposerTextTableV2* parameterTable = nullptr;