Skip to content

Commit

Permalink
The layouts currently stored with a project are QgsPrintLayouts
Browse files Browse the repository at this point in the history
In future other layout types will be stored in projects, but
for now we only have print layouts
  • Loading branch information
nyalldawson committed Jan 5, 2018
1 parent e6a6db8 commit 83af352
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/composer/qgslayoutmanager.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgsproject.h"
#include "qgslogger.h"
#include "qgslayoutundostack.h"
#include "qgsprintlayout.h"

QgsLayoutManager::QgsLayoutManager( QgsProject *project )
: QObject( project )
Expand Down Expand Up @@ -193,7 +194,7 @@ bool QgsLayoutManager::readXml( const QDomElement &element, const QDomDocument &
const QDomNodeList layoutNodes = element.elementsByTagName( QStringLiteral( "Layout" ) );
for ( int i = 0; i < layoutNodes.size(); ++i )
{
std::unique_ptr< QgsLayout > l = qgis::make_unique< QgsLayout >( mProject );
std::unique_ptr< QgsLayout > l = qgis::make_unique< QgsPrintLayout >( mProject );
l->undoStack()->blockCommands( true );
if ( !l->readXml( layoutNodes.at( i ).toElement(), doc, context ) )
{
Expand Down
5 changes: 5 additions & 0 deletions src/core/layout/qgsprintlayout.cpp
Expand Up @@ -22,3 +22,8 @@ QgsPrintLayout::QgsPrintLayout( QgsProject *project )
, mAtlas( new QgsLayoutAtlas( this ) )
{
}

QgsLayoutAtlas *QgsPrintLayout::atlas()
{
return mAtlas;
}

0 comments on commit 83af352

Please sign in to comment.