22 #include <QMessageBox>    33   if ( fi.suffix().compare( QLatin1String( 
"qpt" ), Qt::CaseInsensitive ) != 0 )
    36   QFile templateFile( file );
    37   if ( !templateFile.open( QIODevice::ReadOnly ) )
    39     QMessageBox::warning( iface->
view(), tr( 
"Load from Template" ), tr( 
"Could not read template file." ) );
    43   QDomDocument templateDoc;
    46   if ( templateDoc.setContent( &templateFile ) )
    52       QMessageBox::warning( iface->
view(), tr( 
"Load from Template" ), tr( 
"Could not read template file." ) );
 The class is used as a container of context for various read/write operations on other objects...
 
virtual QgsLayout * layout()=0
Returns the current layout displayed in the designer. 
 
void setPathResolver(const QgsPathResolver &resolver)
Sets up path resolver for conversion between relative and absolute paths. 
 
A common interface for layout designer dialogs and widgets. 
 
Abstract base class that may be implemented to handle new types of data to be dropped in QGIS layouts...
 
bool handleFileDrop(QgsLayoutDesignerInterface *iface, QPointF point, const QString &file) override
Called when the specified file has been dropped onto a QGIS layout. 
 
QList< QgsLayoutItem *> loadFromTemplate(const QDomDocument &document, const QgsReadWriteContext &context, bool clearExisting=true, bool *ok=nullptr)
Load a layout template document. 
 
virtual void selectItems(const QList< QgsLayoutItem * > &items)=0
Selects the specified items. 
 
QgsLayoutQptDropHandler(QObject *parent=nullptr)
constructor 
 
virtual QgsLayoutView * view()=0
Returns the layout view utilized by the designer. 
 
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object. 
 
static QgsProject * instance()
Returns the QgsProject singleton instance.