QGIS/python/gui/auto_generated/qgsfieldcombobox.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

136 lines
3.9 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldcombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFieldComboBox : QComboBox
{
%Docstring(signature="appended")
A combobox which displays the list of fields of a given layer.
It might be combined with a :py:class:`QgsMapLayerComboBox` to
automatically update fields according to a chosen layer. If expression
must be used, :py:class:`QgsFieldExpressionWidget` shall be used
instead.
.. seealso:: :py:class:`QgsMapLayerComboBox`
%End
%TypeHeaderCode
#include "qgsfieldcombobox.h"
%End
public:
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 :py:class:`QgsMapLayerComboBox`.layerChanged to the slot
setLayer.
%End
void setFilters( QgsFieldProxyModel::Filters filters );
%Docstring
setFilters allows filtering according to the type of field
%End
QgsFieldProxyModel::Filters filters() const;
%Docstring
currently used filter on list of fields
%End
void setAllowEmptyFieldName( bool allowEmpty );
%Docstring
Sets whether an optional empty field ("not set") option is shown in the
combo box.
.. seealso:: :py:func:`allowEmptyFieldName`
%End
bool allowEmptyFieldName() const;
%Docstring
Returns ``True`` if the combo box allows the empty field ("not set")
choice.
.. seealso:: :py:func:`setAllowEmptyFieldName`
%End
QString currentField() const;
%Docstring
Returns the currently selected field
%End
QgsVectorLayer *layer() const;
%Docstring
Returns the layer currently associated with the combobox.
.. seealso:: :py:func:`setLayer`
%End
void setFields( const QgsFields &fields );
%Docstring
Manually sets the ``fields`` to use for the combo box.
This method should only be used when the combo box ISN'T associated with
a :py:func:`~QgsFieldComboBox.layer` and needs to show the fields from
an arbitrary field collection instead. Calling
:py:func:`~QgsFieldComboBox.setFields` will automatically clear any
existing :py:func:`~QgsFieldComboBox.layer`.
.. seealso:: :py:func:`fields`
.. versionadded:: 3.14
%End
QgsFields fields() const;
%Docstring
Returns the fields currently shown in the combobox.
This will either be fields from the associated
:py:func:`~QgsFieldComboBox.layer` or the fields manually set by a call
to :py:func:`~QgsFieldComboBox.setFields`.
.. versionadded:: 3.14
%End
signals:
void fieldChanged( const QString &fieldName );
%Docstring
Emitted when the currently selected field changes.
%End
public slots:
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.
.. seealso:: :py:func:`layer`
%End
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.py again *
************************************************************************/