2014-03-24 22:53:10 +01:00
|
|
|
/**
|
|
|
|
* @brief The QgsMapLayerComboBox class is a combo box which displays the list of layers
|
|
|
|
* @note added in 2.3
|
|
|
|
*/
|
|
|
|
class QgsMapLayerComboBox : QComboBox
|
|
|
|
{
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaplayercombobox.h"
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief QgsMapLayerComboBox creates a combo box to dislpay the list of layers (currently in the registry).
|
|
|
|
* The layers can be filtered and/or ordered.
|
|
|
|
*/
|
|
|
|
explicit QgsMapLayerComboBox( QWidget *parent /TransferThis/ = 0 );
|
|
|
|
|
2014-05-02 09:59:30 +02:00
|
|
|
//! setFilters allows fitering according to layer type and/or geometry type.
|
2014-03-24 22:53:10 +01:00
|
|
|
void setFilters( QgsMapLayerProxyModel::Filters filters );
|
|
|
|
|
2014-05-02 09:59:30 +02:00
|
|
|
//! currently used filter on list layers
|
2014-09-01 16:45:54 +02:00
|
|
|
QgsMapLayerProxyModel::Filters filters() const;
|
2014-05-02 09:59:30 +02:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
//! currentLayer returns the current layer selected in the combo box
|
2014-09-02 08:10:32 +02:00
|
|
|
QgsMapLayer* currentLayer() const;
|
2014-03-24 22:53:10 +01:00
|
|
|
|
|
|
|
public slots:
|
2014-05-02 09:59:30 +02:00
|
|
|
//! setLayer set the current layer selected in the combo
|
2014-03-24 22:53:10 +01:00
|
|
|
void setLayer( QgsMapLayer* layer );
|
|
|
|
|
|
|
|
signals:
|
2014-05-02 09:59:30 +02:00
|
|
|
//! layerChanged this signal is emitted whenever the currently selected layer changes
|
2014-03-24 22:53:10 +01:00
|
|
|
void layerChanged( QgsMapLayer* layer );
|
|
|
|
};
|