mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-10-31 00:06:02 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			220 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			220 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsmaplayercombobox.h                                        *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| class QgsMapLayerComboBox : QComboBox
 | |
| {
 | |
| %Docstring(signature="appended")
 | |
| The :py:class:`QgsMapLayerComboBox` class is a combo box which displays the list of layers
 | |
| %End
 | |
| 
 | |
| %TypeHeaderCode
 | |
| #include "qgsmaplayercombobox.h"
 | |
| %End
 | |
|   public:
 | |
| 
 | |
|     explicit QgsMapLayerComboBox( QWidget *parent /TransferThis/ = 0 );
 | |
| %Docstring
 | |
| QgsMapLayerComboBox creates a combo box to display the list of layers (currently in the registry).
 | |
| The layers can be filtered and/or ordered.
 | |
| %End
 | |
| 
 | |
|     void setFilters( Qgis::LayerFilters filters );
 | |
| %Docstring
 | |
| Sets ``filters`` for the layers displayed in the combo box.
 | |
| 
 | |
| This method allows filtering layers according to layer type and/or geometry type.
 | |
| 
 | |
| .. seealso:: :py:func:`filters`
 | |
| %End
 | |
| 
 | |
|  void setFilters( int filters ) /Deprecated/;
 | |
| %Docstring
 | |
| Filters according to layer type and/or geometry type.
 | |
| 
 | |
| .. note::
 | |
| 
 | |
|    for API compatibility
 | |
| 
 | |
| .. versionadded:: 3.34
 | |
| 
 | |
| .. deprecated:: 3.34
 | |
| 
 | |
|    Use the flag signature instead.
 | |
| %End
 | |
| 
 | |
|     Qgis::LayerFilters filters() const;
 | |
| %Docstring
 | |
| Returns any currently used filters on the listed layers.
 | |
| 
 | |
| .. seealso:: :py:func:`setFilters`
 | |
| %End
 | |
| 
 | |
|     void setExceptedLayerList( const QList<QgsMapLayer *> &layerList );
 | |
| %Docstring
 | |
| Sets a list of layers which should be excluded from the combo box.
 | |
| 
 | |
| .. seealso:: :py:func:`exceptedLayerList`
 | |
| %End
 | |
| 
 | |
|     QList<QgsMapLayer *> exceptedLayerList() const;
 | |
| %Docstring
 | |
| Returns a list of layers which should be excluded from the combo box.
 | |
| 
 | |
| .. seealso:: :py:func:`setExceptedLayerList`
 | |
| %End
 | |
| 
 | |
|     void setExcludedProviders( const QStringList &providers );
 | |
| %Docstring
 | |
| Sets a list of data providers which should be excluded from the combobox.
 | |
| 
 | |
| .. seealso:: :py:func:`excludedProviders`
 | |
| %End
 | |
| 
 | |
|     QStringList excludedProviders() const;
 | |
| %Docstring
 | |
| Returns the list of data providers which are excluded from the combobox.
 | |
| 
 | |
| .. seealso:: :py:func:`setExcludedProviders`
 | |
| %End
 | |
| 
 | |
|     void setProject( QgsProject *project );
 | |
| %Docstring
 | |
| Sets the ``project`` from which map layers are shown.
 | |
| 
 | |
| If ``project`` is ``None`` then :py:func:`QgsProject.instance()` will be used.
 | |
| 
 | |
| .. versionadded:: 3.24
 | |
| %End
 | |
| 
 | |
| 
 | |
|     void setAllowEmptyLayer( bool allowEmpty, const QString &text = QString(), const QIcon &icon = QIcon() );
 | |
| %Docstring
 | |
| Sets whether an optional empty layer ("not set") option is shown in the combo box.
 | |
| 
 | |
| Since QGIS 3.20, the optional ``text`` and ``icon`` arguments allows the text and icon for the empty layer item to be set.
 | |
| 
 | |
| .. seealso:: :py:func:`allowEmptyLayer`
 | |
| %End
 | |
| 
 | |
|     bool allowEmptyLayer() const;
 | |
| %Docstring
 | |
| Returns ``True`` if the combo box allows the empty layer ("not set") choice.
 | |
| 
 | |
| .. seealso:: :py:func:`setAllowEmptyLayer`
 | |
| %End
 | |
| 
 | |
|     void setShowCrs( bool showCrs );
 | |
| %Docstring
 | |
| Sets whether the CRS of layers is also included in the combo box text.
 | |
| 
 | |
| .. seealso:: :py:func:`showCrs`
 | |
| %End
 | |
| 
 | |
|     bool showCrs() const;
 | |
| %Docstring
 | |
| Returns ``True`` if the combo box shows the layer's CRS.
 | |
| 
 | |
| .. seealso:: :py:func:`setShowCrs`
 | |
| %End
 | |
| 
 | |
|     void setAdditionalItems( const QStringList &items );
 | |
| %Docstring
 | |
| Sets a list of additional (non map layer) items to include at the end of the combobox.
 | |
| These may represent additional layers such as layers which are not included in the map
 | |
| layer registry, or paths to layers which have not yet been loaded into QGIS.
 | |
| 
 | |
| .. seealso:: :py:func:`additionalItems`
 | |
| %End
 | |
| 
 | |
|     QStringList additionalItems() const;
 | |
| %Docstring
 | |
| Returns the list of additional (non map layer) items included at the end of the combo box.
 | |
| 
 | |
| .. seealso:: :py:func:`setAdditionalItems`
 | |
| %End
 | |
| 
 | |
|     void setAdditionalLayers( const QList<QgsMapLayer *> &layers );
 | |
| %Docstring
 | |
| Sets a list of additional ``layers`` to include in the combobox.
 | |
| 
 | |
| This method allows adding additional layers, which are not part of a project's
 | |
| layers, into the combobox.
 | |
| 
 | |
| .. seealso:: :py:func:`additionalLayers`
 | |
| 
 | |
| .. versionadded:: 3.22
 | |
| %End
 | |
| 
 | |
|     QList< QgsMapLayer * > additionalLayers() const;
 | |
| %Docstring
 | |
| Returns the list of additional layers added to the combobox.
 | |
| 
 | |
| .. seealso:: :py:func:`setAdditionalLayers`
 | |
| 
 | |
| .. versionadded:: 3.22
 | |
| %End
 | |
| 
 | |
|     QgsMapLayer *currentLayer() const;
 | |
| %Docstring
 | |
| Returns the current layer selected in the combo box.
 | |
| 
 | |
| .. seealso:: :py:func:`layer`
 | |
| %End
 | |
| 
 | |
|     QgsMapLayer *layer( int layerIndex ) const;
 | |
| %Docstring
 | |
| Returns the layer currently shown at the specified index within the combo box.
 | |
| 
 | |
| :param layerIndex: position of layer to return
 | |
| 
 | |
| .. seealso:: :py:func:`currentLayer`
 | |
| %End
 | |
| 
 | |
|   public slots:
 | |
| 
 | |
|     void setLayer( QgsMapLayer *layer );
 | |
| %Docstring
 | |
| Sets the current ``layer`` selected in the combo box.
 | |
| %End
 | |
| 
 | |
|   signals:
 | |
|     void layerChanged( QgsMapLayer *layer );
 | |
| %Docstring
 | |
| Emitted whenever the currently selected layer changes.
 | |
| %End
 | |
| 
 | |
|   protected:
 | |
| 
 | |
|     virtual void dragEnterEvent( QDragEnterEvent *event );
 | |
| 
 | |
|     virtual void dragLeaveEvent( QDragLeaveEvent *event );
 | |
| 
 | |
|     virtual void dropEvent( QDropEvent *event );
 | |
| 
 | |
|     virtual void paintEvent( QPaintEvent *e );
 | |
| 
 | |
| 
 | |
|   protected slots:
 | |
|     void indexChanged( int i );
 | |
|     void rowsChanged();
 | |
| 
 | |
| };
 | |
| 
 | |
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsmaplayercombobox.h                                        *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 |