mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Better display names for page items
These can't have ids set, so default to a nicer looking name
This commit is contained in:
parent
6bf088a106
commit
0f2a4828e4
@ -48,6 +48,8 @@ The caller takes responsibility for deleting the returned object.
|
||||
|
||||
virtual int type() const;
|
||||
|
||||
virtual QString displayName() const;
|
||||
|
||||
|
||||
void setPageSize( const QgsLayoutSize &size );
|
||||
%Docstring
|
||||
|
@ -56,6 +56,11 @@ int QgsLayoutItemPage::type() const
|
||||
return QgsLayoutItemRegistry::LayoutPage;
|
||||
}
|
||||
|
||||
QString QgsLayoutItemPage::displayName() const
|
||||
{
|
||||
return QObject::tr( "Page" );
|
||||
}
|
||||
|
||||
void QgsLayoutItemPage::setPageSize( const QgsLayoutSize &size )
|
||||
{
|
||||
attemptResize( size );
|
||||
|
@ -84,6 +84,7 @@ class CORE_EXPORT QgsLayoutItemPage : public QgsLayoutItem
|
||||
static QgsLayoutItemPage *create( QgsLayout *layout ) SIP_FACTORY;
|
||||
|
||||
int type() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
/**
|
||||
* Sets the \a size of the page.
|
||||
|
@ -89,7 +89,7 @@ void TestQgsLayoutExporter::testHandleLayeredExport()
|
||||
res = exporter.handleLayeredExport( items, exportFunc );
|
||||
QCOMPARE( res, QgsLayoutExporter::Success );
|
||||
QCOMPARE( layerIds, QList< unsigned int >() << 1 );
|
||||
QCOMPARE( layerNames, QStringList() << QStringLiteral( "<Page>" ) );
|
||||
QCOMPARE( layerNames, QStringList() << QStringLiteral( "Page" ) );
|
||||
QCOMPARE( mapLayerIds, QStringList() << QString() );
|
||||
layerIds.clear();
|
||||
layerNames.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user