QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgslayoutmanagermodel.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutmanagermodel.h
3
------------------
4
Date : January 2017
5
Copyright : (C) 2017 Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSLAYOUTMANAGERMODEL_H
17
#define QGSLAYOUTMANAGERMODEL_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsprojectstoredobjectmanagermodel.h
"
22
23
#include <QAbstractListModel>
24
#include <QObject>
25
#include <QSortFilterProxyModel>
26
27
class
QgsProject
;
28
class
QgsPrintLayout
;
29
class
QgsStyleEntityVisitorInterface
;
30
class
QgsLayoutManager
;
31
class
QgsMasterLayoutInterface
;
32
33
43
#ifdef SIP_RUN
44
class
CORE_EXPORT
QgsLayoutManagerModel
:
public
QgsProjectStoredObjectManagerModelBase
// for sip we skip to the base class and avoid the template difficulty
45
{
46
#else
47
class
CORE_EXPORT
QgsLayoutManagerModel
:
public
QgsProjectStoredObjectManagerModel
< QgsMasterLayoutInterface >
48
{
49
#endif
50
Q_OBJECT
51
52
public
:
53
// *INDENT-OFF*
54
61
enum class
CustomRole
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
(
QgsLayoutManagerModel
, Role ) : int
62
{
63
Layout
SIP_MONKEYPATCH_COMPAT_NAME
( LayoutRole ) = Qt::UserRole + 1,
64
};
65
Q_ENUM( CustomRole )
66
// *INDENT-ON*
67
68
71
explicit
QgsLayoutManagerModel
(
QgsLayoutManager
*manager, QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
72
77
QgsMasterLayoutInterface
*layoutFromIndex(
const
QModelIndex &index )
const
;
78
83
QModelIndex indexFromLayout(
QgsMasterLayoutInterface
*layout )
const
;
84
89
void
setAllowEmptyLayout(
bool
allowEmpty );
90
95
bool
allowEmptyLayout
()
const
{
return
allowEmptyObject
(); }
96
};
97
98
107
#ifdef SIP_RUN
108
class
CORE_EXPORT QgsLayoutManagerProxyModel :
public
QgsProjectStoredObjectManagerProxyModelBase
// for sip we skip to the base class and avoid the template difficulty
109
{
110
#else
111
class
CORE_EXPORT
QgsLayoutManagerProxyModel
:
public
QgsProjectStoredObjectManagerProxyModel
< QgsMasterLayoutInterface >
112
{
113
#endif
114
Q_OBJECT
115
public
:
117
enum
Filter
SIP_ENUM_BASETYPE
( IntFlag )
118
{
119
FilterPrintLayouts
= 1 << 1,
120
FilterReports
= 1 << 2,
121
};
122
Q_DECLARE_FLAGS(
Filters
,
Filter
)
123
Q_FLAG(
Filters
)
124
125
128
explicit
QgsLayoutManagerProxyModel
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
129
135
QgsLayoutManagerProxyModel::Filters
filters
()
const
;
136
142
void
setFilters
(
QgsLayoutManagerProxyModel::Filters
filters
);
143
144
protected
:
145
bool
filterAcceptsRowInternal
(
int
sourceRow,
const
QModelIndex &sourceParent )
const override
;
146
147
private
:
148
Filters
mFilters =
Filters
(
FilterPrintLayouts
|
FilterReports
);
149
};
150
151
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QgsLayoutManagerProxyModel::Filters
)
152
#endif
// QGSLAYOUTMANAGERMODEL_H
QgsLayoutManagerModel
List model representing the print layouts and reports available in a layout manager.
Definition
qgslayoutmanagermodel.h:48
QgsLayoutManagerModel::CustomRole
CustomRole
Custom model roles.
Definition
qgslayoutmanagermodel.h:62
QgsLayoutManagerModel::allowEmptyLayout
bool allowEmptyLayout() const
Returns true if the model allows the empty layout ("not set") choice.
Definition
qgslayoutmanagermodel.h:95
QgsLayoutManagerModel::QgsLayoutManagerModel
QgsLayoutManagerModel(QgsLayoutManager *manager, QObject *parent=nullptr)
Constructor for QgsLayoutManagerModel, showing the layouts from the specified manager.
Definition
qgslayoutmanagermodel.cpp:29
QgsLayoutManagerProxyModel::setFilters
void setFilters(QgsLayoutManagerProxyModel::Filters filters)
Sets the current filters used for filtering available layouts.
Definition
qgslayoutmanagermodel.cpp:87
QgsLayoutManagerProxyModel::filters
QgsLayoutManagerProxyModel::Filters filters() const
Returns the current filters used for filtering available layouts.
Definition
qgslayoutmanagermodel.cpp:82
QgsLayoutManagerProxyModel::Filters
QFlags< Filter > Filters
Definition
qgslayoutmanagermodel.h:122
QgsLayoutManagerProxyModel::Filter
Filter
Available filter flags for filtering the model.
Definition
qgslayoutmanagermodel.h:118
QgsLayoutManagerProxyModel::FilterReports
@ FilterReports
Includes reports.
Definition
qgslayoutmanagermodel.h:120
QgsLayoutManagerProxyModel::FilterPrintLayouts
@ FilterPrintLayouts
Includes print layouts.
Definition
qgslayoutmanagermodel.h:119
QgsLayoutManagerProxyModel::QgsLayoutManagerProxyModel
QgsLayoutManagerProxyModel(QObject *parent=nullptr)
Constructor for QgsLayoutManagerProxyModel.
Definition
qgslayoutmanagermodel.cpp:55
QgsLayoutManagerProxyModel::filterAcceptsRowInternal
bool filterAcceptsRowInternal(int sourceRow, const QModelIndex &sourceParent) const override
Returns true if the proxy accepts the matching source row.
Definition
qgslayoutmanagermodel.cpp:59
QgsLayoutManager
Manages storage of a set of layouts.
Definition
qgslayoutmanager.h:50
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition
qgsmasterlayoutinterface.h:45
QgsPrintLayout
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Definition
qgsprintlayout.h:30
QgsProjectStoredObjectManagerModelBase
Base class for list models representing the objects available in a QgsAbstractProjectStoredObjectMana...
Definition
qgsprojectstoredobjectmanagermodel.h:37
QgsProjectStoredObjectManagerModel< QgsMasterLayoutInterface >::QgsProjectStoredObjectManagerModel
QgsProjectStoredObjectManagerModel(QgsAbstractProjectStoredObjectManager< QgsMasterLayoutInterface > *manager, QObject *parent=nullptr)
Definition
qgsprojectstoredobjectmanagermodel.cpp:76
QgsProjectStoredObjectManagerModel< QgsMasterLayoutInterface >::allowEmptyObject
bool allowEmptyObject() const
Definition
qgsprojectstoredobjectmanagermodel.h:130
QgsProjectStoredObjectManagerProxyModel< QgsMasterLayoutInterface >::QgsProjectStoredObjectManagerProxyModel
QgsProjectStoredObjectManagerProxyModel(QObject *parent=nullptr)
Definition
qgsprojectstoredobjectmanagermodel.cpp:434
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:114
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition
qgsstyleentityvisitor.h:34
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_ENUM_BASETYPE
#define SIP_ENUM_BASETYPE(type)
Definition
qgis_sip.h:277
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition
qgis_sip.h:270
SIP_MONKEYPATCH_COMPAT_NAME
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition
qgis_sip.h:272
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTimeZoneComboBox::StandardItems)
qgsprojectstoredobjectmanagermodel.h
Generated on
for QGIS API Documentation by
1.17.0