Skip to content
Permalink
Browse files

Add crappy inappropriate icons for layout types

  • Loading branch information
nyalldawson committed Dec 29, 2017
1 parent 66028bc commit 19b058103bcc0ed5dc6ecff272006e34c04716c9
@@ -33,6 +33,11 @@ is transferred to the caller.
Returns the layout's name.

.. seealso:: :py:func:`setName()`
%End

virtual QIcon icon() const = 0;
%Docstring
Returns an icon for the layout.
%End

virtual void setName( const QString &name ) = 0;
@@ -30,6 +30,8 @@ Constructor for QgsPrintLayout.

virtual QgsProject *layoutProject() const;

virtual QIcon icon() const;


QgsLayoutAtlas *atlas();
%Docstring
@@ -39,6 +39,8 @@ Note that ownership is not transferred to ``project``.
%End

virtual QString type() const;
virtual QIcon icon() const;

virtual QgsProject *layoutProject() const;
virtual QgsReport *clone() const /Factory/;

@@ -523,6 +523,11 @@ QVariant QgsLayoutManagerModel::data( const QModelIndex &index, int role ) const
return QVariant();
}

case Qt::DecorationRole:
{
return mLayoutManager->layouts().at( index.row() )->icon();
}

default:
return QVariant();
}
@@ -19,6 +19,7 @@
#include "qgis_core.h"
#include "qgis_sip.h"
#include <QString>
#include <QIcon>

/**
* \ingroup core
@@ -45,6 +46,11 @@ class CORE_EXPORT QgsMasterLayoutInterface
*/
virtual QString name() const = 0;

/**
* Returns an icon for the layout.
*/
virtual QIcon icon() const = 0;

/**
* Sets the layout's name.
* \see name()
@@ -48,6 +48,11 @@ QgsProject *QgsPrintLayout::layoutProject() const
return project();
}

QIcon QgsPrintLayout::icon() const
{
return QgsApplication::getThemeIcon( QStringLiteral( "mActionNewComposer.svg" ) );
}

QgsLayoutAtlas *QgsPrintLayout::atlas()
{
return mAtlas;
@@ -41,6 +41,7 @@ class CORE_EXPORT QgsPrintLayout : public QgsLayout, public QgsMasterLayoutInter

QgsPrintLayout *clone() const override SIP_FACTORY;
QgsProject *layoutProject() const override;
QIcon icon() const override;

/**
* Returns the print layout's atlas.
@@ -24,6 +24,11 @@ QgsReport::QgsReport( QgsProject *project )
, mProject( project )
{}

QIcon QgsReport::icon() const
{
return QgsApplication::getThemeIcon( QStringLiteral( "processingResult.svg" ) );
}

QgsReport *QgsReport::clone() const
{
std::unique_ptr< QgsReport > copy = qgis::make_unique< QgsReport >( mProject );
@@ -53,6 +53,7 @@ class CORE_EXPORT QgsReport : public QObject, public QgsAbstractReportSection, p
QgsReport( QgsProject *project );

QString type() const override { return QStringLiteral( "SectionReport" ); }
QIcon icon() const override;
QgsProject *layoutProject() const override { return mProject; }
QgsReport *clone() const override SIP_FACTORY;
QString name() const override { return mName; }

0 comments on commit 19b0581

Please sign in to comment.
You can’t perform that action at this time.