The layouts currently stored with a project are QgsPrintLayouts

In future other layout types will be stored in projects, but
for now we only have print layouts
This commit is contained in:
Nyall Dawson 2017-12-19 14:59:32 +10:00
parent e6a6db89a1
commit 83af35275e
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,7 @@
#include "qgsproject.h"
#include "qgslogger.h"
#include "qgslayoutundostack.h"
#include "qgsprintlayout.h"
QgsLayoutManager::QgsLayoutManager( QgsProject *project )
: QObject( project )
@ -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 ) )
{

View File

@ -22,3 +22,8 @@ QgsPrintLayout::QgsPrintLayout( QgsProject *project )
, mAtlas( new QgsLayoutAtlas( this ) )
{
}
QgsLayoutAtlas *QgsPrintLayout::atlas()
{
return mAtlas;
}