Skip to content
Permalink
Browse files

Make composition associated with QgsProject (#3957)

... rather than using project singleton within compositions
  • Loading branch information
wonder-sk committed Jan 6, 2017
1 parent 062de6a commit 8c340f7144e4752cb0defd58b5ab3fe620b77bb4
Showing with 188 additions and 139 deletions.
  1. +1 −0 doc/api_break.dox
  2. +9 −1 python/core/composer/qgscomposition.sip
  3. +2 −2 src/app/composer/qgscomposer.cpp
  4. +1 −1 src/core/composer/qgsaddremoveitemcommand.cpp
  5. +1 −1 src/core/composer/qgsaddremovemultiframecommand.cpp
  6. +3 −3 src/core/composer/qgsatlascomposition.cpp
  7. +7 −6 src/core/composer/qgscomposerattributetablev2.cpp
  8. +2 −2 src/core/composer/qgscomposerhtml.cpp
  9. +2 −1 src/core/composer/qgscomposeritemcommand.cpp
  10. +2 −2 src/core/composer/qgscomposerlabel.cpp
  11. +9 −9 src/core/composer/qgscomposerlegend.cpp
  12. +13 −11 src/core/composer/qgscomposermap.cpp
  13. +2 −2 src/core/composer/qgscomposermousehandles.cpp
  14. +2 −1 src/core/composer/qgscomposermultiframecommand.cpp
  15. +1 −3 src/core/composer/qgscomposerobject.cpp
  16. +2 −2 src/core/composer/qgscomposerpicture.cpp
  17. +1 −1 src/core/composer/qgscomposerscalebar.cpp
  18. +27 −21 src/core/composer/qgscomposition.cpp
  19. +13 −1 src/core/composer/qgscomposition.h
  20. +1 −1 src/core/composer/qgsgroupungroupitemscommand.cpp
  21. +2 −2 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  22. +1 −1 src/server/qgswmsprojectparser.cpp
  23. +1 −1 tests/src/core/testqgs25drenderer.cpp
  24. +1 −1 tests/src/core/testqgsatlascomposition.cpp
  25. +1 −1 tests/src/core/testqgscomposerdd.cpp
  26. +2 −1 tests/src/core/testqgscomposereffects.cpp
  27. +2 −1 tests/src/core/testqgscomposergroup.cpp
  28. +1 −1 tests/src/core/testqgscomposerhtml.cpp
  29. +1 −1 tests/src/core/testqgscomposerlabel.cpp
  30. +3 −3 tests/src/core/testqgscomposermap.cpp
  31. +2 −1 tests/src/core/testqgscomposermapgrid.cpp
  32. +1 −1 tests/src/core/testqgscomposermapoverview.cpp
  33. +2 −1 tests/src/core/testqgscomposermodel.cpp
  34. +2 −1 tests/src/core/testqgscomposermultiframe.cpp
  35. +2 −1 tests/src/core/testqgscomposerobject.cpp
  36. +2 −1 tests/src/core/testqgscomposerpaper.cpp
  37. +2 −1 tests/src/core/testqgscomposerpicture.cpp
  38. +1 −1 tests/src/core/testqgscomposerrotation.cpp
  39. +1 −1 tests/src/core/testqgscomposerscalebar.cpp
  40. +2 −1 tests/src/core/testqgscomposershapes.cpp
  41. +1 −1 tests/src/core/testqgscomposertablev2.cpp
  42. +2 −1 tests/src/core/testqgscomposerutils.cpp
  43. +11 −10 tests/src/core/testqgscomposition.cpp
  44. +1 −1 tests/src/core/testqgspainteffect.cpp
  45. +1 −1 tests/src/python/test_qgsatlascomposition.py
  46. +3 −2 tests/src/python/test_qgscomposereffects.py
  47. +3 −2 tests/src/python/test_qgscomposerhtml.py
  48. +2 −2 tests/src/python/test_qgscomposerlabel.py
  49. +6 −5 tests/src/python/test_qgscomposerlegend.py
  50. +1 −1 tests/src/python/test_qgscomposermap.py
  51. +3 −2 tests/src/python/test_qgscomposermapgrid.py
  52. +5 −4 tests/src/python/test_qgscomposerpicture.py
  53. +3 −2 tests/src/python/test_qgscomposerpolygon.py
  54. +3 −2 tests/src/python/test_qgscomposerpolyline.py
  55. +3 −2 tests/src/python/test_qgscomposershapes.py
  56. +3 −3 tests/src/python/test_qgscomposition.py
  57. +1 −1 tests/src/python/test_qgscoordinatetransform.py
  58. +1 −1 tests/src/python/test_qgslogger.py
  59. +1 −1 tests/src/python/test_qgspallabeling_composer.py
  60. +1 −1 tests/src/python/test_qgsrectangle.py
@@ -615,6 +615,7 @@ QgsComposerTableV2 {#qgis_api_break_3_0_QgsComposerTableV2}
QgsComposition {#qgis_api_break_3_0_QgsComposition}
--------------

- constructor requires QgsProject instance as the second argument
- addItemsFromXML() has been renamed to addItemsFromXml()
- Constructor with QgsMapRenderer parameter has been removed. Use the variant with QgsMapSettings parameter.
- mapRenderer() has been removed. Use mapSettings() instead.
@@ -40,7 +40,7 @@ class QgsComposition : QGraphicsScene, QgsExpressionContextGenerator
Landscape
};

explicit QgsComposition( const QgsMapSettings& mapSettings );
explicit QgsComposition( const QgsMapSettings& mapSettings, QgsProject* project );

/** Composition atlas modes*/
enum AtlasMode
@@ -52,6 +52,14 @@ class QgsComposition : QGraphicsScene, QgsExpressionContextGenerator

~QgsComposition();

/**
* The project associated with the composition. Used to get access to layers, map themes,
* relations and various other bits. It is never null.
*
* \note Added in QGIS 3.0
*/
QgsProject* project() const;

/** Changes size of paper item.
* @param width page width in mm
* @param height page height in mm
@@ -547,7 +547,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
connect( mActionShowRulers, SIGNAL( triggered( bool ) ), this, SLOT( toggleRulers( bool ) ) );

//init undo/redo buttons
mComposition = new QgsComposition( mQgis->mapCanvas()->mapSettings() );
mComposition = new QgsComposition( mQgis->mapCanvas()->mapSettings(), QgsProject::instance() );

mActionUndo->setEnabled( false );
mActionRedo->setEnabled( false );
@@ -3543,7 +3543,7 @@ void QgsComposer::readXml( const QDomElement& composerElem, const QDomDocument&
createComposerView();

//read composition settings
mComposition = new QgsComposition( mQgis->mapCanvas()->mapSettings() );
mComposition = new QgsComposition( mQgis->mapCanvas()->mapSettings(), QgsProject::instance() );
QDomNodeList compositionNodeList = composerElem.elementsByTagName( QStringLiteral( "Composition" ) );
if ( compositionNodeList.size() > 0 )
{
@@ -80,5 +80,5 @@ void QgsAddRemoveItemCommand::switchState()
emit itemAdded( mItem );
mState = Added;
}
QgsProject::instance()->setDirty( true );
mComposition->project()->setDirty( true );
}
@@ -78,7 +78,7 @@ void QgsAddRemoveMultiFrameCommand::switchState()
mComposition->addMultiFrame( mMultiFrame );
mState = Added;
}
QgsProject::instance()->setDirty( true );
mComposition->project()->setDirty( true );
}
}

@@ -45,7 +45,7 @@ QgsAtlasComposition::QgsAtlasComposition( QgsComposition* composition )
{

//listen out for layer removal
connect( QgsProject::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( removeLayers( QStringList ) ) );
connect( mComposition->project(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( removeLayers( QStringList ) ) );
}

void QgsAtlasComposition::setEnabled( bool enabled )
@@ -625,7 +625,7 @@ void QgsAtlasComposition::readXml( const QDomElement& atlasElem, const QDomDocum

// look for stored layer name
QString coverageLayerId = atlasElem.attribute( QStringLiteral( "coverageLayer" ) );
mCoverageLayer = qobject_cast<QgsVectorLayer*>( QgsProject::instance()->mapLayer( coverageLayerId ) );
mCoverageLayer = qobject_cast<QgsVectorLayer*>( mComposition->project()->mapLayer( coverageLayerId ) );

mPageNameExpression = atlasElem.attribute( QStringLiteral( "pageNameExpression" ), QString() );
mSingleFile = atlasElem.attribute( QStringLiteral( "singleFile" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
@@ -718,7 +718,7 @@ QgsExpressionContext QgsAtlasComposition::createExpressionContext()
{
QgsExpressionContext expressionContext;
expressionContext << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
<< QgsExpressionContextUtils::projectScope( mComposition->project() );
if ( mComposition )
expressionContext << QgsExpressionContextUtils::compositionScope( mComposition );

@@ -62,7 +62,7 @@ QgsComposerAttributeTableV2::QgsComposerAttributeTableV2( QgsComposition* compos
, mFeatureFilter( QLatin1String( "" ) )
{
//set first vector layer from layer registry as default one
QMap<QString, QgsMapLayer*> layerMap = QgsProject::instance()->mapLayers();
QMap<QString, QgsMapLayer*> layerMap = mComposition->project()->mapLayers();
QMap<QString, QgsMapLayer*>::const_iterator mapIt = layerMap.constBegin();
for ( ; mapIt != layerMap.constEnd(); ++mapIt )
{
@@ -79,10 +79,11 @@ QgsComposerAttributeTableV2::QgsComposerAttributeTableV2( QgsComposition* compos
//listen for modifications to layer and refresh table when they occur
connect( mVectorLayer, SIGNAL( layerModified() ), this, SLOT( refreshAttributes() ) );
}
connect( QgsProject::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( removeLayer( const QString& ) ) );

if ( mComposition )
{
connect( mComposition->project(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( removeLayer( const QString& ) ) );

//refresh table attributes when composition is refreshed
connect( mComposition, SIGNAL( refreshItemsTriggered() ), this, SLOT( refreshAttributes() ) );

@@ -140,7 +141,7 @@ void QgsComposerAttributeTableV2::setRelationId( const QString& relationId )

QgsVectorLayer* prevLayer = sourceLayer();
mRelationId = relationId;
QgsRelation relation = QgsProject::instance()->relationManager()->relation( mRelationId );
QgsRelation relation = mComposition->project()->relationManager()->relation( mRelationId );
QgsVectorLayer* newLayer = relation.referencingLayer();

if ( mSource == QgsComposerAttributeTableV2::RelationChildren && newLayer != prevLayer )
@@ -438,7 +439,7 @@ bool QgsComposerAttributeTableV2::getTableContents( QgsComposerTableContents &co

if ( mSource == QgsComposerAttributeTableV2::RelationChildren )
{
QgsRelation relation = QgsProject::instance()->relationManager()->relation( mRelationId );
QgsRelation relation = mComposition->project()->relationManager()->relation( mRelationId );
QgsFeature atlasFeature = mComposition->atlasComposition().feature();
req = relation.getRelatedFeaturesRequest( atlasFeature );
}
@@ -564,7 +565,7 @@ QgsVectorLayer *QgsComposerAttributeTableV2::sourceLayer()
return mVectorLayer;
case QgsComposerAttributeTableV2::RelationChildren:
{
QgsRelation relation = QgsProject::instance()->relationManager()->relation( mRelationId );
QgsRelation relation = mComposition->project()->relationManager()->relation( mRelationId );
return relation.referencingLayer();
}
}
@@ -731,7 +732,7 @@ bool QgsComposerAttributeTableV2::readXml( const QDomElement& itemElem, const QD
}
else
{
QgsMapLayer* ml = QgsProject::instance()->mapLayer( layerId );
QgsMapLayer* ml = mComposition->project()->mapLayer( layerId );
if ( ml )
{
mVectorLayer = dynamic_cast<QgsVectorLayer*>( ml );
@@ -185,7 +185,7 @@ void QgsComposerHtml::loadHtml( const bool useCache, const QgsExpressionContext
//set html, using the specified url as base if in Url mode or the project file if in manual mode
const QUrl baseUrl = mContentMode == QgsComposerHtml::Url ?
QUrl( mActualFetchedUrl ) :
QUrl::fromLocalFile( QgsProject::instance()->fileInfo().absoluteFilePath() );
QUrl::fromLocalFile( mComposition->project()->fileInfo().absoluteFilePath() );
mWebPage->mainFrame()->setHtml( loadedHtml, baseUrl );

//set user stylesheet
@@ -547,8 +547,8 @@ void QgsComposerHtml::setExpressionContext( const QgsFeature &feature, QgsVector
if ( mComposition )
{
mDistanceArea->setEllipsoidalMode( mComposition->mapSettings().hasCrsTransformEnabled() );
mDistanceArea->setEllipsoid( mComposition->project()->ellipsoid() );
}
mDistanceArea->setEllipsoid( QgsProject::instance()->ellipsoid() );

// create JSON representation of feature
QgsJSONExporter exporter( layer );
@@ -19,6 +19,7 @@
#include "qgscomposeritem.h"
#include "qgscomposerframe.h"
#include "qgscomposermultiframe.h"
#include "qgscomposition.h"
#include "qgsproject.h"
#include "qgslogger.h"

@@ -114,7 +115,7 @@ void QgsComposerItemCommand::restoreState( QDomDocument& stateDoc ) const

destItem->readXml( stateDoc.documentElement().firstChild().toElement(), stateDoc );
destItem->repaint();
QgsProject::instance()->setDirty( true );
destItem->composition()->project()->setDirty( true );
}

//
@@ -165,7 +165,7 @@ void QgsComposerLabel::contentChanged()
//set this to true after html is loaded.
mHtmlLoaded = false;

const QUrl baseUrl = QUrl::fromLocalFile( QgsProject::instance()->fileInfo().absoluteFilePath() );
const QUrl baseUrl = QUrl::fromLocalFile( mComposition->project()->fileInfo().absoluteFilePath() );
mWebPage->mainFrame()->setHtml( textToDraw, baseUrl );

//For very basic html labels with no external assets, the html load will already be
@@ -265,7 +265,7 @@ void QgsComposerLabel::refreshExpressionContext()
mDistanceArea->setSourceCrs( mComposition->mapSettings().destinationCrs().srsid() );
}
mDistanceArea->setEllipsoidalMode( mComposition->mapSettings().hasCrsTransformEnabled() );
mDistanceArea->setEllipsoid( QgsProject::instance()->ellipsoid() );
mDistanceArea->setEllipsoid( mComposition->project()->ellipsoid() );
contentChanged();

update();
@@ -46,14 +46,14 @@ QgsComposerLegend::QgsComposerLegend( QgsComposition* composition )
, mForceResize( false )
, mSizeToContents( true )
{
mLegendModel = new QgsLegendModel( QgsProject::instance()->layerTreeRoot() );
mLegendModel = new QgsLegendModel( mComposition->project()->layerTreeRoot() );

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

// Connect to the main layertreeroot.
// It serves in "auto update mode" as a medium between the main app legend and this one
connect( QgsProject::instance()->layerTreeRoot(), SIGNAL( customPropertyChanged( QgsLayerTreeNode*, QString ) ), this, SLOT( nodeCustomPropertyChanged( QgsLayerTreeNode*, QString ) ) );
connect( mComposition->project()->layerTreeRoot(), SIGNAL( customPropertyChanged( QgsLayerTreeNode*, QString ) ), this, SLOT( nodeCustomPropertyChanged( QgsLayerTreeNode*, QString ) ) );
}

QgsComposerLegend::QgsComposerLegend()
@@ -225,7 +225,7 @@ bool QgsComposerLegend::resizeToContents() const

void QgsComposerLegend::setCustomLayerTree( QgsLayerTreeGroup* rootGroup )
{
mLegendModel->setRootGroup( rootGroup ? rootGroup : QgsProject::instance()->layerTreeRoot() );
mLegendModel->setRootGroup( rootGroup ? rootGroup : mComposition->project()->layerTreeRoot() );

delete mCustomLayerTree;
mCustomLayerTree = rootGroup;
@@ -237,7 +237,7 @@ void QgsComposerLegend::setAutoUpdateModel( bool autoUpdate )
if ( autoUpdate == autoUpdateModel() )
return;

setCustomLayerTree( autoUpdate ? nullptr : QgsLayerTree::toGroup( QgsProject::instance()->layerTreeRoot()->clone() ) );
setCustomLayerTree( autoUpdate ? nullptr : QgsLayerTree::toGroup( mComposition->project()->layerTreeRoot()->clone() ) );
adjustBoxSize();
updateItem();
}
@@ -414,7 +414,7 @@ bool QgsComposerLegend::writeXml( QDomElement& elem, QDomDocument & doc ) const
return _writeXml( composerLegendElem, doc );
}

static void _readOldLegendGroup( QDomElement& elem, QgsLayerTreeGroup* parentGroup )
static void _readOldLegendGroup( QDomElement& elem, QgsLayerTreeGroup* parentGroup, QgsProject* project )
{
QDomElement itemElem = elem.firstChildElement();

@@ -424,7 +424,7 @@ static void _readOldLegendGroup( QDomElement& elem, QgsLayerTreeGroup* parentGro
if ( itemElem.tagName() == QLatin1String( "LayerItem" ) )
{
QString layerId = itemElem.attribute( QStringLiteral( "layerId" ) );
if ( QgsMapLayer* layer = QgsProject::instance()->mapLayer( layerId ) )
if ( QgsMapLayer* layer = project->mapLayer( layerId ) )
{
QgsLayerTreeLayer* nodeLayer = parentGroup->addLayer( layer );
QString userText = itemElem.attribute( QStringLiteral( "userText" ) );
@@ -447,7 +447,7 @@ static void _readOldLegendGroup( QDomElement& elem, QgsLayerTreeGroup* parentGro
if ( !style.isEmpty() )
nodeGroup->setCustomProperty( QStringLiteral( "legend/title-style" ), style );

_readOldLegendGroup( itemElem, nodeGroup );
_readOldLegendGroup( itemElem, nodeGroup, project );
}

itemElem = itemElem.nextSiblingElement();
@@ -527,7 +527,7 @@ bool QgsComposerLegend::readXml( const QDomElement& itemElem, const QDomDocument
{
// QGIS <= 2.4
QgsLayerTreeGroup* nodeRoot = new QgsLayerTreeGroup();
_readOldLegendGroup( oldLegendModelElem, nodeRoot );
_readOldLegendGroup( oldLegendModelElem, nodeRoot, mComposition->project() );
setCustomLayerTree( nodeRoot );
}
else
@@ -687,7 +687,7 @@ void QgsComposerLegend::doUpdateFilterByMap()
mLegendModel->setLayerStyleOverrides( QMap<QString, QString>() );


bool filterByExpression = QgsLayerTreeUtils::hasLegendFilterExpression( *( mCustomLayerTree ? mCustomLayerTree : QgsProject::instance()->layerTreeRoot() ) );
bool filterByExpression = QgsLayerTreeUtils::hasLegendFilterExpression( *( mCustomLayerTree ? mCustomLayerTree : mComposition->project()->layerTreeRoot() ) );

if ( mComposerMap && ( mLegendFilterByMap || filterByExpression || mInAtlas ) )
{
@@ -77,10 +77,12 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
mXOffset = 0.0;
mYOffset = 0.0;

QgsProject* project = mComposition->project();

//get the color for map canvas background and set map background color accordingly
int bgRedInt = QgsProject::instance()->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorRedPart" ), 255 );
int bgGreenInt = QgsProject::instance()->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorGreenPart" ), 255 );
int bgBlueInt = QgsProject::instance()->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorBluePart" ), 255 );
int bgRedInt = project->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorRedPart" ), 255 );
int bgGreenInt = project->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorGreenPart" ), 255 );
int bgBlueInt = project->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorBluePart" ), 255 );
setBackgroundColor( QColor( bgRedInt, bgGreenInt, bgBlueInt ) );

//calculate mExtent based on width/height ratio and map canvas extent
@@ -544,8 +546,8 @@ QList<QgsMapLayer*> QgsComposerMap::layersToRender( const QgsExpressionContext*
presetName = exprVal.toString();
}

if ( QgsProject::instance()->mapThemeCollection()->hasMapTheme( presetName ) )
renderLayers = QgsProject::instance()->mapThemeCollection()->mapThemeVisibleLayers( presetName );
if ( mComposition->project()->mapThemeCollection()->hasMapTheme( presetName ) )
renderLayers = mComposition->project()->mapThemeCollection()->mapThemeVisibleLayers( presetName );
else // fallback to using map canvas layers
renderLayers = mComposition->mapSettings().layers();
}
@@ -567,7 +569,7 @@ QList<QgsMapLayer*> QgsComposerMap::layersToRender( const QgsExpressionContext*
//need to convert layer names to layer ids
Q_FOREACH ( const QString& name, layerNames )
{
QList< QgsMapLayer* > matchingLayers = QgsProject::instance()->mapLayersByName( name );
QList< QgsMapLayer* > matchingLayers = mComposition->project()->mapLayersByName( name );
Q_FOREACH ( QgsMapLayer* layer, matchingLayers )
{
renderLayers << layer;
@@ -605,8 +607,8 @@ QMap<QString, QString> QgsComposerMap::layerStyleOverridesToRender( const QgsExp
presetName = exprVal.toString();
}

if ( QgsProject::instance()->mapThemeCollection()->hasMapTheme( presetName ) )
return QgsProject::instance()->mapThemeCollection()->mapThemeStyleOverrides( presetName );
if ( mComposition->project()->mapThemeCollection()->hasMapTheme( presetName ) )
return mComposition->project()->mapThemeCollection()->mapThemeStyleOverrides( presetName );
else
return QMap<QString, QString>();
}
@@ -1200,7 +1202,7 @@ bool QgsComposerMap::containsAdvancedEffects() const
void QgsComposerMap::connectUpdateSlot()
{
//connect signal from layer registry to update in case of new or deleted layers
QgsProject* project = QgsProject::instance();
QgsProject* project = mComposition->project();
if ( project )
{
connect( project, SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( layersChanged() ) );
@@ -1403,7 +1405,7 @@ bool QgsComposerMap::readXml( const QDomElement& itemElem, const QDomDocument& d
for ( int i = 0; i < layerIdNodeList.size(); ++i )
{
QString layerId = layerIdNodeList.at( i ).toElement().text();
if ( QgsMapLayer* ml = QgsProject::instance()->mapLayer( layerId ) )
if ( QgsMapLayer* ml = mComposition->project()->mapLayer( layerId ) )
mLayers << ml;
}
}
@@ -1615,7 +1617,7 @@ void QgsComposerMap::syncLayerSet()
QList<QgsMapLayer*> currentLayers;
if ( mKeepLayerSet )
{
currentLayers = QgsProject::instance()->mapLayers().values();
currentLayers = mComposition->project()->mapLayers().values();
}
else //only consider layers visible in the map
{
@@ -624,7 +624,7 @@ void QgsComposerMouseHandles::mouseReleaseEvent( QGraphicsSceneMouseEvent* event
subcommand->saveAfterState();
}
mComposition->undoStack()->push( parentCommand );
QgsProject::instance()->setDirty( true );
mComposition->project()->setDirty( true );
}
else if ( mCurrentMouseMoveAction != QgsComposerMouseHandles::NoAction )
{
@@ -664,7 +664,7 @@ void QgsComposerMouseHandles::mouseReleaseEvent( QGraphicsSceneMouseEvent* event
subcommand->saveAfterState();
}
mComposition->undoStack()->push( parentCommand );
QgsProject::instance()->setDirty( true );
mComposition->project()->setDirty( true );
}

deleteAlignItems();
@@ -17,6 +17,7 @@

#include "qgscomposermultiframecommand.h"
#include "qgscomposermultiframe.h"
#include "qgscomposition.h"
#include "qgsproject.h"

QgsComposerMultiFrameCommand::QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent ):
@@ -68,7 +69,7 @@ void QgsComposerMultiFrameCommand::restoreState( QDomDocument& stateDoc )
if ( mMultiFrame )
{
mMultiFrame->readXml( stateDoc.documentElement().firstChild().toElement(), stateDoc );
QgsProject::instance()->setDirty( true );
mMultiFrame->composition()->project()->setDirty( true );
}
}

0 comments on commit 8c340f7

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