mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
sipify QgsMapLayerCombobox, QgsFieldCombobox
This commit is contained in:
parent
7552d1cc64
commit
bd4f7126e1
@ -361,7 +361,6 @@ gui/qgsexpressionlineedit.sip
|
||||
gui/qgsexpressionselectiondialog.sip
|
||||
gui/qgsextentgroupbox.sip
|
||||
gui/qgsfeatureselectiondlg.sip
|
||||
gui/qgsfieldcombobox.sip
|
||||
gui/qgsfieldmodel.sip
|
||||
gui/qgsfieldproxymodel.sip
|
||||
gui/qgsfieldvalidator.sip
|
||||
@ -393,7 +392,6 @@ gui/qgsmapcanvasitem.sip
|
||||
gui/qgsmapcanvassnappingutils.sip
|
||||
gui/qgsmapcanvastracer.sip
|
||||
gui/qgsmaplayeractionregistry.sip
|
||||
gui/qgsmaplayercombobox.sip
|
||||
gui/qgsmaplayerconfigwidget.sip
|
||||
gui/qgsmaplayerconfigwidgetfactory.sip
|
||||
gui/qgsmapmouseevent.sip
|
||||
|
@ -1,69 +1,105 @@
|
||||
/**
|
||||
* @brief The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
|
||||
* It might be combined with a QgsMapLayerComboBox to automatically update fields according to a chosen layer.
|
||||
* If expression must be used, QgsFieldExpressionWidget shall be used instead.
|
||||
* @see QgsMapLayerComboBox
|
||||
* @note added in 2.3
|
||||
*/
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/gui/qgsfieldcombobox.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsFieldComboBox : QComboBox
|
||||
{
|
||||
%Docstring
|
||||
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
|
||||
It might be combined with a QgsMapLayerComboBox to automatically update fields according to a chosen layer.
|
||||
If expression must be used, QgsFieldExpressionWidget shall be used instead.
|
||||
\see QgsMapLayerComboBox
|
||||
.. versionadded:: 2.3
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsfieldcombobox.h"
|
||||
%End
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief QgsFieldComboBox creates a combo box to display the fields of a layer.
|
||||
* The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox::layerChanged to the slot setLayer.
|
||||
*/
|
||||
|
||||
explicit QgsFieldComboBox( QWidget *parent /TransferThis/ = 0 );
|
||||
%Docstring
|
||||
QgsFieldComboBox creates a combo box to display the fields of a layer.
|
||||
The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox.layerChanged to the slot setLayer.
|
||||
%End
|
||||
|
||||
//! setFilters allows fitering according to the type of field
|
||||
void setFilters( QgsFieldProxyModel::Filters filters );
|
||||
%Docstring
|
||||
setFilters allows fitering according to the type of field
|
||||
%End
|
||||
|
||||
//! currently used filter on list of fields
|
||||
QgsFieldProxyModel::Filters filters() const;
|
||||
%Docstring
|
||||
currently used filter on list of fields
|
||||
:rtype: QgsFieldProxyModel.Filters
|
||||
%End
|
||||
|
||||
/**
|
||||
* Sets whether an optional empty field ("not set") option is shown in the combo box.
|
||||
* @see allowEmptyFieldName()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
void setAllowEmptyFieldName( bool allowEmpty );
|
||||
%Docstring
|
||||
Sets whether an optional empty field ("not set") option is shown in the combo box.
|
||||
\see allowEmptyFieldName()
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
/**
|
||||
* Returns true if the combo box allows the empty field ("not set") choice.
|
||||
* @see setAllowEmptyFieldName()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
bool allowEmptyFieldName() const;
|
||||
%Docstring
|
||||
Returns true if the combo box allows the empty field ("not set") choice.
|
||||
\see setAllowEmptyFieldName()
|
||||
.. versionadded:: 3.0
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
//! return the currently selected field
|
||||
QString currentField() const;
|
||||
%Docstring
|
||||
return the currently selected field
|
||||
:rtype: str
|
||||
%End
|
||||
|
||||
/**
|
||||
* Returns the layer currently associated with the combobox.
|
||||
* @see setLayer()
|
||||
*/
|
||||
QgsVectorLayer* layer() const;
|
||||
QgsVectorLayer *layer() const;
|
||||
%Docstring
|
||||
Returns the layer currently associated with the combobox.
|
||||
\see setLayer()
|
||||
:rtype: QgsVectorLayer
|
||||
%End
|
||||
|
||||
signals:
|
||||
//! the signal is emitted when the currently selected field changes
|
||||
void fieldChanged( const QString& fieldName );
|
||||
void fieldChanged( const QString &fieldName );
|
||||
%Docstring
|
||||
the signal is emitted when the currently selected field changes
|
||||
%End
|
||||
|
||||
public slots:
|
||||
|
||||
/**
|
||||
* Sets the layer for which fields are listed in the combobox. If no layer is set
|
||||
* or a non-vector layer is set then the combobox will be empty.
|
||||
* @see layer()
|
||||
*/
|
||||
void setLayer( QgsMapLayer* layer );
|
||||
void setLayer( QgsMapLayer *layer );
|
||||
%Docstring
|
||||
Sets the layer for which fields are listed in the combobox. If no layer is set
|
||||
or a non-vector layer is set then the combobox will be empty.
|
||||
\see layer()
|
||||
%End
|
||||
|
||||
//! setField sets the currently selected field
|
||||
void setField( const QString& fieldName );
|
||||
void setField( const QString &fieldName );
|
||||
%Docstring
|
||||
setField sets the currently selected field
|
||||
%End
|
||||
|
||||
protected slots:
|
||||
void indexChanged( int i );
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/gui/qgsfieldcombobox.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
@ -1,112 +1,156 @@
|
||||
/**
|
||||
* @brief The QgsMapLayerComboBox class is a combo box which displays the list of layers
|
||||
* @note added in 2.3
|
||||
*/
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/gui/qgsmaplayercombobox.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsMapLayerComboBox : QComboBox
|
||||
{
|
||||
%Docstring
|
||||
The QgsMapLayerComboBox class is a combo box which displays the list of layers
|
||||
.. versionadded:: 2.3
|
||||
%End
|
||||
|
||||
%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 );
|
||||
%Docstring
|
||||
QgsMapLayerComboBox creates a combo box to dislpay the list of layers (currently in the registry).
|
||||
The layers can be filtered and/or ordered.
|
||||
%End
|
||||
|
||||
//! setFilters allows fitering according to layer type and/or geometry type.
|
||||
void setFilters( const QgsMapLayerProxyModel::Filters& filters );
|
||||
void setFilters( QgsMapLayerProxyModel::Filters filters );
|
||||
%Docstring
|
||||
setFilters allows fitering according to layer type and/or geometry type.
|
||||
%End
|
||||
|
||||
//! currently used filter on list layers
|
||||
QgsMapLayerProxyModel::Filters filters() const;
|
||||
%Docstring
|
||||
currently used filter on list layers
|
||||
:rtype: QgsMapLayerProxyModel.Filters
|
||||
%End
|
||||
|
||||
//! except a list of layers not to be listed
|
||||
void setExceptedLayerList( const QList<QgsMapLayer*>& layerList );
|
||||
void setExceptedLayerList( const QList<QgsMapLayer *> &layerList );
|
||||
%Docstring
|
||||
except a list of layers not to be listed
|
||||
%End
|
||||
|
||||
//! returns the list of excepted layers
|
||||
QList<QgsMapLayer*> exceptedLayerList() const;
|
||||
QList<QgsMapLayer *> exceptedLayerList() const;
|
||||
%Docstring
|
||||
returns the list of excepted layers
|
||||
:rtype: list of QgsMapLayer
|
||||
%End
|
||||
|
||||
/**
|
||||
* Sets a list of data providers which should be excluded from the combobox.
|
||||
* @note added in QGIS 3.0
|
||||
* @see excludedProviders()
|
||||
*/
|
||||
void setExcludedProviders( const QStringList& providers );
|
||||
void setExcludedProviders( const QStringList &providers );
|
||||
%Docstring
|
||||
Sets a list of data providers which should be excluded from the combobox.
|
||||
.. versionadded:: 3.0
|
||||
\see excludedProviders()
|
||||
%End
|
||||
|
||||
/**
|
||||
* Returns the list of data providers which are excluded from the combobox.
|
||||
* @see setExcludedProviders()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
QStringList excludedProviders() const;
|
||||
%Docstring
|
||||
Returns the list of data providers which are excluded from the combobox.
|
||||
\see setExcludedProviders()
|
||||
.. versionadded:: 3.0
|
||||
:rtype: list of str
|
||||
%End
|
||||
|
||||
/**
|
||||
* Sets whether an optional empty layer ("not set") option is shown in the combo box.
|
||||
* @see allowEmptyLayer()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
void setAllowEmptyLayer( bool allowEmpty );
|
||||
%Docstring
|
||||
Sets whether an optional empty layer ("not set") option is shown in the combo box.
|
||||
\see allowEmptyLayer()
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
/**
|
||||
* Returns true if the combo box allows the empty layer ("not set") choice.
|
||||
* @see setAllowEmptyLayer()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
bool allowEmptyLayer() const;
|
||||
%Docstring
|
||||
Returns true if the combo box allows the empty layer ("not set") choice.
|
||||
\see setAllowEmptyLayer()
|
||||
.. versionadded:: 3.0
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
/**
|
||||
* Sets whether the CRS of layers is also included in the combo box text.
|
||||
* @see showCrs()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
void setShowCrs( bool showCrs );
|
||||
%Docstring
|
||||
Sets whether the CRS of layers is also included in the combo box text.
|
||||
\see showCrs()
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
/**
|
||||
* Returns true if the combo box shows the layer's CRS.
|
||||
* @see setShowCrs()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
bool showCrs() const;
|
||||
%Docstring
|
||||
Returns true if the combo box shows the layer's CRS.
|
||||
\see setShowCrs()
|
||||
.. versionadded:: 3.0
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @see additionalItems()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
void setAdditionalItems( const QStringList& items );
|
||||
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.
|
||||
\see additionalItems()
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
/**
|
||||
* Return the list of additional (non map layer) items included at the end of the combo box.
|
||||
* @see setAdditionalItems()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
QStringList additionalItems() const;
|
||||
%Docstring
|
||||
Return the list of additional (non map layer) items included at the end of the combo box.
|
||||
\see setAdditionalItems()
|
||||
.. versionadded:: 3.0
|
||||
:rtype: list of str
|
||||
%End
|
||||
|
||||
/** Returns the current layer selected in the combo box.
|
||||
* @see layer
|
||||
*/
|
||||
QgsMapLayer* currentLayer() const;
|
||||
QgsMapLayer *currentLayer() const;
|
||||
%Docstring
|
||||
Returns the current layer selected in the combo box.
|
||||
\see layer
|
||||
:rtype: QgsMapLayer
|
||||
%End
|
||||
|
||||
/** Return the layer currently shown at the specified index within the combo box.
|
||||
* @param layerIndex position of layer to return
|
||||
* @note added in QGIS 2.10
|
||||
* @see currentLayer
|
||||
*/
|
||||
QgsMapLayer* layer( int layerIndex ) const;
|
||||
QgsMapLayer *layer( int layerIndex ) const;
|
||||
%Docstring
|
||||
Return the layer currently shown at the specified index within the combo box.
|
||||
\param layerIndex position of layer to return
|
||||
.. versionadded:: 2.10
|
||||
\see currentLayer
|
||||
:rtype: QgsMapLayer
|
||||
%End
|
||||
|
||||
public slots:
|
||||
//! setLayer set the current layer selected in the combo
|
||||
void setLayer( QgsMapLayer* layer );
|
||||
void setLayer( QgsMapLayer *layer );
|
||||
%Docstring
|
||||
setLayer set the current layer selected in the combo
|
||||
%End
|
||||
|
||||
signals:
|
||||
//! layerChanged this signal is emitted whenever the currently selected layer changes
|
||||
void layerChanged( QgsMapLayer* layer );
|
||||
void layerChanged( QgsMapLayer *layer );
|
||||
%Docstring
|
||||
layerChanged this signal is emitted whenever the currently selected layer changes
|
||||
%End
|
||||
|
||||
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.pl again *
|
||||
************************************************************************/
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "qgsfieldproxymodel.h"
|
||||
#include "qgis_gui.h"
|
||||
|
||||
#include "qgis.h"
|
||||
|
||||
class QgsMapLayer;
|
||||
class QgsVectorLayer;
|
||||
|
||||
@ -44,7 +46,7 @@ class GUI_EXPORT QgsFieldComboBox : public QComboBox
|
||||
* \brief QgsFieldComboBox creates a combo box to display the fields of a layer.
|
||||
* The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox::layerChanged to the slot setLayer.
|
||||
*/
|
||||
explicit QgsFieldComboBox( QWidget *parent = nullptr );
|
||||
explicit QgsFieldComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
|
||||
|
||||
//! setFilters allows fitering according to the type of field
|
||||
void setFilters( QgsFieldProxyModel::Filters filters );
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "qgsmaplayerproxymodel.h"
|
||||
#include "qgis_gui.h"
|
||||
|
||||
#include "qgis.h"
|
||||
|
||||
class QgsMapLayer;
|
||||
class QgsVectorLayer;
|
||||
|
||||
@ -43,7 +45,7 @@ class GUI_EXPORT QgsMapLayerComboBox : public QComboBox
|
||||
* \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 = nullptr );
|
||||
explicit QgsMapLayerComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
|
||||
|
||||
//! setFilters allows fitering according to layer type and/or geometry type.
|
||||
void setFilters( QgsMapLayerProxyModel::Filters filters ) { mProxyModel->setFilters( filters ); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user