QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | List of all members
QgsLayoutItemAbstractMetadata Class Referenceabstract

Stores metadata about one layout item class. More...

#include <qgslayoutitemregistry.h>

Inheritance diagram for QgsLayoutItemAbstractMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsLayoutItemAbstractMetadata (int type, const QString &visibleName, const QString &visiblePluralName=QString())
 Constructor for QgsLayoutItemAbstractMetadata with the specified class type and visibleName. More...
 
virtual ~QgsLayoutItemAbstractMetadata ()=default
 
virtual QgsLayoutItemcreateItem (QgsLayout *layout)=0
 Creates a layout item of this class for a specified layout. More...
 
virtual void resolvePaths (QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving)
 Resolve paths in the item's properties (if there are any paths). More...
 
int type () const
 Returns the unique item type code for the layout item class. More...
 
QString visibleName () const
 Returns a translated, user visible name for the layout item class. More...
 
QString visiblePluralName () const
 Returns a translated, user visible name for plurals of the layout item class (e.g. More...
 

Detailed Description

Stores metadata about one layout item class.

A companion class, QgsLayoutItemAbstractGuiMetadata, handles the GUI behavior of QgsLayoutItems.

Note
In C++ you can use QgsLayoutItemMetadata convenience class.
Since
QGIS 3.0

Definition at line 45 of file qgslayoutitemregistry.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemAbstractMetadata()

QgsLayoutItemAbstractMetadata::QgsLayoutItemAbstractMetadata ( int  type,
const QString &  visibleName,
const QString &  visiblePluralName = QString() 
)
inline

Constructor for QgsLayoutItemAbstractMetadata with the specified class type and visibleName.

The optional visiblePluralName argument can be used to specify a plural variant of the item type.

Definition at line 55 of file qgslayoutitemregistry.h.

◆ ~QgsLayoutItemAbstractMetadata()

virtual QgsLayoutItemAbstractMetadata::~QgsLayoutItemAbstractMetadata ( )
virtualdefault

Member Function Documentation

◆ createItem()

virtual QgsLayoutItem* QgsLayoutItemAbstractMetadata::createItem ( QgsLayout layout)
pure virtual

Creates a layout item of this class for a specified layout.

Implemented in QgsLayoutItemMetadata.

◆ resolvePaths()

virtual void QgsLayoutItemAbstractMetadata::resolvePaths ( QVariantMap &  properties,
const QgsPathResolver pathResolver,
bool  saving 
)
inlinevirtual

Resolve paths in the item's properties (if there are any paths).

When saving is true, paths are converted from absolute to relative, when saving is false, paths are converted from relative to absolute. This ensures that paths in project files can be relative, but in item instances the paths are always absolute.

Reimplemented in QgsLayoutItemMetadata.

Definition at line 92 of file qgslayoutitemregistry.h.

◆ type()

int QgsLayoutItemAbstractMetadata::type ( ) const
inline

Returns the unique item type code for the layout item class.

Definition at line 66 of file qgslayoutitemregistry.h.

◆ visibleName()

QString QgsLayoutItemAbstractMetadata::visibleName ( ) const
inline

Returns a translated, user visible name for the layout item class.

See also
visiblePluralName()

Definition at line 72 of file qgslayoutitemregistry.h.

◆ visiblePluralName()

QString QgsLayoutItemAbstractMetadata::visiblePluralName ( ) const
inline

Returns a translated, user visible name for plurals of the layout item class (e.g.

"Labels" for a "Label" item).

Since
QGIS 3.10

Definition at line 78 of file qgslayoutitemregistry.h.


The documentation for this class was generated from the following file: