QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgsmaplayercombobox.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayercombobox.h
3  --------------------------------------
4  Date : 01.04.2014
5  Copyright : (C) 2014 Denis Rouzaud
6  Email : denis.rouzaud@gmail.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 QGSMAPLAYERCOMBOBOX_H
17 #define QGSMAPLAYERCOMBOBOX_H
18 
19 #include <QComboBox>
20 
21 #include "qgsmaplayerproxymodel.h"
22 
23 class QgsMapLayer;
24 class QgsVectorLayer;
25 
30 class GUI_EXPORT QgsMapLayerComboBox : public QComboBox
31 {
32  Q_OBJECT
33  Q_FLAGS( QgsMapLayerProxyModel::Filters )
34  Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
35 
36  public:
41  explicit QgsMapLayerComboBox( QWidget *parent = 0 );
42 
44  void setFilters( QgsMapLayerProxyModel::Filters filters );
45 
47  QgsMapLayerProxyModel::Filters filters() const { return mProxyModel->filters(); }
48 
50  QgsMapLayer* currentLayer() const;
51 
52  public slots:
54  void setLayer( QgsMapLayer* layer );
55 
56  signals:
58  void layerChanged( QgsMapLayer* layer );
59 
60  protected slots:
61  void indexChanged( int i );
62 
63  private:
64  QgsMapLayerProxyModel* mProxyModel;
65 };
66 
67 #endif // QGSMAPLAYERCOMBOBOX_H
Base class for all map layer types.
Definition: qgsmaplayer.h:48
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widget...
QgsMapLayerProxyModel::Filters filters() const
currently used filter on list layers
Represents a vector layer which manages a vector based data sets.