2017-04-19 14:49:35 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaplayerproxymodel.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-24 22:53:10 +01:00
|
|
|
class QgsMapLayerProxyModel : QSortFilterProxyModel
|
|
|
|
{
|
2017-04-19 14:49:35 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widgets.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
.. versionadded:: 2.3
|
|
|
|
%End
|
2014-03-24 22:53:10 +01:00
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaplayerproxymodel.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
enum Filter
|
|
|
|
{
|
2014-05-27 23:22:50 +02:00
|
|
|
RasterLayer,
|
|
|
|
NoGeometry,
|
|
|
|
PointLayer,
|
|
|
|
LineLayer,
|
|
|
|
PolygonLayer,
|
|
|
|
HasGeometry,
|
|
|
|
VectorLayer,
|
|
|
|
PluginLayer,
|
2016-03-23 15:05:37 +01:00
|
|
|
WritableLayer,
|
2018-12-12 10:58:43 +01:00
|
|
|
MeshLayer,
|
2017-04-20 13:48:50 +02:00
|
|
|
All
|
|
|
|
};
|
2014-03-24 22:53:10 +01:00
|
|
|
typedef QFlags<QgsMapLayerProxyModel::Filter> Filters;
|
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2014-03-24 22:53:10 +01:00
|
|
|
explicit QgsMapLayerProxyModel( QObject *parent /TransferThis/ = 0 );
|
2017-04-19 14:49:35 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model.
|
2017-12-15 10:36:55 -04:00
|
|
|
It can be used to filter the layers list in a widget.
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsMapLayerModel *sourceLayerModel() const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsMapLayerProxyModel *setFilters( QgsMapLayerProxyModel::Filters filters );
|
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Sets ``filter`` flags which affect how layers are filtered within the model.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-10-23 10:44:47 +10:00
|
|
|
.. seealso:: :py:func:`filters`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
.. versionadded:: 2.3
|
|
|
|
%End
|
2018-10-23 10:44:47 +10:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
const Filters &filters() const;
|
2018-10-23 10:44:47 +10:00
|
|
|
%Docstring
|
|
|
|
Returns the filter flags which affect how layers are filtered within the model.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setFilters`
|
|
|
|
|
|
|
|
.. versionadded:: 2.3
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setLayerWhitelist( const QList<QgsMapLayer *> &layers );
|
|
|
|
%Docstring
|
|
|
|
Sets a whitelist of ``layers`` to include within the model. Only layers
|
|
|
|
from this list will be shown.
|
|
|
|
|
|
|
|
An empty list indicates that no whitelisting should be performed.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`layerWhitelist`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExceptedLayerList`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
|
|
|
QList<QgsMapLayer *> layerWhitelist();
|
|
|
|
%Docstring
|
|
|
|
Returns the list of layers which are excluded from the model.
|
|
|
|
|
|
|
|
An empty list indicates that no whitelisting should be performed.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setLayerWhitelist`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`exceptedLayerList`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
2017-04-19 14:49:35 +02:00
|
|
|
|
|
|
|
void setExceptedLayerList( const QList<QgsMapLayer *> &exceptList );
|
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Sets a blacklist of layers to exclude from the model.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`exceptedLayerList`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExceptedLayerIds`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setLayerWhitelist`
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
2018-10-23 10:44:47 +10:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
QList<QgsMapLayer *> exceptedLayerList();
|
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Returns the blacklist of layers which are excluded from the model.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExceptedLayerList`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`exceptedLayerIds`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`layerWhitelist`
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
2014-03-24 22:53:10 +01:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
void setExceptedLayerIds( const QStringList &ids );
|
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Sets a blacklist of layers (by layer ID) to exclude from the model.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`exceptedLayerIds`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExceptedLayerList`
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
2018-10-23 10:44:47 +10:00
|
|
|
|
2016-03-11 12:34:41 +01:00
|
|
|
QStringList exceptedLayerIds() const;
|
2017-04-19 14:49:35 +02:00
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Returns the blacklist of layer IDs which are excluded from the model.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExceptedLayerIds`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`exceptedLayerList`
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setExcludedProviders( const QStringList &providers );
|
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Sets a blacklist of data providers which should be excluded from the model.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`excludedProviders`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
2016-03-11 12:34:41 +01:00
|
|
|
|
2016-11-16 13:46:20 +10:00
|
|
|
QStringList excludedProviders() const;
|
2017-04-19 14:49:35 +02:00
|
|
|
%Docstring
|
2018-10-23 10:44:47 +10:00
|
|
|
Returns the blacklist of data providers which are excluded from the model.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setExcludedProviders`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
.. versionadded:: 3.0
|
2018-08-22 14:03:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString filterString() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the current filter string, if set.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setFilterString`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
2017-04-19 14:49:35 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const;
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
|
2016-11-16 13:46:20 +10:00
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2018-08-22 14:03:12 +10:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void setFilterString( const QString &filter );
|
|
|
|
%Docstring
|
|
|
|
Sets a ``filter`` string, such that only layers with names matching the
|
|
|
|
specified string will be shown.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`filterString`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2014-03-24 22:53:10 +01:00
|
|
|
};
|
|
|
|
|
2014-09-01 10:40:37 +02:00
|
|
|
QFlags<QgsMapLayerProxyModel::Filter> operator|(QgsMapLayerProxyModel::Filter f1, QFlags<QgsMapLayerProxyModel::Filter> f2);
|
2017-04-19 14:49:35 +02:00
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2017-04-19 14:49:35 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaplayerproxymodel.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|